summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Svet Ganov <svetoslavganov@google.com> 2015-11-17 11:53:18 -0800
committer Svet Ganov <svetoslavganov@google.com> 2015-11-17 11:53:31 -0800
commitf443384d9e30111aaa61dac75af1f40d19465e96 (patch)
treea351a30dd719c11cb5b0ae3d3ba9c2fcf5e2153e
parent5603eca33c8e322997029d3101fd2442df3c274e (diff)
Handle renamed packages during default grants
If an L device has a privileged app on the system image which was updated and an M OTA renames the app package (supported only for privileged apps) we end up with a disabled system package setting with no package information. Since we are not doing a null check of the package we get from the disabled package settings during default grants we crash leaving the system in a bad state. bug:25687380 Change-Id: I4f2ebcaf471e4bd1696298eab4716b50c52ca5c4
-rw-r--r--services/core/java/com/android/server/pm/DefaultPermissionGrantPolicy.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/pm/DefaultPermissionGrantPolicy.java b/services/core/java/com/android/server/pm/DefaultPermissionGrantPolicy.java
index a7682dc06d18..a5c6180396bf 100644
--- a/services/core/java/com/android/server/pm/DefaultPermissionGrantPolicy.java
+++ b/services/core/java/com/android/server/pm/DefaultPermissionGrantPolicy.java
@@ -848,7 +848,7 @@ final class DefaultPermissionGrantPolicy {
return false;
}
PackageSetting sysPkg = mService.mSettings.getDisabledSystemPkgLPr(pkg.packageName);
- if (sysPkg != null) {
+ if (sysPkg != null && sysPkg.pkg != null) {
if ((sysPkg.pkg.applicationInfo.flags & ApplicationInfo.FLAG_PERSISTENT) == 0) {
return false;
}