Ensure the next activity of non-focusable task to be visible

The top activity of the dock task was finished due to starting
the singleTask root activity. However, the root activity was remained
in STOPPED state because the activities in dock task cannot be
resumed while in split-screen mode.

Ensure the activity visibility if the target task is unfocusable.

Bug: 174440887
Test: start singleTask activity on dock task
Change-Id: I4f02758287ca4ef0e710bb556b5910600e725e40
This commit is contained in:
Louis Chang
2020-12-10 10:47:38 +08:00
parent 0d4064bd03
commit fc165b971c

View File

@@ -2647,7 +2647,11 @@ class ActivityStarter {
if (next != null) {
next.setCurrentLaunchCanTurnScreenOn(true);
}
mRootWindowContainer.resumeFocusedTasksTopActivities(mTargetStack, null, mOptions);
if (mTargetStack.isFocusable()) {
mRootWindowContainer.resumeFocusedTasksTopActivities(mTargetStack, null, mOptions);
} else {
mRootWindowContainer.ensureActivitiesVisible(null, 0, !PRESERVE_WINDOWS);
}
} else {
ActivityOptions.abort(mOptions);
}