Fixed permission controller deny callbacks
Fixed issue which caused all permission deny callbacks to be sent with the UID of the user 0 package, regardless of the package's true UID. Test: On a device with multiple users, register a permission change callback for the second user version of a package, and deny a granted permission. The callback should fire. Change-Id: Ice7e9accb150a866082e018f57ab9eb0b3100675
This commit is contained in:
@@ -1222,7 +1222,8 @@ public class PermissionManagerService extends IPermissionManager.Stub {
|
||||
return;
|
||||
}
|
||||
|
||||
final int uid = UserHandle.getUid(userId, pkg.applicationInfo.uid);
|
||||
final int uid = UserHandle.getUid(userId,
|
||||
UserHandle.getAppId(pkg.applicationInfo.uid));
|
||||
|
||||
final PackageSetting ps = (PackageSetting) pkg.mExtras;
|
||||
final PermissionsState permissionsState = ps.getPermissionsState();
|
||||
@@ -1422,7 +1423,8 @@ public class PermissionManagerService extends IPermissionManager.Stub {
|
||||
}
|
||||
|
||||
if (callback != null) {
|
||||
callback.onPermissionRevoked(pkg.applicationInfo.uid, userId);
|
||||
callback.onPermissionRevoked(UserHandle.getUid(userId,
|
||||
UserHandle.getAppId(pkg.applicationInfo.uid)), userId);
|
||||
}
|
||||
|
||||
if (bp.isRuntime()) {
|
||||
|
||||
Reference in New Issue
Block a user