diff options
| author | 2018-02-27 08:57:37 -0800 | |
|---|---|---|
| committer | 2018-02-27 08:59:43 -0800 | |
| commit | 102603e42c107c3ff9a8d7d2a19e60f401d9df2d (patch) | |
| tree | 34bc31a09144bcd6639413e6e59bcd2bfb7b41b1 | |
| parent | c709366f0b9716012a63e04117dac2211c514f0d (diff) | |
Revert "Always finish activity when moving to a destroyed state."
This reverts commit 7ace395d65edb4764fc537ac1c9ed3c07bc72c33.
Fixes: 73900028
Change-Id: I8b72dca8e001413d54ab85be07943b6ebc451615
| -rw-r--r-- | services/core/java/com/android/server/am/ActivityRecord.java | 18 | ||||
| -rw-r--r-- | services/tests/servicestests/src/com/android/server/am/ActivityRecordTests.java | 16 |
2 files changed, 0 insertions, 34 deletions
diff --git a/services/core/java/com/android/server/am/ActivityRecord.java b/services/core/java/com/android/server/am/ActivityRecord.java index 8cc927346500..274a4b068fa5 100644 --- a/services/core/java/com/android/server/am/ActivityRecord.java +++ b/services/core/java/com/android/server/am/ActivityRecord.java @@ -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() { diff --git a/services/tests/servicestests/src/com/android/server/am/ActivityRecordTests.java b/services/tests/servicestests/src/com/android/server/am/ActivityRecordTests.java index bfc31337134e..fb1595e1eb49 100644 --- a/services/tests/servicestests/src/com/android/server/am/ActivityRecordTests.java +++ b/services/tests/servicestests/src/com/android/server/am/ActivityRecordTests.java @@ -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); - } } |