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

Commit 5ab3cbc9 authored by Jeff Brown's avatar Jeff Brown Committed by Android (Google) Code Review
Browse files

Merge "Add support for disabling pointer gestures."

parents 024ebbd1 474dcb5c
Loading
Loading
Loading
Loading
+27 −0
Original line number Diff line number Diff line
@@ -1004,6 +1004,23 @@ public interface WindowManager extends ViewManager {
         */
        public boolean hasSystemUiListeners;

        /**
         * When this window has focus, disable touch pad pointer gesture processing.
         * The window will receive raw position updates from the touch pad instead
         * of pointer movements and synthetic touch events.
         *
         * @hide
         */
        public static final int INPUT_FEATURE_DISABLE_POINTER_GESTURES = 0x00000001;

        /**
         * Control special features of the input subsystem.
         *
         * @see #INPUT_FEATURE_DISABLE_TOUCH_PAD_GESTURES
         * @hide
         */
        public int inputFeatures;

        public LayoutParams() {
            super(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
            type = TYPE_APPLICATION;
@@ -1086,6 +1103,7 @@ public interface WindowManager extends ViewManager {
            out.writeInt(systemUiVisibility);
            out.writeInt(subtreeSystemUiVisibility);
            out.writeInt(hasSystemUiListeners ? 1 : 0);
            out.writeInt(inputFeatures);
        }
        
        public static final Parcelable.Creator<LayoutParams> CREATOR
@@ -1124,6 +1142,7 @@ public interface WindowManager extends ViewManager {
            systemUiVisibility = in.readInt();
            subtreeSystemUiVisibility = in.readInt();
            hasSystemUiListeners = in.readInt() != 0;
            inputFeatures = in.readInt();
        }
    
        @SuppressWarnings({"PointlessBitwiseExpression"})
@@ -1145,6 +1164,8 @@ public interface WindowManager extends ViewManager {
        public static final int SYSTEM_UI_VISIBILITY_CHANGED = 1<<13;
        /** {@hide} */
        public static final int SYSTEM_UI_LISTENER_CHANGED = 1<<14;
        /** {@hide} */
        public static final int INPUT_FEATURES_CHANGED = 1<<15;
    
        // internal buffer to backup/restore parameters under compatibility mode.
        private int[] mCompatibilityParamsBackup = null;
@@ -1256,6 +1277,11 @@ public interface WindowManager extends ViewManager {
                changes |= SYSTEM_UI_LISTENER_CHANGED;
            }

            if (inputFeatures != o.inputFeatures) {
                inputFeatures = o.inputFeatures;
                changes |= INPUT_FEATURES_CHANGED;
            }

            return changes;
        }
    
@@ -1340,6 +1366,7 @@ public interface WindowManager extends ViewManager {
                sb.append(" sysuil=");
                sb.append(hasSystemUiListeners);
            }
            sb.append(" if=0x").append(Integer.toHexString(inputFeatures));
            sb.append('}');
            return sb.toString();
        }
+1 −0
Original line number Diff line number Diff line
@@ -3395,6 +3395,7 @@ void InputDispatcher::dumpDispatchStateLocked(String8& dump) {
                    window.frameRight, window.frameBottom,
                    window.scaleFactor);
            dumpRegion(dump, window.touchableRegion);
            dump.appendFormat(", inputFeatures=0x%08x", window.inputFeatures);
            dump.appendFormat(", ownerPid=%d, ownerUid=%d, dispatchingTimeout=%0.3fms\n",
                    window.ownerPid, window.ownerUid,
                    window.dispatchingTimeout / 1000000.0);
+254 −201

File changed.

Preview size limit exceeded, changes collapsed.

+30 −15

File changed.

Preview size limit exceeded, changes collapsed.

+5 −0
Original line number Diff line number Diff line
@@ -127,6 +127,10 @@ struct InputWindow {
        LAST_SYSTEM_WINDOW      = 2999,
    };

    enum {
        INPUT_FEATURE_DISABLE_TOUCH_PAD_GESTURES = 0x00000001,
    };

    sp<InputWindowHandle> inputWindowHandle;
    sp<InputChannel> inputChannel;
    String8 name;
@@ -147,6 +151,7 @@ struct InputWindow {
    int32_t layer;
    int32_t ownerPid;
    int32_t ownerUid;
    int32_t inputFeatures;

    bool touchableRegionContainsPoint(int32_t x, int32_t y) const;
    bool frameContainsPoint(int32_t x, int32_t y) const;
Loading