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

Commit 5ba04ee6 authored by Nan Wu's avatar Nan Wu
Browse files

Fix missing creator token error

GameSession calls startActivityFromGameSession with a trampolineIntent
that contains the final intent to be launched. But it does not go
through prepareToLeaveProcess; thus extra intent keys are not
collected. It also does not go through addCreatorToken on the
server side.

Bug: 376861334
Test: Manual test.
Flag: android.security.prevent_intent_redirect
Change-Id: I4fd72b06e075458058e1a1527261ce9d06d70715
parent 5e4f136b
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -516,6 +516,8 @@ public abstract class GameSession {
                        options,
                        future);

        trampolineIntent.collectExtraIntentKeys();

        try {
            int result = ActivityTaskManager.getService().startActivityFromGameSession(
                    mContext.getIApplicationThread(), mContext.getPackageName(), "GameSession",
+2 −0
Original line number Diff line number Diff line
@@ -1854,6 +1854,8 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
        }
        assertPackageMatchesCallingUid(callingPackage);

        mAmInternal.addCreatorToken(intent, callingPackage);

        final ActivityOptions activityOptions = ActivityOptions.makeBasic();
        activityOptions.setLaunchTaskId(taskId);
        // Pass in the system UID to allow setting launch taskId with MANAGE_GAME_ACTIVITY.