Accessibility: Sometimes cannot interact with nav bar items.
If there is a window with the accessibility focus we want to click on the accessibility focused view in this window. The logic to compute the bounds of the window was using the wrong window id, hence getting an incorrect result. As a consequence in some cases the user could not click on accessiiblity focused controls in the nav bar. bug:18889611 Change-Id: I89aee3ae2ffe27fe29819049c287a7155154c65b
This commit is contained in:
@@ -765,16 +765,13 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the bounds of the active window.
|
||||
* Gets the bounds of a window.
|
||||
*
|
||||
* @param outBounds The output to which to write the bounds.
|
||||
*/
|
||||
boolean getActiveWindowBounds(Rect outBounds) {
|
||||
// TODO: This should be refactored to work with accessibility
|
||||
// focus in multiple windows.
|
||||
boolean getWindowBounds(int windowId, Rect outBounds) {
|
||||
IBinder token;
|
||||
synchronized (mLock) {
|
||||
final int windowId = mSecurityPolicy.mActiveWindowId;
|
||||
token = mGlobalWindowTokens.get(windowId);
|
||||
if (token == null) {
|
||||
token = getCurrentUserStateLocked().mWindowTokens.get(windowId);
|
||||
@@ -3255,7 +3252,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
|
||||
|
||||
// Make sure the point is within the window.
|
||||
Rect windowBounds = mTempRect;
|
||||
getActiveWindowBounds(windowBounds);
|
||||
getWindowBounds(focus.getWindowId(), windowBounds);
|
||||
if (!windowBounds.contains(point.x, point.y)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user