Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8f6a909e authored by Nate Myren's avatar Nate Myren
Browse files

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
parent 4754882b
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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()) {