Merge "Fixes few corner issues of multi-window windowing mode split-screen" into sc-dev
This commit is contained in:
@@ -6060,12 +6060,10 @@ class Task extends WindowContainer<WindowContainer> {
|
||||
int idx = mChildren.size() - 1;
|
||||
while (idx >= 0) {
|
||||
final Task child = (Task) getChildAt(idx--);
|
||||
if (!child.isFocusableAndVisible()) {
|
||||
break;
|
||||
if (!child.isTopActivityFocusable()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Only allow one activity to be resumed among sibling tasks in split-screen.
|
||||
if (inSplitScreenWindowingMode() && someActivityResumed) {
|
||||
if (child.getVisibility(null /* starting */) != TASK_VISIBILITY_VISIBLE) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -346,6 +346,12 @@ final class TaskDisplayArea extends DisplayArea<WindowContainer> {
|
||||
position = findPositionForRootTask(position, task, true /* adding */);
|
||||
|
||||
super.addChild(task, position);
|
||||
if (mPreferredTopFocusableRootTask != null
|
||||
&& task.isFocusable()
|
||||
&& mPreferredTopFocusableRootTask.compareTo(task) < 0) {
|
||||
// Clear preferred top because the adding focusable task has a higher z-order.
|
||||
mPreferredTopFocusableRootTask = null;
|
||||
}
|
||||
mAtmService.updateSleepIfNeededLocked();
|
||||
onRootTaskOrderChanged(task);
|
||||
}
|
||||
@@ -439,6 +445,11 @@ final class TaskDisplayArea extends DisplayArea<WindowContainer> {
|
||||
// Update the top resumed activity because the preferred top focusable task may be changed.
|
||||
mAtmService.mTaskSupervisor.updateTopResumedActivityIfNeeded();
|
||||
|
||||
final ActivityRecord r = child.getResumedActivity();
|
||||
if (r != null && r == mRootWindowContainer.getTopResumedActivity()) {
|
||||
mAtmService.setResumedActivityUncheckLocked(r, "positionChildAt");
|
||||
}
|
||||
|
||||
if (mChildren.indexOf(child) != oldPosition) {
|
||||
onRootTaskOrderChanged(child);
|
||||
}
|
||||
|
||||
@@ -2157,6 +2157,8 @@ public class ActivityRecordTests extends WindowTestsBase {
|
||||
attrs.setTitle("AppWindow");
|
||||
final TestWindowState appWindow = createWindowState(attrs, activity);
|
||||
activity.addWindow(appWindow);
|
||||
spyOn(appWindow);
|
||||
doNothing().when(appWindow).onStartFreezingScreen();
|
||||
|
||||
// Set initial orientation and update.
|
||||
activity.setOrientation(SCREEN_ORIENTATION_LANDSCAPE);
|
||||
@@ -2193,6 +2195,8 @@ public class ActivityRecordTests extends WindowTestsBase {
|
||||
attrs.setTitle("RotationByPolicy");
|
||||
final TestWindowState appWindow = createWindowState(attrs, activity);
|
||||
activity.addWindow(appWindow);
|
||||
spyOn(appWindow);
|
||||
doNothing().when(appWindow).onStartFreezingScreen();
|
||||
|
||||
// Set initial orientation and update.
|
||||
performRotation(displayRotation, Surface.ROTATION_90);
|
||||
|
||||
Reference in New Issue
Block a user