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

Commit a1304cf9 authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Remove performRestart in performResume

TransactionExecutorHelper#getLifecyclePath will resolve the needed
lifecycle steps. So when resuming, performRestart is already called
once from TransactionExecutor#performLifecycleSequence. Then the
later performRestart from performResume is the 2nd time and it is
no-op (mStopped was set to false).

Bug: 127877792
Test: CtsWindowManagerDeviceTestCases
Change-Id: Id405a44982b7581c52bc81120bf0a9b698a2b38e
parent fc103b26
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -8430,7 +8430,7 @@ public class Activity extends ContextThemeWrapper
     *              The option to not start immediately is needed in case a transaction with
     *              multiple lifecycle transitions is in progress.
     */
    final void performRestart(boolean start, String reason) {
    final void performRestart(boolean start) {
        Trace.traceBegin(Trace.TRACE_TAG_WINDOW_MANAGER, "performRestart");
        mCanEnterPictureInPicture = true;
        mFragments.noteStateNotSaved();
@@ -8466,15 +8466,15 @@ public class Activity extends ContextThemeWrapper
            final long startTime = SystemClock.uptimeMillis();
            mInstrumentation.callActivityOnRestart(this);
            final long duration = SystemClock.uptimeMillis() - startTime;
            EventLogTags.writeWmOnRestartCalled(mIdent, getComponentName().getClassName(), reason,
                    duration);
            EventLogTags.writeWmOnRestartCalled(mIdent, getComponentName().getClassName(),
                    "performRestart", duration);
            if (!mCalled) {
                throw new SuperNotCalledException(
                    "Activity " + mComponent.toShortString() +
                    " did not call through to super.onRestart()");
            }
            if (start) {
                performStart(reason);
                performStart("performRestart");
            }
        }
        Trace.traceEnd(Trace.TRACE_TAG_WINDOW_MANAGER);
@@ -8486,7 +8486,6 @@ public class Activity extends ContextThemeWrapper
                    + mComponent.getClassName());
        }
        dispatchActivityPreResumed();
        performRestart(true /* start */, reason);

        mFragments.execPendingActions();

+1 −1
Original line number Diff line number Diff line
@@ -5264,7 +5264,7 @@ public final class ActivityThread extends ClientTransactionHandler
    @Override
    public void performRestartActivity(ActivityClientRecord r, boolean start) {
        if (r.stopped) {
            r.activity.performRestart(start, "performRestartActivity");
            r.activity.performRestart(start);
            if (start) {
                r.setState(ON_START);
            }