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

Commit 12ce6220 authored by Winson Chung's avatar Winson Chung Committed by Automerger Merge Worker
Browse files

Merge "Fix regression in adding recents input consumer leading to ANR" into...

Merge "Fix regression in adding recents input consumer leading to ANR" into rvc-dev am: c4ea0355 am: 28a0c58d

Change-Id: Ic1d64c7ababc78fb5939d6526dc95efabffd92b8
parents be307cff 28a0c58d
Loading
Loading
Loading
Loading
+10 −12
Original line number Diff line number Diff line
@@ -469,8 +469,12 @@ final class InputMonitor {
        public void accept(WindowState w) {
            final InputChannel inputChannel = w.mInputChannel;
            final InputWindowHandle inputWindowHandle = w.mInputWindowHandle;
            final RecentsAnimationController recentsAnimationController =
                    mService.getRecentsAnimationController();
            final boolean shouldApplyRecentsInputConsumer = recentsAnimationController != null
                    && recentsAnimationController.shouldApplyInputConsumer(w.mActivityRecord);
            if (inputChannel == null || inputWindowHandle == null || w.mRemoved
                    || w.cantReceiveTouchInput()) {
                    || (w.cantReceiveTouchInput() && !shouldApplyRecentsInputConsumer)) {
                if (w.mWinAnimator.hasSurface()) {
                    mInputTransaction.setInputWindowInfo(
                        w.mWinAnimator.mSurfaceController.getClientViewRootSurface(),
@@ -486,22 +490,16 @@ final class InputMonitor {
            final boolean hasFocus = w.isFocused();
            final boolean isVisible = w.isVisibleLw();

            if (mAddRecentsAnimationInputConsumerHandle) {
                final RecentsAnimationController recentsAnimationController =
                        mService.getRecentsAnimationController();
                if (recentsAnimationController != null
                        && recentsAnimationController.shouldApplyInputConsumer(w.mActivityRecord)) {
            if (mAddRecentsAnimationInputConsumerHandle && shouldApplyRecentsInputConsumer) {
                if (recentsAnimationController.updateInputConsumerForApp(
                        mRecentsAnimationInputConsumer.mWindowHandle, hasFocus)) {
                    mRecentsAnimationInputConsumer.show(mInputTransaction, w);
                    mAddRecentsAnimationInputConsumerHandle = false;
                }
            }
            }

            if (w.inPinnedWindowingMode()) {
                if (mAddPipInputConsumerHandle) {

                    final Task rootTask = w.getTask().getRootTask();
                    mPipInputConsumer.mWindowHandle.replaceTouchableRegionWithCrop(
                            rootTask.getSurfaceControl());
+2 −1
Original line number Diff line number Diff line
@@ -799,7 +799,8 @@ 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 && !isTargetApp(activity) && isAnimatingApp(activity);
        return mInputConsumerEnabled && activity != null
                && !isTargetApp(activity) && isAnimatingApp(activity);
    }

    boolean updateInputConsumerForApp(InputWindowHandle inputWindowHandle,