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

Commit 503153fd authored by Evan Rosky's avatar Evan Rosky Committed by Automerger Merge Worker
Browse files

Merge "Add permission check for RemoteTransition in ActivityOptions" into...

Merge "Add permission check for RemoteTransition in ActivityOptions" into udc-dev am: a02a2d0d am: 4cc72546

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23768708



Change-Id: Ie3cd02121995aa9d6acdcf5ddec17da02f8f70a5
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 935ae578 4cc72546
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@ import android.os.RemoteException;
import android.os.UserHandle;
import android.util.Slog;
import android.view.RemoteAnimationAdapter;
import android.window.RemoteTransition;
import android.window.WindowContainerToken;

import com.android.internal.annotations.VisibleForTesting;
@@ -385,6 +386,18 @@ public class SafeActivityOptions {
            throw new SecurityException(msg);
        }

        // Check permission for remote transitions
        final RemoteTransition transition = options.getRemoteTransition();
        if (transition != null && supervisor.mService.checkPermission(
                CONTROL_REMOTE_APP_TRANSITION_ANIMATIONS, callingPid, callingUid)
                != PERMISSION_GRANTED) {
            final String msg = "Permission Denial: starting " + getIntentString(intent)
                    + " from " + callerApp + " (pid=" + callingPid
                    + ", uid=" + callingUid + ") with remoteTransition";
            Slog.w(TAG, msg);
            throw new SecurityException(msg);
        }

        // If launched from bubble is specified, then ensure that the caller is system or sysui.
        if (options.getLaunchedFromBubble() && !isSystemOrSystemUI(callingPid, callingUid)) {
            final String msg = "Permission Denial: starting " + getIntentString(intent)