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

Commit f82d822b authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "Implement text entry key API for accessibility services in AOSP...

Merge "Implement text entry key API for accessibility services in AOSP Keyboard" am: c3eafcb7 am: fc2bc105

Change-Id: Ie3e94bbd0401ddabb489b0bcf6e7f6fc6be8f0c0
parents c1ae6aa1 fc2bc105
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -243,7 +243,6 @@ public class KeyboardAccessibilityDelegate<KV extends KeyboardView>
        // Make sure we're not getting an EXIT event because the user slid
        // off the keyboard area, then force a key press.
        if (key != null) {
            performClickOn(key);
            onHoverExitFrom(key);
        }
        setLastHoverKey(null);
+4 −7
Original line number Diff line number Diff line
@@ -236,6 +236,7 @@ final class KeyboardAccessibilityNodeProvider<KV extends KeyboardView>
        // Obtain and initialize an AccessibilityNodeInfo with information about the virtual view.
        final AccessibilityNodeInfoCompat info = AccessibilityNodeInfoCompat.obtain();
        info.setPackageName(mKeyboardView.getContext().getPackageName());
        info.setTextEntryKey(true);
        info.setClassName(key.getClass().getName());
        info.setContentDescription(keyDescription);
        info.setBoundsInParent(boundsInParent);
@@ -244,14 +245,10 @@ final class KeyboardAccessibilityNodeProvider<KV extends KeyboardView>
        info.setSource(mKeyboardView, virtualViewId);
        info.setEnabled(key.isEnabled());
        info.setVisibleToUser(true);
        // Don't add ACTION_CLICK and ACTION_LONG_CLOCK actions while hovering on the key.
        // See {@link #onHoverEnterTo(Key)} and {@link #onHoverExitFrom(Key)}.
        if (virtualViewId != mHoveringNodeId) {
        info.addAction(AccessibilityNodeInfoCompat.ACTION_CLICK);
        if (key.isLongPressEnabled()) {
            info.addAction(AccessibilityNodeInfoCompat.ACTION_LONG_CLICK);
        }
        }

        if (mAccessibilityFocusedView == virtualViewId) {
            info.addAction(AccessibilityNodeInfoCompat.ACTION_CLEAR_ACCESSIBILITY_FOCUS);
+0 −8
Original line number Diff line number Diff line
@@ -62,13 +62,10 @@ public final class MainKeyboardAccessibilityDelegate
    // The rectangle region to ignore hover events.
    private final Rect mBoundsToIgnoreHoverEvent = new Rect();

    private final AccessibilityLongPressTimer mAccessibilityLongPressTimer;

    public MainKeyboardAccessibilityDelegate(final MainKeyboardView mainKeyboardView,
            final KeyDetector keyDetector) {
        super(mainKeyboardView, keyDetector);
        mAccessibilityLongPressTimer = new AccessibilityLongPressTimer(
                this /* callback */, mainKeyboardView.getContext());
    }

    /**
@@ -233,7 +230,6 @@ public final class MainKeyboardAccessibilityDelegate
            Log.d(TAG, "onHoverEnterTo: key=" + key
                    + " inIgnoreBounds=" + mBoundsToIgnoreHoverEvent.contains(x, y));
        }
        mAccessibilityLongPressTimer.cancelLongPress();
        if (mBoundsToIgnoreHoverEvent.contains(x, y)) {
            return;
        }
@@ -241,9 +237,6 @@ public final class MainKeyboardAccessibilityDelegate
        // Further hover events should be handled.
        mBoundsToIgnoreHoverEvent.setEmpty();
        super.onHoverEnterTo(key);
        if (key.isLongPressEnabled()) {
            mAccessibilityLongPressTimer.startLongPress(key);
        }
    }

    @Override
@@ -254,7 +247,6 @@ public final class MainKeyboardAccessibilityDelegate
            Log.d(TAG, "onHoverExitFrom: key=" + key
                    + " inIgnoreBounds=" + mBoundsToIgnoreHoverEvent.contains(x, y));
        }
        mAccessibilityLongPressTimer.cancelLongPress();
        super.onHoverExitFrom(key);
    }