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

Commit 3bce99ff authored by Mark Renouf's avatar Mark Renouf Committed by Automerger Merge Worker
Browse files

Merge "Remove permission token from startActivityAsCaller" into tm-dev am:...

Merge "Remove permission token from startActivityAsCaller" into tm-dev am: fe4b8185 am: 6dd31d0a

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



Change-Id: I48f760694ce271e853d0feb77a310878a20e9454
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 6a87549e 6dd31d0a
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
@@ -5707,7 +5707,6 @@ public class Activity extends ContextThemeWrapper
     * their launch had come from the original activity.
     * @param intent The Intent to start.
     * @param options ActivityOptions or null.
     * @param permissionToken Token received from the system that permits this call to be made.
     * @param ignoreTargetSecurity If true, the activity manager will not check whether the
     * caller it is doing the start is, is actually allowed to start the target activity.
     * If you set this to true, you must set an explicit component in the Intent and do any
@@ -5716,18 +5715,18 @@ public class Activity extends ContextThemeWrapper
     * @hide
     */
    public void startActivityAsCaller(Intent intent, @Nullable Bundle options,
            IBinder permissionToken, boolean ignoreTargetSecurity, int userId) {
        startActivityAsCaller(intent, options, permissionToken, ignoreTargetSecurity, userId, -1);
            boolean ignoreTargetSecurity, int userId) {
        startActivityAsCaller(intent, options, ignoreTargetSecurity, userId, -1);
    }

    /**
     * @see #startActivityAsCaller(Intent, Bundle, IBinder, boolean, int)
     * @see #startActivityAsCaller(Intent, Bundle, boolean, int)
     * @param requestCode The request code used for returning a result or -1 if no result should be
     *                    returned.
     * @hide
     */
    public void startActivityAsCaller(Intent intent, @Nullable Bundle options,
            IBinder permissionToken, boolean ignoreTargetSecurity, int userId, int requestCode) {
            boolean ignoreTargetSecurity, int userId, int requestCode) {
        if (mParent != null) {
            throw new RuntimeException("Can't be called from a child");
        }
@@ -5735,8 +5734,7 @@ public class Activity extends ContextThemeWrapper
        Instrumentation.ActivityResult ar =
                mInstrumentation.execStartActivityAsCaller(
                        this, mMainThread.getApplicationThread(), mToken, this,
                        intent, requestCode, options, permissionToken, ignoreTargetSecurity,
                        userId);
                        intent, requestCode, options, ignoreTargetSecurity, userId);
        if (ar != null) {
            mMainThread.sendActivityResult(
                    mToken, mEmbeddedID, requestCode, ar.getResultCode(), ar.getResultData());
+0 −8
Original line number Diff line number Diff line
@@ -105,14 +105,6 @@ public class ActivityTaskManager {
    public static final int RESIZE_MODE_USER_FORCED =
            RESIZE_MODE_PRESERVE_WINDOW | RESIZE_MODE_FORCED;

    /**
     * Extra included on intents that are delegating the call to
     * ActivityManager#startActivityAsCaller to another app.  This token is necessary for that call
     * to succeed.  Type is IBinder.
     * @hide
     */
    public static final String EXTRA_PERMISSION_TOKEN = "android.app.extra.PERMISSION_TOKEN";

    /**
     * Extra included on intents that contain an EXTRA_INTENT, with options that the contained
     * intent may want to be started with.  Type is Bundle.
+1 −13
Original line number Diff line number Diff line
@@ -141,7 +141,7 @@ interface IActivityTaskManager {
    int startActivityAsCaller(in IApplicationThread caller, in String callingPackage,
            in Intent intent, in String resolvedType, in IBinder resultTo, in String resultWho,
            int requestCode, int flags, in ProfilerInfo profilerInfo, in Bundle options,
            IBinder permissionToken, boolean ignoreTargetSecurity, int userId);
            boolean ignoreTargetSecurity, int userId);

    boolean isActivityStartAllowedOnDisplay(int displayId, in Intent intent, in String resolvedType,
            int userId);
@@ -182,18 +182,6 @@ interface IActivityTaskManager {
    int addAppTask(in IBinder activityToken, in Intent intent,
            in ActivityManager.TaskDescription description, in Bitmap thumbnail);
    Point getAppTaskThumbnailSize();
    /**
     * Only callable from the system. This token grants a temporary permission to call
     * #startActivityAsCaller. The token will time out after START_AS_CALLER_TOKEN_TIMEOUT
     * if it is not used.
     *
     * @param componentName The component name of the delegated component that is allowed to
     *                      call #startActivityAsCaller with the returned token.
     *
     * @return Returns a token that can be given to a "delegate" app that may call
     *         #startActivityAsCaller
     */
    IBinder requestStartActivityPermissionToken(in ComponentName componentName);

    oneway void releaseSomeActivities(in IApplicationThread app);
    Bitmap getTaskDescriptionIcon(in String filename, int userId);
+2 −2
Original line number Diff line number Diff line
@@ -1999,7 +1999,7 @@ public class Instrumentation {
    @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
    public ActivityResult execStartActivityAsCaller(
            Context who, IBinder contextThread, IBinder token, Activity target,
            Intent intent, int requestCode, Bundle options, IBinder permissionToken,
            Intent intent, int requestCode, Bundle options,
            boolean ignoreTargetSecurity, int userId) {
        IApplicationThread whoThread = (IApplicationThread) contextThread;
        if (mActivityMonitors != null) {
@@ -2034,7 +2034,7 @@ public class Instrumentation {
                    .startActivityAsCaller(whoThread, who.getOpPackageName(), intent,
                            intent.resolveTypeIfNeeded(who.getContentResolver()),
                            token, target != null ? target.mEmbeddedID : null,
                            requestCode, 0, null, options, permissionToken,
                            requestCode, 0, null, options,
                            ignoreTargetSecurity, userId);
            checkStartActivityResult(result, intent);
        } catch (RemoteException e) {
+0 −1
Original line number Diff line number Diff line
@@ -51,7 +51,6 @@ public final class GameSessionTrampolineActivity extends Activity {
            startActivityAsCaller(
                    getIntent().getParcelableExtra(INTENT_KEY),
                    getIntent().getBundleExtra(OPTIONS_KEY),
                    null,
                    false,
                    getUserId(),
                    REQUEST_CODE);
Loading