Loading services/core/java/com/android/server/wm/WindowProcessController.java +3 −1 Original line number Diff line number Diff line Loading @@ -1286,7 +1286,9 @@ public class WindowProcessController extends ConfigurationContainer<Configuratio // this process, we'd find out the one with the minimal layer, thus it'll // get a higher adj score. } else if (!visible && bestInvisibleState != PAUSING) { if (state == PAUSING) { // Also check RESUMED in case the activity is pending to be stopped by // ActivityRecord#makeInvisible. if (state == PAUSING || state == RESUMED) { bestInvisibleState = PAUSING; // Treat PAUSING as visible in case the next activity in the same process has // not yet been set as visible-requested. Loading services/tests/wmtests/src/com/android/server/wm/WindowProcessControllerTests.java +6 −0 Original line number Diff line number Diff line Loading @@ -364,6 +364,12 @@ public class WindowProcessControllerTests extends WindowTestsBase { activity.setState(STOPPED, "test"); flags = mWpc.getActivityStateFlags() & exclusiveFlags; assertEquals(0, flags); activity.setVisibleRequested(true); activity.setState(RESUMED, "test"); activity.makeInvisible(); flags = mWpc.getActivityStateFlags() & exclusiveFlags; assertEquals(WindowProcessController.ACTIVITY_STATE_FLAG_IS_PAUSING_OR_PAUSED, flags); } @Test Loading Loading
services/core/java/com/android/server/wm/WindowProcessController.java +3 −1 Original line number Diff line number Diff line Loading @@ -1286,7 +1286,9 @@ public class WindowProcessController extends ConfigurationContainer<Configuratio // this process, we'd find out the one with the minimal layer, thus it'll // get a higher adj score. } else if (!visible && bestInvisibleState != PAUSING) { if (state == PAUSING) { // Also check RESUMED in case the activity is pending to be stopped by // ActivityRecord#makeInvisible. if (state == PAUSING || state == RESUMED) { bestInvisibleState = PAUSING; // Treat PAUSING as visible in case the next activity in the same process has // not yet been set as visible-requested. Loading
services/tests/wmtests/src/com/android/server/wm/WindowProcessControllerTests.java +6 −0 Original line number Diff line number Diff line Loading @@ -364,6 +364,12 @@ public class WindowProcessControllerTests extends WindowTestsBase { activity.setState(STOPPED, "test"); flags = mWpc.getActivityStateFlags() & exclusiveFlags; assertEquals(0, flags); activity.setVisibleRequested(true); activity.setState(RESUMED, "test"); activity.makeInvisible(); flags = mWpc.getActivityStateFlags() & exclusiveFlags; assertEquals(WindowProcessController.ACTIVITY_STATE_FLAG_IS_PAUSING_OR_PAUSED, flags); } @Test Loading