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

Commit 4f120d6a authored by Vaibhav Devmurari's avatar Vaibhav Devmurari
Browse files

(3/n) Cleanup multi key gesture event handling flags

Test: atest InputTests
Bug: 358569822
Flag: EXEMPT cleanup
Change-Id: I27439d0f85143aaad1d78ac794ef9092b4857669
parent 15df102f
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -26,7 +26,6 @@ import static com.android.hardware.input.Flags.pointerAcceleration;
import static com.android.hardware.input.Flags.touchpadSystemGestureDisable;
import static com.android.hardware.input.Flags.touchpadThreeFingerTapShortcut;
import static com.android.hardware.input.Flags.touchpadVisualizer;
import static com.android.hardware.input.Flags.useKeyGestureEventHandlerMultiKeyGestures;
import static com.android.input.flags.Flags.FLAG_KEYBOARD_REPEAT_KEYS;
import static com.android.input.flags.Flags.keyboardRepeatKeys;

@@ -1299,13 +1298,4 @@ public class InputSettings {
    public static boolean isCustomizableInputGesturesFeatureFlagEnabled() {
        return enableCustomizableInputGestures();
    }

    /**
     * Whether multi-key gestures are supported using {@code KeyGestureEventHandler}
     *
     * @hide
     */
    public static boolean doesKeyGestureEventHandlerSupportMultiKeyGestures() {
        return useKeyGestureEventHandlerMultiKeyGestures();
    }
}
+0 −7
Original line number Diff line number Diff line
@@ -46,13 +46,6 @@ flag {
    bug: "358569822"
}

flag {
    namespace: "input"
    name: "use_key_gesture_event_handler_multi_key_gestures"
    description: "Use KeyGestureEvent handler APIs to control multi key press gestures"
    bug: "358569822"
}

flag {
    name: "keyboard_repeat_keys"
    namespace: "input_native"
+2 −2
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.android.server.policy;
package com.android.server.input;

import static android.view.KeyEvent.KEYCODE_POWER;

@@ -33,7 +33,7 @@ import java.util.function.Consumer;
/**
 * Handles a mapping of two keys combination.
 */
public class KeyCombinationManager {
final class KeyCombinationManager {
    private static final String TAG = "KeyCombinationManager";

    // Store the received down time of keycode.
+10 −18
Original line number Diff line number Diff line
@@ -43,7 +43,6 @@ import android.hardware.input.IKeyGestureEventListener;
import android.hardware.input.IKeyGestureHandler;
import android.hardware.input.InputGestureData;
import android.hardware.input.InputManager;
import android.hardware.input.InputSettings;
import android.hardware.input.KeyGestureEvent;
import android.os.Handler;
import android.os.IBinder;
@@ -72,7 +71,6 @@ import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.policy.IShortcutService;
import com.android.server.LocalServices;
import com.android.server.pm.UserManagerInternal;
import com.android.server.policy.KeyCombinationManager;

import org.xmlpull.v1.XmlPullParserException;

@@ -243,9 +241,6 @@ final class KeyGestureController {
    }

    private void initKeyCombinationRules() {
        if (!InputSettings.doesKeyGestureEventHandlerSupportMultiKeyGestures()) {
            return;
        }
        // TODO(b/358569822): Handle Power, Back key properly since key combination gesture is
        //  captured here and rest of the Power, Back key behaviors are handled in PWM
        final boolean screenshotChordEnabled = mContext.getResources().getBoolean(
@@ -467,8 +462,7 @@ final class KeyGestureController {
        if (mVisibleBackgroundUsersEnabled && shouldIgnoreKeyEventForVisibleBackgroundUser(event)) {
            return false;
        }
        if (InputSettings.doesKeyGestureEventHandlerSupportMultiKeyGestures()
                && (event.getFlags() & KeyEvent.FLAG_FALLBACK) == 0) {
        if ((event.getFlags() & KeyEvent.FLAG_FALLBACK) == 0) {
            final boolean interactive = (policyFlags & FLAG_INTERACTIVE) != 0;
            final boolean isDefaultDisplayOn = isDefaultDisplayOn();
            return mKeyCombinationManager.interceptKey(event, interactive && isDefaultDisplayOn);
@@ -504,7 +498,6 @@ final class KeyGestureController {
        final long keyConsumed = -1;
        final long keyNotConsumed = 0;

        if (InputSettings.doesKeyGestureEventHandlerSupportMultiKeyGestures()) {
        if (mKeyCombinationManager.isKeyConsumed(event)) {
            return keyConsumed;
        }
@@ -517,7 +510,6 @@ final class KeyGestureController {
                return interceptTimeout - now;
            }
        }
        }

        Set<Integer> consumedKeys = mConsumedKeysForDevice.get(deviceId);
        if (consumedKeys == null) {
+1 −271

File changed.

Preview size limit exceeded, changes collapsed.

Loading