diff options
author | Svet Ganov <svetoslavganov@google.com> | 2015-05-14 19:34:07 -0700 |
---|---|---|
committer | Svet Ganov <svetoslavganov@google.com> | 2015-05-14 19:42:08 -0700 |
commit | 4ef4881c8625437083c4fee36a68b235c5c36b2b (patch) | |
tree | a916f3709bbc72ef64a8f94feb8d6319b510a280 /src/com/android/packageinstaller/permission/ui/AppPermissionsFragment.java | |
parent | e80b9b7f4d4220e0b3b32a7f676fe805f87006c4 (diff) | |
download | android_packages_apps_PackageInstaller-4ef4881c8625437083c4fee36a68b235c5c36b2b.tar.gz android_packages_apps_PackageInstaller-4ef4881c8625437083c4fee36a68b235c5c36b2b.tar.bz2 android_packages_apps_PackageInstaller-4ef4881c8625437083c4fee36a68b235c5c36b2b.zip |
Don't show permission with no app ops.
We have some permissions that we will be getting rid of and for
that reason do not have app ops. Such permission were showing in
the UI for legacy apps but changing them has no effect because
there is no app ops support. We are not not showing them in the
UI to avoid user frustration.
bug:21168530
Change-Id: I2b6988f003e27b266fb2b48ddbb692ae5cf131fb
Diffstat (limited to 'src/com/android/packageinstaller/permission/ui/AppPermissionsFragment.java')
-rw-r--r-- | src/com/android/packageinstaller/permission/ui/AppPermissionsFragment.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/com/android/packageinstaller/permission/ui/AppPermissionsFragment.java b/src/com/android/packageinstaller/permission/ui/AppPermissionsFragment.java index a7c404cc..f0e8dba4 100644 --- a/src/com/android/packageinstaller/permission/ui/AppPermissionsFragment.java +++ b/src/com/android/packageinstaller/permission/ui/AppPermissionsFragment.java @@ -180,6 +180,14 @@ public final class AppPermissionsFragment extends SettingsWithHeader if (group.isSystemFixed()) { continue; } + + // Yes this is possible. We have leftover permissions that + // are not in the final groups and we want to get rid of, + // therefore we do not have app ops for legacy support. + if (!group.hasRuntimePermission() && !group.hasAppOpPermission()) { + continue; + } + SwitchPreference preference = new SwitchPreference(activity); preference.setOnPreferenceChangeListener(this); preference.setKey(group.getName()); @@ -232,7 +240,7 @@ public final class AppPermissionsFragment extends SettingsWithHeader if (newValue == Boolean.TRUE) { group.grantRuntimePermissions(false); } else { - if (group.isAppOpPermission() && !mHasConfirmedRevoke) { + if (group.hasAppOpPermission() && !mHasConfirmedRevoke) { new AlertDialog.Builder(getContext()) .setMessage(R.string.old_sdk_deny_warning) .setNegativeButton(R.string.cancel, null) |