Loading core/java/android/app/ActivityThread.java +10 −25 Original line number Diff line number Diff line Loading @@ -3115,10 +3115,6 @@ public final class ActivityThread extends ClientTransactionHandler { if (!r.stopped) { throw new IllegalStateException("Can't start activity that is not stopped."); } if (r.activity.mFinished) { // TODO(lifecycler): How can this happen? return; } // Start activity.performStart("handleStartActivity"); Loading Loading @@ -3241,6 +3237,8 @@ public final class ActivityThread extends ClientTransactionHandler { if (!r.activity.mFinished && pendingActions != null) { pendingActions.setOldState(r.state); pendingActions.setRestoreInstanceState(true); } if (pendingActions != null) { pendingActions.setCallOnPostCreate(true); } } else { Loading Loading @@ -3942,7 +3940,7 @@ public final class ActivityThread extends ClientTransactionHandler { if (localLOGV) { Slog.v(TAG, "Performing resume of " + r + " finished=" + r.activity.mFinished); } if (r == null || r.activity.mFinished) { if (r == null) { return null; } if (r.getLifecycleState() == ON_RESUME) { Loading Loading @@ -4212,12 +4210,6 @@ public final class ActivityThread extends ClientTransactionHandler { private Bundle performPauseActivity(ActivityClientRecord r, boolean finished, String reason, PendingTransactionActions pendingActions) { if (r.paused) { if (r.activity.mFinished) { // If we are finishing, we won't call onResume() in certain cases. // So here we likewise don't want to call onPause() if the activity // isn't resumed. return null; } RuntimeException e = new RuntimeException( "Performing pause of activity that is not resumed: " + r.intent.getComponent().toShortString()); Loading Loading @@ -4337,21 +4329,14 @@ public final class ActivityThread extends ClientTransactionHandler { boolean saveState, boolean finalStateRequest, String reason) { if (localLOGV) Slog.v(TAG, "Performing stop of " + r); if (r != null) { if (!keepShown && r.stopped) { if (r.activity.mFinished) { // If we are finishing, we won't call onResume() in certain // cases. So here we likewise don't want to call onStop() // if the activity isn't resumed. return; } if (!finalStateRequest) { if (!keepShown && r.stopped && !finalStateRequest) { // Double stop request is possible if activity receives 'sleep' followed by 'stop'. final RuntimeException e = new RuntimeException( "Performing stop of activity that is already stopped: " + r.intent.getComponent().toShortString()); Slog.e(TAG, e.getMessage(), e); Slog.e(TAG, r.getStateString()); } } // One must first be paused before stopped... performPauseActivityIfNeeded(r, reason); Loading Loading
core/java/android/app/ActivityThread.java +10 −25 Original line number Diff line number Diff line Loading @@ -3115,10 +3115,6 @@ public final class ActivityThread extends ClientTransactionHandler { if (!r.stopped) { throw new IllegalStateException("Can't start activity that is not stopped."); } if (r.activity.mFinished) { // TODO(lifecycler): How can this happen? return; } // Start activity.performStart("handleStartActivity"); Loading Loading @@ -3241,6 +3237,8 @@ public final class ActivityThread extends ClientTransactionHandler { if (!r.activity.mFinished && pendingActions != null) { pendingActions.setOldState(r.state); pendingActions.setRestoreInstanceState(true); } if (pendingActions != null) { pendingActions.setCallOnPostCreate(true); } } else { Loading Loading @@ -3942,7 +3940,7 @@ public final class ActivityThread extends ClientTransactionHandler { if (localLOGV) { Slog.v(TAG, "Performing resume of " + r + " finished=" + r.activity.mFinished); } if (r == null || r.activity.mFinished) { if (r == null) { return null; } if (r.getLifecycleState() == ON_RESUME) { Loading Loading @@ -4212,12 +4210,6 @@ public final class ActivityThread extends ClientTransactionHandler { private Bundle performPauseActivity(ActivityClientRecord r, boolean finished, String reason, PendingTransactionActions pendingActions) { if (r.paused) { if (r.activity.mFinished) { // If we are finishing, we won't call onResume() in certain cases. // So here we likewise don't want to call onPause() if the activity // isn't resumed. return null; } RuntimeException e = new RuntimeException( "Performing pause of activity that is not resumed: " + r.intent.getComponent().toShortString()); Loading Loading @@ -4337,21 +4329,14 @@ public final class ActivityThread extends ClientTransactionHandler { boolean saveState, boolean finalStateRequest, String reason) { if (localLOGV) Slog.v(TAG, "Performing stop of " + r); if (r != null) { if (!keepShown && r.stopped) { if (r.activity.mFinished) { // If we are finishing, we won't call onResume() in certain // cases. So here we likewise don't want to call onStop() // if the activity isn't resumed. return; } if (!finalStateRequest) { if (!keepShown && r.stopped && !finalStateRequest) { // Double stop request is possible if activity receives 'sleep' followed by 'stop'. final RuntimeException e = new RuntimeException( "Performing stop of activity that is already stopped: " + r.intent.getComponent().toShortString()); Slog.e(TAG, e.getMessage(), e); Slog.e(TAG, r.getStateString()); } } // One must first be paused before stopped... performPauseActivityIfNeeded(r, reason); Loading