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

Commit 352d584b authored by Jorim Jaggi's avatar Jorim Jaggi
Browse files

Handle trampoline activites in different tasks

When the app uses a trampoline activity that launches in a different
task than the main task, we fail to show recents when the task is
docked and the user launches the trampoline activity from home. Add
logic to handle this case.

Bug: 28368989
Change-Id: Iea29e6cd1a9919da0e856955691fac4792e30604
parent 86f97177
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -558,7 +558,16 @@ class ActivityStarter {
            startedActivityStackId = mTargetStack.mStackId;
        }

        if (startedActivityStackId == DOCKED_STACK_ID && prevFocusedStackId == HOME_STACK_ID) {
        // If we launched the activity from a no display activity that was launched from the home
        // screen, we also need to start recents to un-minimize the docked stack, since the
        // noDisplay activity will be finished shortly after.
        // TODO: We should prevent noDisplay activities from affecting task/stack ordering and
        // visibility instead of using this flag.
        final boolean noDisplayActivityOverHome = mSourceRecord != null
                && mSourceRecord.noDisplay
                && mSourceRecord.task.getTaskToReturnTo() == HOME_ACTIVITY_TYPE;
        if (startedActivityStackId == DOCKED_STACK_ID
                && (prevFocusedStackId == HOME_STACK_ID || noDisplayActivityOverHome)) {
            final ActivityStack homeStack = mSupervisor.getStack(HOME_STACK_ID);
            final ActivityRecord topActivityHomeStack = homeStack != null
                    ? homeStack.topRunningActivityLocked() : null;