summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorLars Greiss <kufikugel@googlemail.com>2013-06-30 03:54:10 +0200
committerGerrit Code Review <gerrit@cyanogenmod.org>2013-06-30 19:11:50 -0700
commit9e3fa9cb673f69aa69de0294bebba61d10befddc (patch)
tree18051b69542960775293b9b3d5cf4889ae1dfb8d /services
parentab5d5e7d0a28b5ef04527c00a2454472518b490f (diff)
downloadframeworks_base-9e3fa9cb673f69aa69de0294bebba61d10befddc.zip
frameworks_base-9e3fa9cb673f69aa69de0294bebba61d10befddc.tar.gz
frameworks_base-9e3fa9cb673f69aa69de0294bebba61d10befddc.tar.bz2
Frameworks: privacy guard fix possible NPE
If the user flash a data app over recovery on clean flash (like a lot themed apps or gapps packages are doing) the user will get into a bootloop because of an NPE due an unknown state of the user due that installedUser == null To fix it Check if installUser exists if yes then call the provider settings value for the current user PatchSet 2+3: message update fix for real now Change-Id: Ie5f94a0d0a11ae24fdfdc8372c0433b26793b66e
Diffstat (limited to 'services')
-rw-r--r--services/java/com/android/server/pm/Settings.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/services/java/com/android/server/pm/Settings.java b/services/java/com/android/server/pm/Settings.java
index f2074b0..4b716ed 100644
--- a/services/java/com/android/server/pm/Settings.java
+++ b/services/java/com/android/server/pm/Settings.java
@@ -444,10 +444,13 @@ final class Settings {
final boolean installed = installUser == null
|| installUser.getIdentifier() == UserHandle.USER_ALL
|| installUser.getIdentifier() == user.id;
- final boolean privacyGuard = android.provider.Settings.Secure.getIntForUser(
+ boolean privacyGuard = false;
+ if (installUser != null) {
+ privacyGuard = android.provider.Settings.Secure.getIntForUser(
mContext.getContentResolver(),
android.provider.Settings.Secure.PRIVACY_GUARD_DEFAULT,
0, user.id) == 1;
+ }
p.setUserState(user.id, COMPONENT_ENABLED_STATE_DEFAULT,
installed,
true, // stopped,