summaryrefslogtreecommitdiffstats
path: root/src/com/android/packageinstaller/permission/ui/AppPermissionsFragment.java
diff options
context:
space:
mode:
authorSvet Ganov <svetoslavganov@google.com>2015-05-14 19:34:07 -0700
committerSvet Ganov <svetoslavganov@google.com>2015-05-14 19:42:08 -0700
commit4ef4881c8625437083c4fee36a68b235c5c36b2b (patch)
treea916f3709bbc72ef64a8f94feb8d6319b510a280 /src/com/android/packageinstaller/permission/ui/AppPermissionsFragment.java
parente80b9b7f4d4220e0b3b32a7f676fe805f87006c4 (diff)
downloadandroid_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.java10
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)