summaryrefslogtreecommitdiff
path: root/core/java/android/view/AccessibilityInteractionController.java
diff options
context:
space:
mode:
authorSvetoslav Ganov <svetoslavganov@google.com>2012-07-16 08:46:07 -0700
committerSvetoslav Ganov <svetoslavganov@google.com>2012-07-16 08:46:11 -0700
commitc9c9a48e7bafae63cb35a9aa69255e80aba83988 (patch)
tree80295bae9e6546d9d7fb604af0fa772ebd18a4fc /core/java/android/view/AccessibilityInteractionController.java
parentdd0d0ba654cea3051e44ba9ae20ac4b269e123c0 (diff)
Removing a workaround for incorrect window position on window move.
1. The window manager was not notifying a window when the latter has been moved. This was causing incorrect coordinates of the nodes reported to accessibility services. To workaround that we have carried the correct window location when making a call from the accessibility layer into a window. Now the window manager notifies the window when it is moved and the workaround is no longer needed. This change takes it out. 2. The left and right in the attach info were not updated properly after a report that the window has moved. 3. The accessibility manager service was calling directly methods on the window manager service without going through the interface of the latter. This leads to unnecessary coupling and in the long rung increases system complexity and reduces maintability. bug:6623031 Change-Id: Iacb734b1bf337a47fad02c827ece45bb2f53a79d
Diffstat (limited to 'core/java/android/view/AccessibilityInteractionController.java')
-rw-r--r--core/java/android/view/AccessibilityInteractionController.java82
1 files changed, 14 insertions, 68 deletions
diff --git a/core/java/android/view/AccessibilityInteractionController.java b/core/java/android/view/AccessibilityInteractionController.java
index d0c393c94bfc..fbda474639d0 100644
--- a/core/java/android/view/AccessibilityInteractionController.java
+++ b/core/java/android/view/AccessibilityInteractionController.java
@@ -141,7 +141,7 @@ final class AccessibilityInteractionController {
}
public void findAccessibilityNodeInfoByAccessibilityIdClientThread(
- long accessibilityNodeId, int windowLeft, int windowTop, int interactionId,
+ long accessibilityNodeId, int interactionId,
IAccessibilityInteractionConnectionCallback callback, int flags, int interrogatingPid,
long interrogatingTid) {
Message message = mHandler.obtainMessage();
@@ -153,12 +153,6 @@ final class AccessibilityInteractionController {
args.argi2 = AccessibilityNodeInfo.getVirtualDescendantId(accessibilityNodeId);
args.argi3 = interactionId;
args.arg1 = callback;
-
- SomeArgs moreArgs = mPool.acquire();
- moreArgs.argi1 = windowLeft;
- moreArgs.argi2 = windowTop;
- args.arg2 = moreArgs;
-
message.obj = args;
// If the interrogation is performed by the same thread as the main UI
@@ -183,11 +177,6 @@ final class AccessibilityInteractionController {
final IAccessibilityInteractionConnectionCallback callback =
(IAccessibilityInteractionConnectionCallback) args.arg1;
- SomeArgs moreArgs = (SomeArgs) args.arg2;
- mViewRootImpl.mAttachInfo.mActualWindowLeft = moreArgs.argi1;
- mViewRootImpl.mAttachInfo.mActualWindowTop = moreArgs.argi2;
-
- mPool.release(moreArgs);
mPool.release(args);
List<AccessibilityNodeInfo> infos = mTempAccessibilityNodeInfoList;
@@ -220,9 +209,8 @@ final class AccessibilityInteractionController {
}
public void findAccessibilityNodeInfoByViewIdClientThread(long accessibilityNodeId,
- int viewId, int windowLeft, int windowTop, int interactionId,
- IAccessibilityInteractionConnectionCallback callback, int flags, int interrogatingPid,
- long interrogatingTid) {
+ int viewId, int interactionId, IAccessibilityInteractionConnectionCallback callback,
+ int flags, int interrogatingPid, long interrogatingTid) {
Message message = mHandler.obtainMessage();
message.what = PrivateHandler.MSG_FIND_ACCESSIBLITY_NODE_INFO_BY_VIEW_ID;
message.arg1 = flags;
@@ -233,11 +221,6 @@ final class AccessibilityInteractionController {
args.argi2 = interactionId;
args.arg1 = callback;
- SomeArgs moreArgs = mPool.acquire();
- moreArgs.argi1 = windowLeft;
- moreArgs.argi2 = windowTop;
- args.arg2 = moreArgs;
-
message.obj = args;
// If the interrogation is performed by the same thread as the main UI
@@ -262,11 +245,6 @@ final class AccessibilityInteractionController {
final IAccessibilityInteractionConnectionCallback callback =
(IAccessibilityInteractionConnectionCallback) args.arg1;
- SomeArgs moreArgs = (SomeArgs) args.arg2;
- mViewRootImpl.mAttachInfo.mActualWindowLeft = moreArgs.argi1;
- mViewRootImpl.mAttachInfo.mActualWindowTop = moreArgs.argi2;
-
- mPool.release(moreArgs);
mPool.release(args);
AccessibilityNodeInfo info = null;
@@ -300,25 +278,19 @@ final class AccessibilityInteractionController {
}
public void findAccessibilityNodeInfosByTextClientThread(long accessibilityNodeId,
- String text, int windowLeft, int windowTop, int interactionId,
- IAccessibilityInteractionConnectionCallback callback, int flags,
- int interrogatingPid, long interrogatingTid) {
+ String text, int interactionId, IAccessibilityInteractionConnectionCallback callback,
+ int flags, int interrogatingPid, long interrogatingTid) {
Message message = mHandler.obtainMessage();
message.what = PrivateHandler.MSG_FIND_ACCESSIBLITY_NODE_INFO_BY_TEXT;
message.arg1 = flags;
SomeArgs args = mPool.acquire();
args.arg1 = text;
+ args.arg2 = callback;
args.argi1 = AccessibilityNodeInfo.getAccessibilityViewId(accessibilityNodeId);
args.argi2 = AccessibilityNodeInfo.getVirtualDescendantId(accessibilityNodeId);
args.argi3 = interactionId;
- SomeArgs moreArgs = mPool.acquire();
- moreArgs.arg1 = callback;
- moreArgs.argi1 = windowLeft;
- moreArgs.argi2 = windowTop;
- args.arg2 = moreArgs;
-
message.obj = args;
// If the interrogation is performed by the same thread as the main UI
@@ -338,17 +310,11 @@ final class AccessibilityInteractionController {
SomeArgs args = (SomeArgs) message.obj;
final String text = (String) args.arg1;
+ final IAccessibilityInteractionConnectionCallback callback =
+ (IAccessibilityInteractionConnectionCallback) args.arg2;
final int accessibilityViewId = args.argi1;
final int virtualDescendantId = args.argi2;
final int interactionId = args.argi3;
-
- SomeArgs moreArgs = (SomeArgs) args.arg2;
- final IAccessibilityInteractionConnectionCallback callback =
- (IAccessibilityInteractionConnectionCallback) moreArgs.arg1;
- mViewRootImpl.mAttachInfo.mActualWindowLeft = moreArgs.argi1;
- mViewRootImpl.mAttachInfo.mActualWindowTop = moreArgs.argi2;
-
- mPool.release(moreArgs);
mPool.release(args);
List<AccessibilityNodeInfo> infos = null;
@@ -409,9 +375,9 @@ final class AccessibilityInteractionController {
}
}
- public void findFocusClientThread(long accessibilityNodeId, int focusType, int windowLeft,
- int windowTop, int interactionId, IAccessibilityInteractionConnectionCallback callback,
- int flags, int interogatingPid, long interrogatingTid) {
+ public void findFocusClientThread(long accessibilityNodeId, int focusType, int interactionId,
+ IAccessibilityInteractionConnectionCallback callback, int flags, int interogatingPid,
+ long interrogatingTid) {
Message message = mHandler.obtainMessage();
message.what = PrivateHandler.MSG_FIND_FOCUS;
message.arg1 = flags;
@@ -423,11 +389,6 @@ final class AccessibilityInteractionController {
args.argi3 = AccessibilityNodeInfo.getVirtualDescendantId(accessibilityNodeId);
args.arg1 = callback;
- SomeArgs moreArgs = mPool.acquire();
- moreArgs.argi1 = windowLeft;
- moreArgs.argi2 = windowTop;
- args.arg2 = moreArgs;
-
message.obj = args;
// If the interrogation is performed by the same thread as the main UI
@@ -453,11 +414,6 @@ final class AccessibilityInteractionController {
final IAccessibilityInteractionConnectionCallback callback =
(IAccessibilityInteractionConnectionCallback) args.arg1;
- SomeArgs moreArgs = (SomeArgs) args.arg2;
- mViewRootImpl.mAttachInfo.mActualWindowLeft = moreArgs.argi1;
- mViewRootImpl.mAttachInfo.mActualWindowTop = moreArgs.argi2;
-
- mPool.release(moreArgs);
mPool.release(args);
AccessibilityNodeInfo focused = null;
@@ -516,9 +472,9 @@ final class AccessibilityInteractionController {
}
}
- public void focusSearchClientThread(long accessibilityNodeId, int direction, int windowLeft,
- int windowTop, int interactionId, IAccessibilityInteractionConnectionCallback callback,
- int flags, int interogatingPid, long interrogatingTid) {
+ public void focusSearchClientThread(long accessibilityNodeId, int direction, int interactionId,
+ IAccessibilityInteractionConnectionCallback callback, int flags, int interogatingPid,
+ long interrogatingTid) {
Message message = mHandler.obtainMessage();
message.what = PrivateHandler.MSG_FOCUS_SEARCH;
message.arg1 = flags;
@@ -530,11 +486,6 @@ final class AccessibilityInteractionController {
args.argi3 = interactionId;
args.arg1 = callback;
- SomeArgs moreArgs = mPool.acquire();
- moreArgs.argi1 = windowLeft;
- moreArgs.argi2 = windowTop;
- args.arg2 = moreArgs;
-
message.obj = args;
// If the interrogation is performed by the same thread as the main UI
@@ -560,11 +511,6 @@ final class AccessibilityInteractionController {
final IAccessibilityInteractionConnectionCallback callback =
(IAccessibilityInteractionConnectionCallback) args.arg1;
- SomeArgs moreArgs = (SomeArgs) args.arg2;
- mViewRootImpl.mAttachInfo.mActualWindowLeft = moreArgs.argi1;
- mViewRootImpl.mAttachInfo.mActualWindowTop = moreArgs.argi2;
-
- mPool.release(moreArgs);
mPool.release(args);
AccessibilityNodeInfo next = null;