@@ -141,7 +141,7 @@ private boolean isShown(View view) {
141141 }
142142
143143 public void findAccessibilityNodeInfoByAccessibilityIdClientThread (
144- long accessibilityNodeId , int interactionId ,
144+ long accessibilityNodeId , int windowLeft , int windowTop , int interactionId ,
145145 IAccessibilityInteractionConnectionCallback callback , int flags , int interrogatingPid ,
146146 long interrogatingTid ) {
147147 Message message = mHandler .obtainMessage ();
@@ -153,6 +153,12 @@ public void findAccessibilityNodeInfoByAccessibilityIdClientThread(
153153 args .argi2 = AccessibilityNodeInfo .getVirtualDescendantId (accessibilityNodeId );
154154 args .argi3 = interactionId ;
155155 args .arg1 = callback ;
156+
157+ SomeArgs moreArgs = mPool .acquire ();
158+ moreArgs .argi1 = windowLeft ;
159+ moreArgs .argi2 = windowTop ;
160+ args .arg2 = moreArgs ;
161+
156162 message .obj = args ;
157163
158164 // If the interrogation is performed by the same thread as the main UI
@@ -177,6 +183,11 @@ private void findAccessibilityNodeInfoByAccessibilityIdUiThread(Message message)
177183 final IAccessibilityInteractionConnectionCallback callback =
178184 (IAccessibilityInteractionConnectionCallback ) args .arg1 ;
179185
186+ SomeArgs moreArgs = (SomeArgs ) args .arg2 ;
187+ mViewRootImpl .mAttachInfo .mActualWindowLeft = moreArgs .argi1 ;
188+ mViewRootImpl .mAttachInfo .mActualWindowTop = moreArgs .argi2 ;
189+
190+ mPool .release (moreArgs );
180191 mPool .release (args );
181192
182193 List <AccessibilityNodeInfo > infos = mTempAccessibilityNodeInfoList ;
@@ -209,8 +220,9 @@ private void findAccessibilityNodeInfoByAccessibilityIdUiThread(Message message)
209220 }
210221
211222 public void findAccessibilityNodeInfoByViewIdClientThread (long accessibilityNodeId ,
212- int viewId , int interactionId , IAccessibilityInteractionConnectionCallback callback ,
213- int flags , int interrogatingPid , long interrogatingTid ) {
223+ int viewId , int windowLeft , int windowTop , int interactionId ,
224+ IAccessibilityInteractionConnectionCallback callback , int flags , int interrogatingPid ,
225+ long interrogatingTid ) {
214226 Message message = mHandler .obtainMessage ();
215227 message .what = PrivateHandler .MSG_FIND_ACCESSIBLITY_NODE_INFO_BY_VIEW_ID ;
216228 message .arg1 = flags ;
@@ -221,6 +233,11 @@ public void findAccessibilityNodeInfoByViewIdClientThread(long accessibilityNode
221233 args .argi2 = interactionId ;
222234 args .arg1 = callback ;
223235
236+ SomeArgs moreArgs = mPool .acquire ();
237+ moreArgs .argi1 = windowLeft ;
238+ moreArgs .argi2 = windowTop ;
239+ args .arg2 = moreArgs ;
240+
224241 message .obj = args ;
225242
226243 // If the interrogation is performed by the same thread as the main UI
@@ -245,6 +262,11 @@ private void findAccessibilityNodeInfoByViewIdUiThread(Message message) {
245262 final IAccessibilityInteractionConnectionCallback callback =
246263 (IAccessibilityInteractionConnectionCallback ) args .arg1 ;
247264
265+ SomeArgs moreArgs = (SomeArgs ) args .arg2 ;
266+ mViewRootImpl .mAttachInfo .mActualWindowLeft = moreArgs .argi1 ;
267+ mViewRootImpl .mAttachInfo .mActualWindowTop = moreArgs .argi2 ;
268+
269+ mPool .release (moreArgs );
248270 mPool .release (args );
249271
250272 AccessibilityNodeInfo info = null ;
@@ -278,19 +300,25 @@ private void findAccessibilityNodeInfoByViewIdUiThread(Message message) {
278300 }
279301
280302 public void findAccessibilityNodeInfosByTextClientThread (long accessibilityNodeId ,
281- String text , int interactionId , IAccessibilityInteractionConnectionCallback callback ,
282- int flags , int interrogatingPid , long interrogatingTid ) {
303+ String text , int windowLeft , int windowTop , int interactionId ,
304+ IAccessibilityInteractionConnectionCallback callback , int flags ,
305+ int interrogatingPid , long interrogatingTid ) {
283306 Message message = mHandler .obtainMessage ();
284307 message .what = PrivateHandler .MSG_FIND_ACCESSIBLITY_NODE_INFO_BY_TEXT ;
285308 message .arg1 = flags ;
286309
287310 SomeArgs args = mPool .acquire ();
288311 args .arg1 = text ;
289- args .arg2 = callback ;
290312 args .argi1 = AccessibilityNodeInfo .getAccessibilityViewId (accessibilityNodeId );
291313 args .argi2 = AccessibilityNodeInfo .getVirtualDescendantId (accessibilityNodeId );
292314 args .argi3 = interactionId ;
293315
316+ SomeArgs moreArgs = mPool .acquire ();
317+ moreArgs .arg1 = callback ;
318+ moreArgs .argi1 = windowLeft ;
319+ moreArgs .argi2 = windowTop ;
320+ args .arg2 = moreArgs ;
321+
294322 message .obj = args ;
295323
296324 // If the interrogation is performed by the same thread as the main UI
@@ -310,11 +338,17 @@ private void findAccessibilityNodeInfosByTextUiThread(Message message) {
310338
311339 SomeArgs args = (SomeArgs ) message .obj ;
312340 final String text = (String ) args .arg1 ;
313- final IAccessibilityInteractionConnectionCallback callback =
314- (IAccessibilityInteractionConnectionCallback ) args .arg2 ;
315341 final int accessibilityViewId = args .argi1 ;
316342 final int virtualDescendantId = args .argi2 ;
317343 final int interactionId = args .argi3 ;
344+
345+ SomeArgs moreArgs = (SomeArgs ) args .arg2 ;
346+ final IAccessibilityInteractionConnectionCallback callback =
347+ (IAccessibilityInteractionConnectionCallback ) moreArgs .arg1 ;
348+ mViewRootImpl .mAttachInfo .mActualWindowLeft = moreArgs .argi1 ;
349+ mViewRootImpl .mAttachInfo .mActualWindowTop = moreArgs .argi2 ;
350+
351+ mPool .release (moreArgs );
318352 mPool .release (args );
319353
320354 List <AccessibilityNodeInfo > infos = null ;
@@ -375,9 +409,9 @@ private void findAccessibilityNodeInfosByTextUiThread(Message message) {
375409 }
376410 }
377411
378- public void findFocusClientThread (long accessibilityNodeId , int focusType , int interactionId ,
379- IAccessibilityInteractionConnectionCallback callback , int flags , int interogatingPid ,
380- long interrogatingTid ) {
412+ public void findFocusClientThread (long accessibilityNodeId , int focusType , int windowLeft ,
413+ int windowTop , int interactionId , IAccessibilityInteractionConnectionCallback callback ,
414+ int flags , int interogatingPid , long interrogatingTid ) {
381415 Message message = mHandler .obtainMessage ();
382416 message .what = PrivateHandler .MSG_FIND_FOCUS ;
383417 message .arg1 = flags ;
@@ -389,6 +423,11 @@ public void findFocusClientThread(long accessibilityNodeId, int focusType, int i
389423 args .argi3 = AccessibilityNodeInfo .getVirtualDescendantId (accessibilityNodeId );
390424 args .arg1 = callback ;
391425
426+ SomeArgs moreArgs = mPool .acquire ();
427+ moreArgs .argi1 = windowLeft ;
428+ moreArgs .argi2 = windowTop ;
429+ args .arg2 = moreArgs ;
430+
392431 message .obj = args ;
393432
394433 // If the interrogation is performed by the same thread as the main UI
@@ -414,6 +453,11 @@ private void findFocusUiThread(Message message) {
414453 final IAccessibilityInteractionConnectionCallback callback =
415454 (IAccessibilityInteractionConnectionCallback ) args .arg1 ;
416455
456+ SomeArgs moreArgs = (SomeArgs ) args .arg2 ;
457+ mViewRootImpl .mAttachInfo .mActualWindowLeft = moreArgs .argi1 ;
458+ mViewRootImpl .mAttachInfo .mActualWindowTop = moreArgs .argi2 ;
459+
460+ mPool .release (moreArgs );
417461 mPool .release (args );
418462
419463 AccessibilityNodeInfo focused = null ;
@@ -472,9 +516,9 @@ private void findFocusUiThread(Message message) {
472516 }
473517 }
474518
475- public void focusSearchClientThread (long accessibilityNodeId , int direction , int interactionId ,
476- IAccessibilityInteractionConnectionCallback callback , int flags , int interogatingPid ,
477- long interrogatingTid ) {
519+ public void focusSearchClientThread (long accessibilityNodeId , int direction , int windowLeft ,
520+ int windowTop , int interactionId , IAccessibilityInteractionConnectionCallback callback ,
521+ int flags , int interogatingPid , long interrogatingTid ) {
478522 Message message = mHandler .obtainMessage ();
479523 message .what = PrivateHandler .MSG_FOCUS_SEARCH ;
480524 message .arg1 = flags ;
@@ -486,6 +530,11 @@ public void focusSearchClientThread(long accessibilityNodeId, int direction, int
486530 args .argi3 = interactionId ;
487531 args .arg1 = callback ;
488532
533+ SomeArgs moreArgs = mPool .acquire ();
534+ moreArgs .argi1 = windowLeft ;
535+ moreArgs .argi2 = windowTop ;
536+ args .arg2 = moreArgs ;
537+
489538 message .obj = args ;
490539
491540 // If the interrogation is performed by the same thread as the main UI
@@ -511,6 +560,11 @@ private void focusSearchUiThread(Message message) {
511560 final IAccessibilityInteractionConnectionCallback callback =
512561 (IAccessibilityInteractionConnectionCallback ) args .arg1 ;
513562
563+ SomeArgs moreArgs = (SomeArgs ) args .arg2 ;
564+ mViewRootImpl .mAttachInfo .mActualWindowLeft = moreArgs .argi1 ;
565+ mViewRootImpl .mAttachInfo .mActualWindowTop = moreArgs .argi2 ;
566+
567+ mPool .release (moreArgs );
514568 mPool .release (args );
515569
516570 AccessibilityNodeInfo next = null ;
0 commit comments