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

Commit a99e4caa authored by Jeff Sharkey's avatar Jeff Sharkey Committed by Android (Google) Code Review
Browse files

Merge "Bind to screenshot service for current user." into jb-mr1-dev

parents 7808581c 35744c19
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -3141,7 +3141,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                @Override
                public void onServiceDisconnected(ComponentName name) {}
            };
            if (mContext.bindService(intent, conn, Context.BIND_AUTO_CREATE)) {
            if (mContext.bindService(
                    intent, conn, Context.BIND_AUTO_CREATE, UserHandle.USER_CURRENT)) {
                mScreenshotConnection = conn;
                mHandler.postDelayed(mScreenshotTimeout, 10000);
            }
+19 −1
Original line number Diff line number Diff line
@@ -10742,7 +10742,25 @@ public final class ActivityManagerService extends ActivityManagerNative
            throw new IllegalArgumentException("File descriptors passed in Intent");
        }
        checkValidCaller(Binder.getCallingUid(), userId);
        if (userId != UserHandle.getCallingUserId()) {
            // Requesting a different user, make sure that they have permission
            if (checkComponentPermission(
                    android.Manifest.permission.INTERACT_ACROSS_USERS_FULL,
                    Binder.getCallingPid(), Binder.getCallingUid(), -1, true)
                    == PackageManager.PERMISSION_GRANTED) {
                // Translate to the current user id, if caller wasn't aware
                if (userId == UserHandle.USER_CURRENT) {
                    userId = mCurrentUserId;
                }
            } else {
                String msg = "Permission Denial: Request to bindService as user " + userId
                        + " but is calling from user " + UserHandle.getCallingUserId()
                        + "; this requires "
                        + android.Manifest.permission.INTERACT_ACROSS_USERS_FULL;
                Slog.w(TAG, msg);
                throw new SecurityException(msg);
            }
        }
        synchronized(this) {
            return mServices.bindServiceLocked(caller, token, service, resolvedType,