Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 64643f6d authored by Sunny Goyal's avatar Sunny Goyal
Browse files

Only check isTopOfTask() when needed

This avoids unnecessary binder call to system
Test: Verified on device

Change-Id: I5258550c8fbe837acc93e89f21a44464a00c7d6e
parent 341ddc79
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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) {
+2 −2
Original line number Diff line number Diff line
@@ -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 {