Loading packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotController.java +16 −7 Original line number Diff line number Diff line Loading @@ -554,16 +554,15 @@ public class ScreenshotController { // Wait until this window is attached to request because it is // the reference used to locate the target window (below). withWindowAttached(() -> { mScrollCaptureClient.setHostWindowToken(mWindow.getDecorView().getWindowToken()); if (mLastScrollCaptureRequest != null) { mLastScrollCaptureRequest.cancel(true); } mLastScrollCaptureRequest = mScrollCaptureClient.request(DEFAULT_DISPLAY); mLastScrollCaptureRequest.addListener(() -> onScrollCaptureResponseReady(mLastScrollCaptureRequest), mMainExecutor); requestScrollCapture(); mWindow.peekDecorView().getViewRootImpl().setActivityConfigCallback( (overrideConfig, newDisplayId) -> { if (mConfigChanges.applyNewConfig(mContext.getResources())) { // Hide the scroll chip until we know it's available in this orientation mScreenshotView.hideScrollChip(); // Delay scroll capture eval a bit to allow the underlying activity // to set up in the new orientation. mScreenshotHandler.postDelayed(this::requestScrollCapture, 150); updateDisplayCutout(); } }); Loading Loading @@ -593,6 +592,16 @@ public class ScreenshotController { cancelTimeout(); // restarted after animation } private void requestScrollCapture() { mScrollCaptureClient.setHostWindowToken(mWindow.getDecorView().getWindowToken()); if (mLastScrollCaptureRequest != null) { mLastScrollCaptureRequest.cancel(true); } mLastScrollCaptureRequest = mScrollCaptureClient.request(DEFAULT_DISPLAY); mLastScrollCaptureRequest.addListener(() -> onScrollCaptureResponseReady(mLastScrollCaptureRequest), mMainExecutor); } private void onScrollCaptureResponseReady(Future<ScrollCaptureResponse> responseFuture) { try { if (mLastScrollCaptureResponse != null) { Loading packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotView.java +4 −0 Original line number Diff line number Diff line Loading @@ -204,6 +204,10 @@ public class ScreenshotView extends FrameLayout implements mSwipeDismissHandler = new SwipeDismissHandler(); } public void hideScrollChip() { mScrollChip.setVisibility(View.GONE); } /** * Called to display the scroll action chip when support is detected. * Loading Loading
packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotController.java +16 −7 Original line number Diff line number Diff line Loading @@ -554,16 +554,15 @@ public class ScreenshotController { // Wait until this window is attached to request because it is // the reference used to locate the target window (below). withWindowAttached(() -> { mScrollCaptureClient.setHostWindowToken(mWindow.getDecorView().getWindowToken()); if (mLastScrollCaptureRequest != null) { mLastScrollCaptureRequest.cancel(true); } mLastScrollCaptureRequest = mScrollCaptureClient.request(DEFAULT_DISPLAY); mLastScrollCaptureRequest.addListener(() -> onScrollCaptureResponseReady(mLastScrollCaptureRequest), mMainExecutor); requestScrollCapture(); mWindow.peekDecorView().getViewRootImpl().setActivityConfigCallback( (overrideConfig, newDisplayId) -> { if (mConfigChanges.applyNewConfig(mContext.getResources())) { // Hide the scroll chip until we know it's available in this orientation mScreenshotView.hideScrollChip(); // Delay scroll capture eval a bit to allow the underlying activity // to set up in the new orientation. mScreenshotHandler.postDelayed(this::requestScrollCapture, 150); updateDisplayCutout(); } }); Loading Loading @@ -593,6 +592,16 @@ public class ScreenshotController { cancelTimeout(); // restarted after animation } private void requestScrollCapture() { mScrollCaptureClient.setHostWindowToken(mWindow.getDecorView().getWindowToken()); if (mLastScrollCaptureRequest != null) { mLastScrollCaptureRequest.cancel(true); } mLastScrollCaptureRequest = mScrollCaptureClient.request(DEFAULT_DISPLAY); mLastScrollCaptureRequest.addListener(() -> onScrollCaptureResponseReady(mLastScrollCaptureRequest), mMainExecutor); } private void onScrollCaptureResponseReady(Future<ScrollCaptureResponse> responseFuture) { try { if (mLastScrollCaptureResponse != null) { Loading
packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotView.java +4 −0 Original line number Diff line number Diff line Loading @@ -204,6 +204,10 @@ public class ScreenshotView extends FrameLayout implements mSwipeDismissHandler = new SwipeDismissHandler(); } public void hideScrollChip() { mScrollChip.setVisibility(View.GONE); } /** * Called to display the scroll action chip when support is detected. * Loading