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

Commit 1439a16e authored by Narayan Kamath's avatar Narayan Kamath Committed by Android (Google) Code Review
Browse files

Merge "MediaProjectionManagerService: Use the right user for app lookups." into qt-dev

parents ea38c4fa e6d63d72
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -282,13 +282,14 @@ public final class MediaProjectionManagerService extends SystemService
                throw new IllegalArgumentException("package name must not be empty");
            }

            final UserHandle callingUser = Binder.getCallingUserHandle();
            long callingToken = Binder.clearCallingIdentity();

            MediaProjection projection;
            try {
                ApplicationInfo ai;
                try {
                    ai = mPackageManager.getApplicationInfo(packageName, 0);
                    ai = mPackageManager.getApplicationInfoAsUser(packageName, 0, callingUser);
                } catch (NameNotFoundException e) {
                    throw new IllegalArgumentException("No package matching :" + packageName);
                }