Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9ac72828 authored by Archisha Baranwal's avatar Archisha Baranwal Committed by Android (Google) Code Review
Browse files

Merge "Adding ViewCaptureAwareWindowManager to ScreenPinningRequest window." into main

parents 9f94e49d 2bf46f69
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -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