diff options
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/recents/ScreenPinningRequest.java | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/recents/ScreenPinningRequest.java b/packages/SystemUI/src/com/android/systemui/recents/ScreenPinningRequest.java index 8d0a386bc3b0..432a35a1a3dd 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/ScreenPinningRequest.java +++ b/packages/SystemUI/src/com/android/systemui/recents/ScreenPinningRequest.java @@ -16,7 +16,9 @@ package com.android.systemui.recents; +import static com.android.systemui.Flags.enableViewCaptureTracing; import static com.android.systemui.shared.recents.utilities.Utilities.isLargeScreen; +import static com.android.systemui.util.ConvenienceExtensionsKt.toKotlinLazy; import static com.android.systemui.util.leak.RotationUtils.ROTATION_LANDSCAPE; import static com.android.systemui.util.leak.RotationUtils.ROTATION_NONE; import static com.android.systemui.util.leak.RotationUtils.ROTATION_SEASCAPE; @@ -53,6 +55,8 @@ import android.widget.TextView; import androidx.annotation.NonNull; +import com.android.app.viewcapture.ViewCapture; +import com.android.app.viewcapture.ViewCaptureAwareWindowManager; import com.android.systemui.CoreStartable; import com.android.systemui.broadcast.BroadcastDispatcher; import com.android.systemui.dagger.SysUISingleton; @@ -83,6 +87,7 @@ public class ScreenPinningRequest implements private final Lazy<NavigationBarController> mNavigationBarControllerLazy; private final AccessibilityManager mAccessibilityService; private final WindowManager mWindowManager; + private final ViewCaptureAwareWindowManager mViewCaptureAwareWindowManager; private final BroadcastDispatcher mBroadcastDispatcher; private final UserTracker mUserTracker; @@ -106,13 +111,16 @@ public class ScreenPinningRequest implements NavigationModeController navigationModeController, Lazy<NavigationBarController> navigationBarControllerLazy, BroadcastDispatcher broadcastDispatcher, - UserTracker userTracker) { + UserTracker userTracker, + Lazy<ViewCapture> daggerLazyViewCapture) { mContext = context; mNavigationBarControllerLazy = navigationBarControllerLazy; mAccessibilityService = (AccessibilityManager) mContext.getSystemService(Context.ACCESSIBILITY_SERVICE); mWindowManager = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE); + mViewCaptureAwareWindowManager = new ViewCaptureAwareWindowManager(mWindowManager, + toKotlinLazy(daggerLazyViewCapture), enableViewCaptureTracing()); mNavBarMode = navigationModeController.addListener(this); mBroadcastDispatcher = broadcastDispatcher; mUserTracker = userTracker; @@ -123,7 +131,7 @@ public class ScreenPinningRequest implements public void clearPrompt() { if (mRequestWindow != null) { - mWindowManager.removeView(mRequestWindow); + mViewCaptureAwareWindowManager.removeView(mRequestWindow); mRequestWindow = null; } } @@ -144,7 +152,7 @@ public class ScreenPinningRequest implements // show the confirmation WindowManager.LayoutParams lp = getWindowLayoutParams(); - mWindowManager.addView(mRequestWindow, lp); + mViewCaptureAwareWindowManager.addView(mRequestWindow, lp); } @Override |