From 01af6a42a6a008d4b208a92510537791b261168c Mon Sep 17 00:00:00 2001 From: Svetoslav Date: Tue, 27 Oct 2015 15:22:39 -0700 Subject: Make SYSTEM_ALERT_WINDOW development permission bug:25329324 Change-Id: I0086464846bab9424764dd0d726692d96a0f1207 --- .../com/android/server/pm/PackageManagerService.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'services') diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java index 8e6e688..23f45e8 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); -- cgit v1.1