Loading core/java/android/view/ViewRootImpl.java +28 −5 Original line number Diff line number Diff line Loading @@ -11518,12 +11518,24 @@ public final class ViewRootImpl implements ViewParent, // Search through View-tree View rootView = getView(); if (rootView != null) { if (rootView == null) { ScrollCaptureResponse.Builder response = new ScrollCaptureResponse.Builder(); response.setWindowTitle(getTitle().toString()); response.setPackageName(mContext.getPackageName()); response.setDescription("The root view was null"); try { listener.onScrollCaptureResponse(response.build()); } catch (RemoteException e) { Log.e(TAG, "Failed to send scroll capture search result", e); } return; } Point point = new Point(); Rect rect = new Rect(0, 0, rootView.getWidth(), rootView.getHeight()); getChildVisibleRect(rootView, rect, point); rootView.dispatchScrollCaptureSearch(rect, point, results::addTarget); } Runnable onComplete = () -> dispatchScrollCaptureSearchResponse(listener, results); results.setOnCompleteListener(onComplete); if (!results.isComplete()) { Loading @@ -11548,6 +11560,16 @@ public final class ViewRootImpl implements ViewParent, pw.flush(); response.addMessage(writer.toString()); if (mView == null) { response.setDescription("The root view disappeared!"); try { listener.onScrollCaptureResponse(response.build()); } catch (RemoteException e) { Log.e(TAG, "Failed to send scroll capture search result", e); } return; } if (selectedTarget == null) { response.setDescription("No scrollable targets found in window"); try { Loading @@ -11574,6 +11596,7 @@ public final class ViewRootImpl implements ViewParent, boundsOnScreen.set(0, 0, mView.getWidth(), mView.getHeight()); boundsOnScreen.offset(mAttachInfo.mTmpLocation[0], mAttachInfo.mTmpLocation[1]); response.setWindowBounds(boundsOnScreen); Log.d(TAG, "ScrollCaptureSearchResponse: " + response); // Create a connection and return it to the caller ScrollCaptureConnection connection = new ScrollCaptureConnection( Loading Loading
core/java/android/view/ViewRootImpl.java +28 −5 Original line number Diff line number Diff line Loading @@ -11518,12 +11518,24 @@ public final class ViewRootImpl implements ViewParent, // Search through View-tree View rootView = getView(); if (rootView != null) { if (rootView == null) { ScrollCaptureResponse.Builder response = new ScrollCaptureResponse.Builder(); response.setWindowTitle(getTitle().toString()); response.setPackageName(mContext.getPackageName()); response.setDescription("The root view was null"); try { listener.onScrollCaptureResponse(response.build()); } catch (RemoteException e) { Log.e(TAG, "Failed to send scroll capture search result", e); } return; } Point point = new Point(); Rect rect = new Rect(0, 0, rootView.getWidth(), rootView.getHeight()); getChildVisibleRect(rootView, rect, point); rootView.dispatchScrollCaptureSearch(rect, point, results::addTarget); } Runnable onComplete = () -> dispatchScrollCaptureSearchResponse(listener, results); results.setOnCompleteListener(onComplete); if (!results.isComplete()) { Loading @@ -11548,6 +11560,16 @@ public final class ViewRootImpl implements ViewParent, pw.flush(); response.addMessage(writer.toString()); if (mView == null) { response.setDescription("The root view disappeared!"); try { listener.onScrollCaptureResponse(response.build()); } catch (RemoteException e) { Log.e(TAG, "Failed to send scroll capture search result", e); } return; } if (selectedTarget == null) { response.setDescription("No scrollable targets found in window"); try { Loading @@ -11574,6 +11596,7 @@ public final class ViewRootImpl implements ViewParent, boundsOnScreen.set(0, 0, mView.getWidth(), mView.getHeight()); boundsOnScreen.offset(mAttachInfo.mTmpLocation[0], mAttachInfo.mTmpLocation[1]); response.setWindowBounds(boundsOnScreen); Log.d(TAG, "ScrollCaptureSearchResponse: " + response); // Create a connection and return it to the caller ScrollCaptureConnection connection = new ScrollCaptureConnection( Loading