Handle renamed packages during default grants
If a device has a privileged app on the system image which was updated and a future 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. Test: Manual Change-Id: Id7255c92a4a52e368266739cd331977256eee2d3 Fixes: 62376260
This commit is contained in:
@@ -936,7 +936,7 @@ final class DefaultPermissionGrantPolicy {
|
||||
// permissions if the version on the system image does not declare them.
|
||||
if (!isDefaultPhoneOrSms && pkg.isUpdatedSystemApp()) {
|
||||
PackageSetting sysPs = mService.mSettings.getDisabledSystemPkgLPr(pkg.packageName);
|
||||
if (sysPs != null) {
|
||||
if (sysPs != null && sysPs.pkg != null) {
|
||||
if (sysPs.pkg.requestedPermissions.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user