Loading services/core/java/com/android/server/am/ActivityRecord.java +2 −3 Original line number Diff line number Diff line Loading @@ -1609,9 +1609,8 @@ final class ActivityRecord extends ConfigurationContainer implements AppWindowCo mStackSupervisor.mStoppingActivities.remove(this); mStackSupervisor.mGoingToSleepActivities.remove(this); // If an activity is not in the paused state when becoming visible, cycle to the paused // state. if (state != PAUSED) { // If the activity is stopped or stopping, cycle to the paused state. if (state == STOPPED || state == STOPPING) { // An activity must be in the {@link PAUSING} state for the system to validate // the move to {@link PAUSED}. state = PAUSING; Loading services/tests/servicestests/src/com/android/server/am/ActivityRecordTests.java +9 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import static android.content.pm.ActivityInfo.RESIZE_MODE_RESIZEABLE; import static android.content.pm.ActivityInfo.RESIZE_MODE_UNRESIZEABLE; import static android.view.Display.DEFAULT_DISPLAY; import static com.android.server.am.ActivityStack.ActivityState.INITIALIZING; import static com.android.server.am.ActivityStack.ActivityState.PAUSING; import static com.android.server.am.ActivityStack.ActivityState.STOPPED; import static com.android.server.am.ActivityStack.REMOVE_TASK_MODE_MOVING; Loading Loading @@ -122,7 +123,15 @@ public class ActivityRecordTests extends ActivityTestsBase { mActivity.makeVisibleIfNeeded(null /* starting */); assertEquals(mActivity.state, PAUSING); assertTrue(pauseFound.value); // Make sure that the state does not change for current non-stopping states. mActivity.state = INITIALIZING; mActivity.makeVisibleIfNeeded(null /* starting */); assertEquals(mActivity.state, INITIALIZING); } @Test Loading Loading
services/core/java/com/android/server/am/ActivityRecord.java +2 −3 Original line number Diff line number Diff line Loading @@ -1609,9 +1609,8 @@ final class ActivityRecord extends ConfigurationContainer implements AppWindowCo mStackSupervisor.mStoppingActivities.remove(this); mStackSupervisor.mGoingToSleepActivities.remove(this); // If an activity is not in the paused state when becoming visible, cycle to the paused // state. if (state != PAUSED) { // If the activity is stopped or stopping, cycle to the paused state. if (state == STOPPED || state == STOPPING) { // An activity must be in the {@link PAUSING} state for the system to validate // the move to {@link PAUSED}. state = PAUSING; Loading
services/tests/servicestests/src/com/android/server/am/ActivityRecordTests.java +9 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import static android.content.pm.ActivityInfo.RESIZE_MODE_RESIZEABLE; import static android.content.pm.ActivityInfo.RESIZE_MODE_UNRESIZEABLE; import static android.view.Display.DEFAULT_DISPLAY; import static com.android.server.am.ActivityStack.ActivityState.INITIALIZING; import static com.android.server.am.ActivityStack.ActivityState.PAUSING; import static com.android.server.am.ActivityStack.ActivityState.STOPPED; import static com.android.server.am.ActivityStack.REMOVE_TASK_MODE_MOVING; Loading Loading @@ -122,7 +123,15 @@ public class ActivityRecordTests extends ActivityTestsBase { mActivity.makeVisibleIfNeeded(null /* starting */); assertEquals(mActivity.state, PAUSING); assertTrue(pauseFound.value); // Make sure that the state does not change for current non-stopping states. mActivity.state = INITIALIZING; mActivity.makeVisibleIfNeeded(null /* starting */); assertEquals(mActivity.state, INITIALIZING); } @Test Loading