Skip to content

Commit 8ef15c5

Browse files
author
Linux Build Service Account
committed
Merge 7d83a5d on remote branch
Change-Id: I29e3148c75a2aef4a668e07b7a4f889af70e804b
2 parents be2a8bf + 7d83a5d commit 8ef15c5

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/com/android/packageinstaller/permission/ui/handheld/AppPermissionsFragment.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ private void loadPreferences() {
241241
}
242242
mExtraScreen.addPreference(preference);
243243
}
244-
if (AppPermissionGroup.isStrictOpEnable()) {
244+
if (AppPermissionGroup.isStrictOpEnable() && isPlatform) {
245245
try {
246246
PackageManager pm = context.getPackageManager();
247247
for (Permission permission : group.getPermissions()) {
@@ -357,9 +357,11 @@ public boolean onPreferenceChange(final Preference preference, Object newValue)
357357
LocationUtils.showLocationDialog(getContext(), mAppPermissions.getAppLabel());
358358
return false;
359359
}
360+
361+
final boolean isPlatform = group.getDeclaringPackage().equals(Utils.OS_PKG);
360362
if (newValue == Boolean.TRUE) {
361363
group.grantRuntimePermissions(false);
362-
if (AppPermissionGroup.isStrictOpEnable()) {
364+
if (AppPermissionGroup.isStrictOpEnable() && isPlatform) {
363365
updateEveryPermissionPreference(group);
364366
}
365367
} else {
@@ -375,7 +377,7 @@ public boolean onPreferenceChange(final Preference preference, Object newValue)
375377
public void onClick(DialogInterface dialog, int which) {
376378
((SwitchPreference) preference).setChecked(false);
377379
group.revokeRuntimePermissions(false);
378-
if (AppPermissionGroup.isStrictOpEnable()) {
380+
if (AppPermissionGroup.isStrictOpEnable() && isPlatform) {
379381
updateEveryPermissionPreference(group);
380382
}
381383
if (!grantedByDefault) {
@@ -387,7 +389,7 @@ public void onClick(DialogInterface dialog, int which) {
387389
return false;
388390
} else {
389391
group.revokeRuntimePermissions(false);
390-
if (AppPermissionGroup.isStrictOpEnable()) {
392+
if (AppPermissionGroup.isStrictOpEnable() && isPlatform) {
391393
updateEveryPermissionPreference(group);
392394
}
393395
}

0 commit comments

Comments
 (0)