Merge "Only check isTopOfTask() when needed"

This commit is contained in:
TreeHugger Robot
2019-02-01 11:15:58 +00:00
committed by Android (Google) Code Review
2 changed files with 3 additions and 3 deletions

View File

@@ -1768,7 +1768,7 @@ public class Activity extends ContextThemeWrapper
protected void onResume() {
if (DEBUG_LIFECYCLE) Slog.v(TAG, "onResume " + this);
dispatchActivityResumed();
mActivityTransitionState.onResume(this, isTopOfTask());
mActivityTransitionState.onResume(this);
enableAutofillCompatibilityIfNeeded();
if (mAutoFillResetNeeded) {
if (!mAutoFillIgnoreFirstResumePause) {

View File

@@ -258,10 +258,10 @@ class ActivityTransitionState {
}
}
public void onResume(Activity activity, boolean isTopOfTask) {
public void onResume(Activity activity) {
// After orientation change, the onResume can come in before the top Activity has
// left, so if the Activity is not top, wait a second for the top Activity to exit.
if (isTopOfTask || mEnterTransitionCoordinator == null) {
if (mEnterTransitionCoordinator == null || activity.isTopOfTask()) {
restoreExitedViews();
restoreReenteringViews();
} else {