diff options
author | Svetoslav Ganov <svetoslavganov@google.com> | 2015-10-29 01:10:46 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-10-29 01:10:46 +0000 |
commit | 2658cb002abae9341c9a82bfeaed764ba5bf97c8 (patch) | |
tree | 41e4e6ced6e2948becaf015ec6055247c62f6b84 | |
parent | c7522c0b1c3b8f445ddc1b75f0600363ecbd27a6 (diff) | |
parent | 01af6a42a6a008d4b208a92510537791b261168c (diff) | |
download | frameworks_base-2658cb002abae9341c9a82bfeaed764ba5bf97c8.zip frameworks_base-2658cb002abae9341c9a82bfeaed764ba5bf97c8.tar.gz frameworks_base-2658cb002abae9341c9a82bfeaed764ba5bf97c8.tar.bz2 |
Merge "Make SYSTEM_ALERT_WINDOW development permission" into mnc-dr-dev
-rw-r--r-- | core/res/AndroidManifest.xml | 2 | ||||
-rw-r--r-- | services/core/java/com/android/server/pm/PackageManagerService.java | 18 |
2 files changed, 11 insertions, 9 deletions
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml index acdfb1f..3eed013 100644 --- a/core/res/AndroidManifest.xml +++ b/core/res/AndroidManifest.xml @@ -1461,7 +1461,7 @@ <permission android:name="android.permission.SYSTEM_ALERT_WINDOW" android:label="@string/permlab_systemAlertWindow" android:description="@string/permdesc_systemAlertWindow" - android:protectionLevel="signature|preinstalled|appop|pre23" /> + android:protectionLevel="signature|preinstalled|appop|pre23|development" /> <!-- ================================== --> <!-- Permissions affecting the system wallpaper --> diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java index 61e5acc..5977a1b 100644 --- a/services/core/java/com/android/server/pm/PackageManagerService.java +++ b/services/core/java/com/android/server/pm/PackageManagerService.java @@ -1713,13 +1713,14 @@ public class PackageManagerService extends IPackageManager.Stub { return; } - PermissionsState permissionsState = sb.getPermissionsState(); - - for (String permission : pkg.requestedPermissions) { - BasePermission bp = mSettings.mPermissions.get(permission); - if (bp != null && bp.isRuntime() && (grantedPermissions == null - || ArrayUtils.contains(grantedPermissions, permission))) { - permissionsState.grantRuntimePermission(bp, userId); + synchronized (mPackages) { + for (String permission : pkg.requestedPermissions) { + BasePermission bp = mSettings.mPermissions.get(permission); + if (bp != null && (bp.isRuntime() || bp.isDevelopment()) + && (grantedPermissions == null + || ArrayUtils.contains(grantedPermissions, permission))) { + grantRuntimePermission(pkg.packageName, permission, userId); + } } } } @@ -3519,7 +3520,8 @@ public class PackageManagerService extends IPackageManager.Stub { killUid(appId, userId, KILL_APP_REASON_GIDS_CHANGED); } }); - } break; + } + break; } mOnPermissionChangeListeners.onPermissionsChanged(uid); |