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

Commit b5736162 authored by Winson Chung's avatar Winson Chung
Browse files

Make recents animation input consumer focusable

- Ensures that there's a focused window during swipe up

Bug: 167780081
Test: Verified by partner
Change-Id: I601ef6b54665f231038972265a4bccf4afb025eb
parent f9643611
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -265,6 +265,7 @@ final class InputMonitor {
                consumer.mWindowHandle.layoutParamsFlags |= FLAG_NOT_TOUCH_MODAL;
                break;
            case INPUT_CONSUMER_RECENTS_ANIMATION:
                consumer.mWindowHandle.focusable = true;
                break;
            default:
                throw new IllegalArgumentException("Illegal input consumer : " + name
@@ -545,7 +546,7 @@ final class InputMonitor {

            if (mAddRecentsAnimationInputConsumerHandle && shouldApplyRecentsInputConsumer) {
                if (recentsAnimationController.updateInputConsumerForApp(
                        mRecentsAnimationInputConsumer.mWindowHandle, focusable)) {
                        mRecentsAnimationInputConsumer.mWindowHandle)) {
                    mRecentsAnimationInputConsumer.show(mInputTransaction, w);
                    mAddRecentsAnimationInputConsumerHandle = false;
                }
+1 −3
Original line number Diff line number Diff line
@@ -827,15 +827,13 @@ public class RecentsAnimationController implements DeathRecipient {
                && !isTargetApp(activity) && isAnimatingApp(activity);
    }

    boolean updateInputConsumerForApp(InputWindowHandle inputWindowHandle,
            boolean focusable) {
    boolean updateInputConsumerForApp(InputWindowHandle inputWindowHandle) {
        // Update the input consumer touchable region to match the target app main window
        final WindowState targetAppMainWindow = mTargetActivityRecord != null
                ? mTargetActivityRecord.findMainWindow()
                : null;
        if (targetAppMainWindow != null) {
            targetAppMainWindow.getBounds(mTmpRect);
            inputWindowHandle.focusable = focusable;
            inputWindowHandle.touchableRegion.set(mTmpRect);
            return true;
        }