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

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

Merge changes from topic "presubmit-am-cf03cdfdc7444d7faac91b866c05eae8" into...

Merge changes from topic "presubmit-am-cf03cdfdc7444d7faac91b866c05eae8" into sc-v2-dev-plus-aosp am: b7225856

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

Change-Id: I5595a2cf4bdc179c74d20a01e9249de7c14199ce
parents 3b38293e b7225856
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -99,6 +99,8 @@ public interface InputConsumer {

    default void onMotionEvent(MotionEvent ev) { }

    default void onHoverEvent(MotionEvent ev) { }

    default void onKeyEvent(KeyEvent ev) { }

    default void onInputEvent(InputEvent ev) {
+7 −0
Original line number Diff line number Diff line
@@ -100,6 +100,13 @@ public class OverviewInputConsumer<S extends BaseState<S>, T extends StatefulAct
        }
    }

    @Override
    public void onHoverEvent(MotionEvent ev) {
        if (ENABLE_QUICKSTEP_LIVE_TILE.get()) {
            mActivity.dispatchGenericMotionEvent(ev);
        }
    }

    @Override
    public void onKeyEvent(KeyEvent ev) {
        if (ENABLE_QUICKSTEP_LIVE_TILE.get()) {
+19 −1
Original line number Diff line number Diff line
@@ -71,7 +71,16 @@ public class InputConsumerProxy {

    private boolean onInputConsumerEvent(InputEvent ev) {
        if (ev instanceof MotionEvent) {
            onInputConsumerMotionEvent((MotionEvent) ev);
            MotionEvent event = (MotionEvent) ev;
            int action = event.getActionMasked();
            boolean isHoverEvent = action == MotionEvent.ACTION_HOVER_ENTER
                    || action == MotionEvent.ACTION_HOVER_MOVE
                    || action == MotionEvent.ACTION_HOVER_EXIT;
            if (isHoverEvent) {
                onInputConsumerHoverEvent(event);
            } else {
                onInputConsumerMotionEvent(event);
            }
        } else if (ev instanceof KeyEvent) {
            initInputConsumerIfNeeded();
            mInputConsumer.onKeyEvent((KeyEvent) ev);
@@ -113,6 +122,15 @@ public class InputConsumerProxy {
        return true;
    }

    private void onInputConsumerHoverEvent(MotionEvent ev) {
        initInputConsumerIfNeeded();
        if (mInputConsumer != null) {
            SimpleOrientationTouchTransformer.INSTANCE.get(mContext).transform(ev,
                    mRotationSupplier.get());
            mInputConsumer.onHoverEvent(ev);
        }
    }

    public void destroy() {
        if (mTouchInProgress) {
            mDestroyPending = true;