@@ -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