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

Commit b9be4d4d authored by Stanislav Zholnin's avatar Stanislav Zholnin
Browse files

Make getHistoricalOps() properly handle multi-user functionality.

Correct callingUid check in getHistoricalOps() API call so that
PermissionController requests coming from any user on device
were handled properly.

Test: manually verified
Fix: 186871955
Change-Id: I667899ea8e656dd1a7ac974a28bfe5c5d84f5f54
parent f8d2743d
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -2341,8 +2341,9 @@ public class AppOpsService extends IAppOpsService.Stub {
            boolean isCallerSystem = Binder.getCallingPid() == Process.myPid();
            boolean isCallerPermissionController;
            try {
                isCallerPermissionController = pm.getPackageUid(
                        mContext.getPackageManager().getPermissionControllerPackageName(), 0)
                isCallerPermissionController = pm.getPackageUidAsUser(
                        mContext.getPackageManager().getPermissionControllerPackageName(), 0,
                        UserHandle.getUserId(Binder.getCallingUid()))
                        == Binder.getCallingUid();
            } catch (PackageManager.NameNotFoundException doesNotHappen) {
                return;