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

Commit 1879c010 authored by Ameer Armaly's avatar Ameer Armaly Committed by Android (Google) Code Review
Browse files

Merge "Fix screenshot shortcut when accessibility is enabled." into main

parents e7d03a36 a2455364
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -48,6 +48,16 @@ flag {
    bug: "198018180"
}

flag {
    name: "do_not_reset_key_event_state"
    namespace: "accessibility"
    description: "Don't reset the event stream state when receiving an event without policy flag FLAG_PASS_TO_USER. Just pass it through the pipeline."
    bug: "331900630"
    metadata {
        purpose: PURPOSE_BUGFIX
    }
}

flag {
    name: "enable_a11y_checker_logging"
    namespace: "accessibility"
+13 −2
Original line number Diff line number Diff line
@@ -347,8 +347,13 @@ class AccessibilityInputFilter extends InputFilter implements EventStreamTransfo
        final int eventSource = event.getSource();
        final int displayId = event.getDisplayId();
        if ((policyFlags & WindowManagerPolicy.FLAG_PASS_TO_USER) == 0) {
            if (!Flags.doNotResetKeyEventState()) {
                state.reset();
                clearEventStreamHandler(displayId, eventSource);
            }
            if (DEBUG) {
                Slog.d(TAG, "Not processing event " + event);
            }
            super.onInputEvent(event, policyFlags);
            return;
        }
@@ -503,9 +508,15 @@ class AccessibilityInputFilter extends InputFilter implements EventStreamTransfo

    private void processKeyEvent(EventStreamState state, KeyEvent event, int policyFlags) {
        if (!state.shouldProcessKeyEvent(event)) {
            if (DEBUG) {
                Slog.d(TAG, "processKeyEvent: not processing: " + event);
            }
            super.onInputEvent(event, policyFlags);
            return;
        }
        if (DEBUG) {
            Slog.d(TAG, "processKeyEvent: " + event);
        }
        // Since the display id of KeyEvent always would be -1 and there is only one
        // KeyboardInterceptor for all display, pass KeyEvent to the mEventHandler of
        // DEFAULT_DISPLAY to handle.