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

Commit 1a44f191 authored by Rachit Jain's avatar Rachit Jain
Browse files

Add a intent creator token for the activity interceptors

When an activity launch is intercepted, Intent#prepareToLeaveProcess is
not called since the interception happens in the system_server. So if
any activity is calling a trampoline activity, the keys do not get
collected.

Since all the interceptors are present in the system_server, add the
creator token before launching the intercepted intent.

Bug: 399442502
Flag: EXEMPT (bug fix)
Test: m
Change-Id: I4434534b4bed8ef858603c95097d9855bf4d58a8
parent 16d79829
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -272,6 +272,12 @@ class ActivityStartInterceptor {
            mActivityOptions = interceptResult.getActivityOptions();
            mCallingPid = mRealCallingPid;
            mCallingUid = mRealCallingUid;
            // When an activity launch is intercepted, Intent#prepareToLeaveProcess is not called
            // since the interception happens in the system_server. So if any activity is calling
            // a trampoline activity, the keys do not get collected. Since all the interceptors
            // are present in the system_server, add the creator token before launching the
            // intercepted intent.
            mService.mAmInternal.addCreatorToken(mIntent, mCallingPackage);
            if (interceptResult.isActivityResolved()) {
                return true;
            }