Merge "Update reference to top activity." into oc-mr1-dev

am: f35bfc3d0c

Change-Id: Idd809abedb4e0a63bca117cdb6ce7ec89b6fa64a
This commit is contained in:
Bryce Lee
2017-09-14 01:22:56 +00:00
committed by android-build-merger

View File

@@ -1190,6 +1190,7 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai
* process of going to sleep (checkReadyForSleep will be called when that process finishes).
*/
boolean goToSleepIfPossible(boolean shuttingDown) {
final ActivityRecord topActivity = topActivity();
boolean shouldSleep = true;
if (mResumedActivity != null) {
@@ -1214,10 +1215,10 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai
// Still waiting for something to pause; can't sleep yet.
if (DEBUG_PAUSE) Slog.v(TAG_PAUSE, "Sleep still waiting to pause " + mPausingActivity);
shouldSleep = false;
} else if (topActivity() != null && topActivity().state == ActivityState.PAUSED) {
} else if (topActivity != null && topActivity.state == ActivityState.PAUSED) {
// Our top activity is currently paused, we need to ensure we move it to the stopped
// state.
stopActivityLocked(mLastPausedActivity);
stopActivityLocked(topActivity);
shouldSleep = false;
}