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

Commit bf71968f authored by Andrii Kulian's avatar Andrii Kulian
Browse files

Show recents when task moves to docked stack

When task was moved to docked stack using adb command,
recents didn't show and docked stack was minimized when
home task obtained focus.
This CL shows recents if needed when task is moved to
docked stack.

Bug: 28215216
Change-Id: If1cfb9d24bd77cc9c3c8fad3479f115d7aca1301
parent 0fea8ad4
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -341,6 +341,7 @@ import static com.android.server.am.ActivityManagerDebugConfig.POSTFIX_VISIBILIT
import static com.android.server.am.ActivityManagerDebugConfig.POSTFIX_VISIBLE_BEHIND;
import static com.android.server.am.ActivityManagerDebugConfig.TAG_AM;
import static com.android.server.am.ActivityManagerDebugConfig.TAG_WITH_CLASS_NAME;
import static com.android.server.am.ActivityRecord.RECENTS_ACTIVITY_TYPE;
import static com.android.server.am.ActivityStackSupervisor.ActivityContainer.FORCE_NEW_TASK_FLAGS;
import static com.android.server.am.ActivityStackSupervisor.DEFER_RESUME;
import static com.android.server.am.ActivityStackSupervisor.FORCE_FOCUS;
@@ -9613,8 +9614,13 @@ public final class ActivityManagerService extends ActivityManagerNative
                    mWindowManager.setDockedStackCreateState(DOCKED_STACK_CREATE_MODE_TOP_OR_LEFT,
                            null /* initialBounds */);
                }
                mStackSupervisor.moveTaskToStackLocked(taskId, stackId, toTop, !FORCE_FOCUS,
                        "moveTaskToStack", ANIMATE);
                boolean result = mStackSupervisor.moveTaskToStackLocked(taskId, stackId, toTop,
                        !FORCE_FOCUS, "moveTaskToStack", ANIMATE);
                if (result && stackId == DOCKED_STACK_ID) {
                    // If task moved to docked stack - show recents if needed.
                    mStackSupervisor.moveHomeStackTaskToTop(RECENTS_ACTIVITY_TYPE,
                            "moveTaskToDockedStack");
                }
            } finally {
                Binder.restoreCallingIdentity(ident);
            }