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

Commit 0d11f702 authored by Songchun Fan's avatar Songchun Fan Committed by Automerger Merge Worker
Browse files

Merge "bypass INTERACT_ACROSS_USERS permission check when binding to singleton...

Merge "bypass INTERACT_ACROSS_USERS permission check when binding to singleton service for non-0 userId" into rvc-dev am: 4cdb5dde

Original change: undetermined

Change-Id: Ie05b2a3cae65663eed824822c0bc3819235423c1
parents d4fbf286 4cdb5dde
Loading
Loading
Loading
Loading
+15 −9
Original line number Diff line number Diff line
@@ -2460,6 +2460,9 @@ public final class ActiveServices {
                            && mAm.isValidSingletonCall(callingUid, sInfo.applicationInfo.uid)) {
                        userId = 0;
                        smap = getServiceMapLocked(0);
                        // Bypass INTERACT_ACROSS_USERS permission check
                        final long token = Binder.clearCallingIdentity();
                        try {
                            ResolveInfo rInfoForUserId0 =
                                    mAm.getPackageManagerInternalLocked().resolveService(service,
                                            resolvedType, flags, userId, callingUid);
@@ -2470,6 +2473,9 @@ public final class ActiveServices {
                                return null;
                            }
                            sInfo = rInfoForUserId0.serviceInfo;
                        } finally {
                            Binder.restoreCallingIdentity(token);
                        }
                    }
                    sInfo = new ServiceInfo(sInfo);
                    sInfo.applicationInfo = mAm.getAppInfoForUser(sInfo.applicationInfo, userId);