Skip to content

Commit 0316518

Browse files
authored
refactor!: Use the queued-events pattern in the Android adapter (#555)
1 parent f9c9755 commit 0316518

File tree

6 files changed

+318
-282
lines changed

6 files changed

+318
-282
lines changed

platforms/android/classes.dex

-36 Bytes
Binary file not shown.

platforms/android/java/dev/accesskit/android/Delegate.java

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,8 @@ private static native boolean populateNodeInfo(
218218

219219
private static native int getVirtualViewAtPoint(long adapterHandle, float x, float y);
220220

221-
private static native boolean performAction(long adapterHandle, int virtualViewId, int action);
221+
private static native boolean performAction(
222+
long adapterHandle, View host, int virtualViewId, int action);
222223

223224
private static native boolean setTextSelection(
224225
long adapterHandle, View host, int virtualViewId, int anchor, int focus);
@@ -324,16 +325,7 @@ public boolean performAction(int virtualViewId, int action, Bundle arguments) {
324325
forward,
325326
extendSelection);
326327
}
327-
if (!Delegate.performAction(adapterHandle, virtualViewId, action)) {
328-
return false;
329-
}
330-
switch (action) {
331-
case AccessibilityNodeInfo.ACTION_CLICK:
332-
sendEventInternal(
333-
host, virtualViewId, AccessibilityEvent.TYPE_VIEW_CLICKED);
334-
break;
335-
}
336-
return true;
328+
return Delegate.performAction(adapterHandle, host, virtualViewId, action);
337329
}
338330

339331
@Override

0 commit comments

Comments
 (0)