Loading services/core/java/com/android/server/wm/Task.java +3 −5 Original line number Diff line number Diff line Loading @@ -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; } Loading services/core/java/com/android/server/wm/TaskDisplayArea.java +11 −0 Original line number Diff line number Diff line Loading @@ -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); } Loading Loading @@ -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); } Loading services/tests/wmtests/src/com/android/server/wm/ActivityRecordTests.java +4 −0 Original line number Diff line number Diff line Loading @@ -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); Loading Loading @@ -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); Loading Loading
services/core/java/com/android/server/wm/Task.java +3 −5 Original line number Diff line number Diff line Loading @@ -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; } Loading
services/core/java/com/android/server/wm/TaskDisplayArea.java +11 −0 Original line number Diff line number Diff line Loading @@ -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); } Loading Loading @@ -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); } Loading
services/tests/wmtests/src/com/android/server/wm/ActivityRecordTests.java +4 −0 Original line number Diff line number Diff line Loading @@ -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); Loading Loading @@ -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); Loading