summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/com/android/packageinstaller/permission/ui/wear/AppPermissionsFragmentWear.java17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/com/android/packageinstaller/permission/ui/wear/AppPermissionsFragmentWear.java b/src/com/android/packageinstaller/permission/ui/wear/AppPermissionsFragmentWear.java
index d2d1f71..3161567 100644
--- a/src/com/android/packageinstaller/permission/ui/wear/AppPermissionsFragmentWear.java
+++ b/src/com/android/packageinstaller/permission/ui/wear/AppPermissionsFragmentWear.java
@@ -137,9 +137,13 @@ public final class AppPermissionsFragmentWear extends PreferenceFragment {
// Also refresh the UI
for (final AppPermissionGroup group : mAppPermissions.getPermissionGroups()) {
- Preference pref = findPreference(group.getName());
- if (pref instanceof SwitchPreference) {
- ((SwitchPreference) pref).setChecked(group.areRuntimePermissionsGranted());
+ if (Utils.areGroupPermissionsIndividuallyControlled(getContext(), group.getName())) {
+ for (PermissionInfo perm : getPermissionInfosFromGroup(group)) {
+ setPreferenceCheckedIfPresent(perm.name,
+ group.areRuntimePermissionsGranted(new String[]{ perm.name }));
+ }
+ } else {
+ setPreferenceCheckedIfPresent(group.getName(), group.areRuntimePermissionsGranted());
}
}
}
@@ -304,4 +308,11 @@ public final class AppPermissionsFragmentWear extends PreferenceFragment {
}
return permInfos;
}
+
+ private void setPreferenceCheckedIfPresent(String preferenceKey, boolean checked) {
+ Preference pref = findPreference(preferenceKey);
+ if (pref instanceof SwitchPreference) {
+ ((SwitchPreference) pref).setChecked(checked);
+ }
+ }
}