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

Commit 980377f5 authored by Winson Chung's avatar Winson Chung Committed by Android (Google) Code Review
Browse files

Merge "Ensure app is still touchable until the recents gesture has started"

parents f8cc90f7 dc4edb83
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -754,8 +754,7 @@ public class RecentsAnimationController implements DeathRecipient {
        // Only apply the input consumer if it is enabled, it is not the target (home/recents)
        // being revealed with the transition, and we are actively animating the app as a part of
        // the animation
        return mInputConsumerEnabled && mTargetActivityRecord != activity
                && isAnimatingApp(activity);
        return mInputConsumerEnabled && !isTargetApp(activity) && isAnimatingApp(activity);
    }

    boolean updateInputConsumerForApp(InputWindowHandle inputWindowHandle,
@@ -810,7 +809,9 @@ public class RecentsAnimationController implements DeathRecipient {
                    PooledLambda.__(ActivityRecord.class));
            boolean isAnimatingApp = task.forAllActivities(f);
            f.recycle();
            return isAnimatingApp;
            if (isAnimatingApp) {
                return true;
            }
        }
        return false;
    }
+5 −5
Original line number Diff line number Diff line
@@ -2691,18 +2691,18 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP

        return mActivityRecord.getTask().getTaskStack().shouldIgnoreInput()
                || !mActivityRecord.mVisibleRequested
                || isAnimatingToRecents();
                || isRecentsAnimationConsumingAppInput();
    }

    /**
     * Returns {@code true} if the window is animating to home as part of the recents animation.
     * Returns {@code true} if the window is animating to home as part of the recents animation and
     * it is consuming input from the app.
     */
    private boolean isAnimatingToRecents() {
    private boolean isRecentsAnimationConsumingAppInput() {
        final RecentsAnimationController recentsAnimationController =
                mWmService.getRecentsAnimationController();
        return recentsAnimationController != null
                && recentsAnimationController.isAnimatingTask(getTask())
                && !recentsAnimationController.isTargetApp(mActivityRecord);
                && recentsAnimationController.shouldApplyInputConsumer(mActivityRecord);
    }

    @Override
+1 −1
Original line number Diff line number Diff line
@@ -596,7 +596,7 @@ public class WindowStateTests extends WindowTestsBase {

        // Mock active recents animation
        RecentsAnimationController recentsController = mock(RecentsAnimationController.class);
        when(recentsController.isAnimatingTask(win0.mActivityRecord.getTask())).thenReturn(true);
        when(recentsController.shouldApplyInputConsumer(win0.mActivityRecord)).thenReturn(true);
        mWm.setRecentsAnimationController(recentsController);
        assertTrue(win0.cantReceiveTouchInput());
    }