Loading core/java/android/accessibilityservice/AccessibilityService.java +1 −1 Original line number Diff line number Diff line Loading @@ -537,7 +537,7 @@ public abstract class AccessibilityService extends Service { * anything behind it, then only the modal window will be reported * (assuming it is the top one). For convenience the returned windows * are ordered in a descending layer order, which is the windows that * are higher in the Z-order are reported first. Since the user can always * are on top are reported first. Since the user can always * interact with the window that has input focus by typing, the focused * window is always returned (even if covered by a modal window). * <p> Loading core/java/android/app/UiAutomation.java +9 −2 Original line number Diff line number Diff line Loading @@ -580,6 +580,8 @@ public final class UiAutomation { // Execute the command *without* the lock being held. command.run(); List<AccessibilityEvent> receivedEvents = new ArrayList<>(); // Acquire the lock and wait for the event. try { // Wait for the event. Loading @@ -600,14 +602,14 @@ public final class UiAutomation { if (filter.accept(event)) { return event; } event.recycle(); receivedEvents.add(event); } // Check if timed out and if not wait. final long elapsedTimeMillis = SystemClock.uptimeMillis() - startTimeMillis; final long remainingTimeMillis = timeoutMillis - elapsedTimeMillis; if (remainingTimeMillis <= 0) { throw new TimeoutException("Expected event not received within: " + timeoutMillis + " ms."); + timeoutMillis + " ms among: " + receivedEvents); } synchronized (mLock) { if (mEventQueue.isEmpty()) { Loading @@ -620,6 +622,11 @@ public final class UiAutomation { } } } finally { int size = receivedEvents.size(); for (int i = 0; i < size; i++) { receivedEvents.get(i).recycle(); } synchronized (mLock) { mWaitingForEventDelivery = false; mEventQueue.clear(); Loading services/accessibility/java/com/android/server/accessibility/AbstractAccessibilityServiceConnection.java +1 −2 Original line number Diff line number Diff line Loading @@ -53,7 +53,6 @@ import android.view.accessibility.AccessibilityWindowInfo; import android.view.accessibility.IAccessibilityInteractionConnection; import android.view.accessibility.IAccessibilityInteractionConnectionCallback; import com.android.internal.os.SomeArgs; import com.android.internal.util.DumpUtils; import com.android.server.accessibility.AccessibilityManagerService.RemoteAccessibilityConnection; Loading @@ -76,7 +75,7 @@ abstract class AbstractAccessibilityServiceConnection extends IAccessibilityServ implements ServiceConnection, IBinder.DeathRecipient, KeyEventDispatcher.KeyEventFilter, FingerprintGestureDispatcher.FingerprintGestureClient { private static final boolean DEBUG = false; private static final String LOG_TAG = "AccessibilityClientConnection"; private static final String LOG_TAG = "AbstractAccessibilityServiceConnection"; protected final Context mContext; protected final SystemSupport mSystemSupport; Loading services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java +5 −1 Original line number Diff line number Diff line Loading @@ -2949,7 +2949,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub | AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED | AccessibilityEvent.TYPE_VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY; // In Z order // In Z order top to bottom public List<AccessibilityWindowInfo> mWindows; public SparseArray<AccessibilityWindowInfo> mA11yWindowInfoById = new SparseArray<>(); public SparseArray<WindowInfo> mWindowInfoById = new SparseArray<>(); Loading Loading @@ -3145,6 +3145,10 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub ? mWindowsForAccessibilityCallback.populateReportedWindow(windowInfo) : null; if (window != null) { // Flip layers in list to be consistent with AccessibilityService#getWindows window.setLayer(windowCount - 1 - window.getLayer()); final int windowId = window.getId(); if (window.isFocused()) { mFocusedWindowId = windowId; Loading Loading
core/java/android/accessibilityservice/AccessibilityService.java +1 −1 Original line number Diff line number Diff line Loading @@ -537,7 +537,7 @@ public abstract class AccessibilityService extends Service { * anything behind it, then only the modal window will be reported * (assuming it is the top one). For convenience the returned windows * are ordered in a descending layer order, which is the windows that * are higher in the Z-order are reported first. Since the user can always * are on top are reported first. Since the user can always * interact with the window that has input focus by typing, the focused * window is always returned (even if covered by a modal window). * <p> Loading
core/java/android/app/UiAutomation.java +9 −2 Original line number Diff line number Diff line Loading @@ -580,6 +580,8 @@ public final class UiAutomation { // Execute the command *without* the lock being held. command.run(); List<AccessibilityEvent> receivedEvents = new ArrayList<>(); // Acquire the lock and wait for the event. try { // Wait for the event. Loading @@ -600,14 +602,14 @@ public final class UiAutomation { if (filter.accept(event)) { return event; } event.recycle(); receivedEvents.add(event); } // Check if timed out and if not wait. final long elapsedTimeMillis = SystemClock.uptimeMillis() - startTimeMillis; final long remainingTimeMillis = timeoutMillis - elapsedTimeMillis; if (remainingTimeMillis <= 0) { throw new TimeoutException("Expected event not received within: " + timeoutMillis + " ms."); + timeoutMillis + " ms among: " + receivedEvents); } synchronized (mLock) { if (mEventQueue.isEmpty()) { Loading @@ -620,6 +622,11 @@ public final class UiAutomation { } } } finally { int size = receivedEvents.size(); for (int i = 0; i < size; i++) { receivedEvents.get(i).recycle(); } synchronized (mLock) { mWaitingForEventDelivery = false; mEventQueue.clear(); Loading
services/accessibility/java/com/android/server/accessibility/AbstractAccessibilityServiceConnection.java +1 −2 Original line number Diff line number Diff line Loading @@ -53,7 +53,6 @@ import android.view.accessibility.AccessibilityWindowInfo; import android.view.accessibility.IAccessibilityInteractionConnection; import android.view.accessibility.IAccessibilityInteractionConnectionCallback; import com.android.internal.os.SomeArgs; import com.android.internal.util.DumpUtils; import com.android.server.accessibility.AccessibilityManagerService.RemoteAccessibilityConnection; Loading @@ -76,7 +75,7 @@ abstract class AbstractAccessibilityServiceConnection extends IAccessibilityServ implements ServiceConnection, IBinder.DeathRecipient, KeyEventDispatcher.KeyEventFilter, FingerprintGestureDispatcher.FingerprintGestureClient { private static final boolean DEBUG = false; private static final String LOG_TAG = "AccessibilityClientConnection"; private static final String LOG_TAG = "AbstractAccessibilityServiceConnection"; protected final Context mContext; protected final SystemSupport mSystemSupport; Loading
services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java +5 −1 Original line number Diff line number Diff line Loading @@ -2949,7 +2949,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub | AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED | AccessibilityEvent.TYPE_VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY; // In Z order // In Z order top to bottom public List<AccessibilityWindowInfo> mWindows; public SparseArray<AccessibilityWindowInfo> mA11yWindowInfoById = new SparseArray<>(); public SparseArray<WindowInfo> mWindowInfoById = new SparseArray<>(); Loading Loading @@ -3145,6 +3145,10 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub ? mWindowsForAccessibilityCallback.populateReportedWindow(windowInfo) : null; if (window != null) { // Flip layers in list to be consistent with AccessibilityService#getWindows window.setLayer(windowCount - 1 - window.getLayer()); final int windowId = window.getId(); if (window.isFocused()) { mFocusedWindowId = windowId; Loading