Loading services/core/java/com/android/server/am/ActivityRecord.java +0 −18 Original line number Diff line number Diff line Loading @@ -1581,25 +1581,7 @@ final class ActivityRecord extends ConfigurationContainer implements AppWindowCo void setState(ActivityState state, String reason) { if (DEBUG_STATES) Slog.v(TAG_STATES, "State movement: " + this + " from:" + getState() + " to:" + state + " reason:" + reason); final boolean stateChanged = mState != state; mState = state; if (stateChanged && isState(DESTROYING, DESTROYED)) { makeFinishingLocked(); // When moving to the destroyed state, immediately destroy the activity in the // associated stack. Most paths for finishing an activity will handle an activity's path // to destroy through mechanisms such as ActivityStackSupervisor#mFinishingActivities. // However, moving to the destroyed state directly (as in the case of an app dying) and // marking it as finished will lead to cleanup steps that will prevent later handling // from happening. if (isState(DESTROYED)) { final ActivityStack stack = getStack(); if (stack != null) { stack.activityDestroyedLocked(this, reason); } } } } ActivityState getState() { Loading services/tests/servicestests/src/com/android/server/am/ActivityRecordTests.java +0 −16 Original line number Diff line number Diff line Loading @@ -204,20 +204,4 @@ public class ActivityRecordTests extends ActivityTestsBase { verify(mService.mStackSupervisor, times(1)).canPlaceEntityOnDisplay(anyInt(), eq(expected), anyInt(), anyInt(), eq(record.info)); } @Test public void testFinishingAfterDestroying() throws Exception { assertFalse(mActivity.finishing); mActivity.setState(DESTROYING, "testFinishingAfterDestroying"); assertTrue(mActivity.isState(DESTROYING)); assertTrue(mActivity.finishing); } @Test public void testFinishingAfterDestroyed() throws Exception { assertFalse(mActivity.finishing); mActivity.setState(DESTROYED, "testFinishingAfterDestroyed"); assertTrue(mActivity.isState(DESTROYED)); assertTrue(mActivity.finishing); } } Loading
services/core/java/com/android/server/am/ActivityRecord.java +0 −18 Original line number Diff line number Diff line Loading @@ -1581,25 +1581,7 @@ final class ActivityRecord extends ConfigurationContainer implements AppWindowCo void setState(ActivityState state, String reason) { if (DEBUG_STATES) Slog.v(TAG_STATES, "State movement: " + this + " from:" + getState() + " to:" + state + " reason:" + reason); final boolean stateChanged = mState != state; mState = state; if (stateChanged && isState(DESTROYING, DESTROYED)) { makeFinishingLocked(); // When moving to the destroyed state, immediately destroy the activity in the // associated stack. Most paths for finishing an activity will handle an activity's path // to destroy through mechanisms such as ActivityStackSupervisor#mFinishingActivities. // However, moving to the destroyed state directly (as in the case of an app dying) and // marking it as finished will lead to cleanup steps that will prevent later handling // from happening. if (isState(DESTROYED)) { final ActivityStack stack = getStack(); if (stack != null) { stack.activityDestroyedLocked(this, reason); } } } } ActivityState getState() { Loading
services/tests/servicestests/src/com/android/server/am/ActivityRecordTests.java +0 −16 Original line number Diff line number Diff line Loading @@ -204,20 +204,4 @@ public class ActivityRecordTests extends ActivityTestsBase { verify(mService.mStackSupervisor, times(1)).canPlaceEntityOnDisplay(anyInt(), eq(expected), anyInt(), anyInt(), eq(record.info)); } @Test public void testFinishingAfterDestroying() throws Exception { assertFalse(mActivity.finishing); mActivity.setState(DESTROYING, "testFinishingAfterDestroying"); assertTrue(mActivity.isState(DESTROYING)); assertTrue(mActivity.finishing); } @Test public void testFinishingAfterDestroyed() throws Exception { assertFalse(mActivity.finishing); mActivity.setState(DESTROYED, "testFinishingAfterDestroyed"); assertTrue(mActivity.isState(DESTROYED)); assertTrue(mActivity.finishing); } }