diff options
author | Svetoslav <svetoslavganov@google.com> | 2015-05-19 16:49:11 -0700 |
---|---|---|
committer | Svetoslav <svetoslavganov@google.com> | 2015-05-19 19:00:00 -0700 |
commit | 81efecb1ac5cf569afcf71a5ead697d70d096e68 (patch) | |
tree | 4dedda64ec4d813f2ae417d904bc9dba2fbfa4d7 /src | |
parent | f87a5bbd5499dd34c12d8858c93ef9f024a88e3c (diff) | |
download | android_packages_apps_PackageInstaller-81efecb1ac5cf569afcf71a5ead697d70d096e68.tar.gz android_packages_apps_PackageInstaller-81efecb1ac5cf569afcf71a5ead697d70d096e68.tar.bz2 android_packages_apps_PackageInstaller-81efecb1ac5cf569afcf71a5ead697d70d096e68.zip |
Prevent modification of system fixed permissions
Change-Id: I84c9085550c910fe7ae5953796f164d72077c4bb
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/packageinstaller/permission/model/AppPermissionGroup.java | 10 | ||||
-rw-r--r-- | src/com/android/packageinstaller/permission/ui/AppPermissionsFragment.java | 2 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/com/android/packageinstaller/permission/model/AppPermissionGroup.java b/src/com/android/packageinstaller/permission/model/AppPermissionGroup.java index 5c40c32e..a018f8c2 100644 --- a/src/com/android/packageinstaller/permission/model/AppPermissionGroup.java +++ b/src/com/android/packageinstaller/permission/model/AppPermissionGroup.java @@ -248,6 +248,11 @@ public final class AppPermissionGroup implements Comparable<AppPermissionGroup> // to the permission if the permission is granted to the app. for (Permission permission : mPermissions.values()) { if (mAppSupportsRuntimePermissions) { + // Do not touch permissions fixed by the system. + if (permission.isSystemFixed()) { + return false; + } + // Grant the permission if needed. if (!permission.isGranted()) { permission.setGranted(true); @@ -334,6 +339,11 @@ public final class AppPermissionGroup implements Comparable<AppPermissionGroup> // to the permission if the permission is granted to the app. for (Permission permission : mPermissions.values()) { if (mAppSupportsRuntimePermissions) { + // Do not touch permissions fixed by the system. + if (permission.isSystemFixed()) { + return false; + } + // Revoke the permission if needed. if (permission.isGranted()) { permission.setGranted(false); diff --git a/src/com/android/packageinstaller/permission/ui/AppPermissionsFragment.java b/src/com/android/packageinstaller/permission/ui/AppPermissionsFragment.java index 0659070c..3efc35dc 100644 --- a/src/com/android/packageinstaller/permission/ui/AppPermissionsFragment.java +++ b/src/com/android/packageinstaller/permission/ui/AppPermissionsFragment.java @@ -222,7 +222,7 @@ public final class AppPermissionsFragment extends SettingsWithHeader extraPerms.setTitle(R.string.additional_permissions); for (AppPermissionGroup group : mAppPermissions.getPermissionGroups()) { - // We currently will not show permissions fixed by the system + // We currently will not show permissions fixed by the system. // which is what the system does for system components. if (group.isSystemFixed()) { continue; |