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

Commit 1b4e5594 authored by Tiger's avatar Tiger
Browse files

Don't hide the home handle when it is attaching to the app

We had the logic in the case of legacy transition. This CL applies it to
the shell transition cases.

Fix: 286222508
Fix: 283037901
Test: Open Calculator in landscape and drag the home handle up. See if
      the home handle attaches to the app when dragging.
Test: Open Calculator in portrait and swipe home handle up to enter
      overview screen. See if there is a fade-in animation when home
      handle is showing at the screen bottom.
Change-Id: Ib1321532ebbef57f2d371344f895b9ee3a58a28d
parent 9087af02
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -185,6 +185,8 @@ class AsyncRotationController extends FadeAnimationController implements Consume
                }
            } else if (navigationBarCanMove || mTransitionOp == OP_CHANGE_MAY_SEAMLESS) {
                action = Operation.ACTION_SEAMLESS;
            } else if (mDisplayContent.mTransitionController.mNavigationBarAttachedToApp) {
                return;
            }
            mTargetWindowTokens.put(w.mToken, new Operation(action));
            return;
+13 −6
Original line number Diff line number Diff line
@@ -234,9 +234,6 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
    private @TransitionState int mState = STATE_PENDING;
    private final ReadyTracker mReadyTracker = new ReadyTracker();

    // TODO(b/188595497): remove when not needed.
    /** @see RecentsAnimationController#mNavigationBarAttachedToApp */
    private boolean mNavBarAttachedToApp = false;
    private int mRecentsDisplayId = INVALID_DISPLAY;

    /** The delay for light bar appearance animation. */
@@ -1780,7 +1777,7 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
        if (navWindow == null || navWindow.mToken == null) {
            return;
        }
        mNavBarAttachedToApp = true;
        mController.mNavigationBarAttachedToApp = true;
        navWindow.mToken.cancelAnimation();
        final SurfaceControl.Transaction t = navWindow.mToken.getPendingTransaction();
        final SurfaceControl navSurfaceControl = navWindow.mToken.getSurfaceControl();
@@ -1802,8 +1799,10 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {

    /** @see RecentsAnimationController#restoreNavigationBarFromApp */
    void legacyRestoreNavigationBarFromApp() {
        if (!mNavBarAttachedToApp) return;
        mNavBarAttachedToApp = false;
        if (!mController.mNavigationBarAttachedToApp) {
            return;
        }
        mController.mNavigationBarAttachedToApp = false;

        if (mRecentsDisplayId == INVALID_DISPLAY) {
            Slog.e(TAG, "Reparented navigation bar without a valid display");
@@ -1836,6 +1835,11 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
            break;
        }

        final AsyncRotationController asyncRotationController = dc.getAsyncRotationController();
        if (asyncRotationController != null) {
            asyncRotationController.accept(navWindow);
        }

        if (animate) {
            final NavBarFadeAnimationController controller =
                    new NavBarFadeAnimationController(dc);
@@ -1844,6 +1848,9 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
            // Reparent the SurfaceControl of nav bar token back.
            t.reparent(navToken.getSurfaceControl(), parent.getSurfaceControl());
        }

        // To apply transactions.
        dc.mWmService.scheduleAnimationLocked();
    }

    private void reportStartReasonsToLogger() {
+5 −0
Original line number Diff line number Diff line
@@ -206,6 +206,11 @@ class TransitionController {
     */
    boolean mBuildingFinishLayers = false;

    /**
     * Whether the surface of navigation bar token is reparented to an app.
     */
    boolean mNavigationBarAttachedToApp = false;

    private boolean mAnimatingState = false;

    final Handler mLoggerHandler = FgThread.getHandler();