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;
|
int idx = mChildren.size() - 1;
|
||||||
while (idx >= 0) {
|
while (idx >= 0) {
|
||||||
final Task child = (Task) getChildAt(idx--);
|
final Task child = (Task) getChildAt(idx--);
|
||||||
if (!child.isFocusableAndVisible()) {
|
if (!child.isTopActivityFocusable()) {
|
||||||
break;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (child.getVisibility(null /* starting */) != TASK_VISIBILITY_VISIBLE) {
|
||||||
// Only allow one activity to be resumed among sibling tasks in split-screen.
|
|
||||||
if (inSplitScreenWindowingMode() && someActivityResumed) {
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -346,6 +346,12 @@ final class TaskDisplayArea extends DisplayArea<WindowContainer> {
|
|||||||
position = findPositionForRootTask(position, task, true /* adding */);
|
position = findPositionForRootTask(position, task, true /* adding */);
|
||||||
|
|
||||||
super.addChild(task, position);
|
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();
|
mAtmService.updateSleepIfNeededLocked();
|
||||||
onRootTaskOrderChanged(task);
|
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.
|
// Update the top resumed activity because the preferred top focusable task may be changed.
|
||||||
mAtmService.mTaskSupervisor.updateTopResumedActivityIfNeeded();
|
mAtmService.mTaskSupervisor.updateTopResumedActivityIfNeeded();
|
||||||
|
|
||||||
|
final ActivityRecord r = child.getResumedActivity();
|
||||||
|
if (r != null && r == mRootWindowContainer.getTopResumedActivity()) {
|
||||||
|
mAtmService.setResumedActivityUncheckLocked(r, "positionChildAt");
|
||||||
|
}
|
||||||
|
|
||||||
if (mChildren.indexOf(child) != oldPosition) {
|
if (mChildren.indexOf(child) != oldPosition) {
|
||||||
onRootTaskOrderChanged(child);
|
onRootTaskOrderChanged(child);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2157,6 +2157,8 @@ public class ActivityRecordTests extends WindowTestsBase {
|
|||||||
attrs.setTitle("AppWindow");
|
attrs.setTitle("AppWindow");
|
||||||
final TestWindowState appWindow = createWindowState(attrs, activity);
|
final TestWindowState appWindow = createWindowState(attrs, activity);
|
||||||
activity.addWindow(appWindow);
|
activity.addWindow(appWindow);
|
||||||
|
spyOn(appWindow);
|
||||||
|
doNothing().when(appWindow).onStartFreezingScreen();
|
||||||
|
|
||||||
// Set initial orientation and update.
|
// Set initial orientation and update.
|
||||||
activity.setOrientation(SCREEN_ORIENTATION_LANDSCAPE);
|
activity.setOrientation(SCREEN_ORIENTATION_LANDSCAPE);
|
||||||
@@ -2193,6 +2195,8 @@ public class ActivityRecordTests extends WindowTestsBase {
|
|||||||
attrs.setTitle("RotationByPolicy");
|
attrs.setTitle("RotationByPolicy");
|
||||||
final TestWindowState appWindow = createWindowState(attrs, activity);
|
final TestWindowState appWindow = createWindowState(attrs, activity);
|
||||||
activity.addWindow(appWindow);
|
activity.addWindow(appWindow);
|
||||||
|
spyOn(appWindow);
|
||||||
|
doNothing().when(appWindow).onStartFreezingScreen();
|
||||||
|
|
||||||
// Set initial orientation and update.
|
// Set initial orientation and update.
|
||||||
performRotation(displayRotation, Surface.ROTATION_90);
|
performRotation(displayRotation, Surface.ROTATION_90);
|
||||||
|
|||||||
Reference in New Issue
Block a user