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

Commit 24d44a77 authored by Pinyao Ting's avatar Pinyao Ting Committed by Automerger Merge Worker
Browse files

Fixes the issue Launcher state propagation is slower than onDeferredResume. am: 9d51e49c

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/12142602

Change-Id: Ic042a5db68e492bedf58d6c328d151411a199ac2
parents d318bc6d 9d51e49c
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -157,6 +157,12 @@ public abstract class BaseQuickstepLauncher extends Launcher
    @Override
    protected void onDeferredResumed() {
        super.onDeferredResumed();
        handlePendingActivityRequest();
    }

    @Override
    protected void handlePendingActivityRequest() {
        super.handlePendingActivityRequest();
        if (mPendingActivityRequestCode != -1 && isInState(NORMAL)) {
            // Remove any active ProxyActivityStarter task and send RESULT_CANCELED to Launcher.
            onActivityResult(mPendingActivityRequestCode, RESULT_CANCELED, null);
+3 −1
Original line number Diff line number Diff line
@@ -923,6 +923,7 @@ public class Launcher extends StatefulActivity<LauncherState> implements Launche
        DiscoveryBounce.showForHomeIfNeeded(this);
    }

    protected void handlePendingActivityRequest() { }

    private void logStopAndResume(int command) {
        int pageIndex = mWorkspace.isOverlayShown() ? -1 : mWorkspace.getCurrentPage();
@@ -1423,7 +1424,8 @@ public class Launcher extends StatefulActivity<LauncherState> implements Launche
                if (!isInState(NORMAL)) {
                    // Only change state, if not already the same. This prevents cancelling any
                    // animations running as part of resume
                    mStateManager.goToState(NORMAL);
                    mStateManager.goToState(NORMAL, mStateManager.shouldAnimateStateChange(),
                            this::handlePendingActivityRequest);
                }

                // Reset the apps view