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

Commit 0e8a37a2 authored by Caitlin Shkuratov's avatar Caitlin Shkuratov Committed by Android (Google) Code Review
Browse files

Merge "[CS] Have classes call ScreenPinningRequest directly, not through CS." into main

parents 9fee1a19 250f6f1a
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@ import com.android.systemui.mediaprojection.taskswitcher.MediaProjectionTaskSwit
import com.android.systemui.power.PowerUI
import com.android.systemui.reardisplay.RearDisplayDialogController
import com.android.systemui.recents.Recents
import com.android.systemui.recents.ScreenPinningRequest
import com.android.systemui.settings.dagger.MultiUserUtilsModule
import com.android.systemui.shortcut.ShortcutKeyDispatcher
import com.android.systemui.statusbar.ImmersiveModeConfirmation
@@ -366,4 +367,9 @@ abstract class SystemUICoreStartableModule {
    @IntoMap
    @ClassKey(KeyguardDismissBinder::class)
    abstract fun bindKeyguardDismissBinder(impl: KeyguardDismissBinder): CoreStartable

    @Binds
    @IntoMap
    @ClassKey(ScreenPinningRequest::class)
    abstract fun bindScreenPinningRequest(impl: ScreenPinningRequest): CoreStartable
}
+4 −3
Original line number Diff line number Diff line
@@ -151,6 +151,7 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
    private SysUiState mSysUiState;
    private final Handler mHandler;
    private final Lazy<NavigationBarController> mNavBarControllerLazy;
    private final ScreenPinningRequest mScreenPinningRequest;
    private final NotificationShadeWindowController mStatusBarWinController;
    private final Provider<SceneInteractor> mSceneInteractor;

@@ -185,9 +186,7 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
        @Override
        public void startScreenPinning(int taskId) {
            verifyCallerAndClearCallingIdentityPostMain("startScreenPinning", () ->
                    mCentralSurfacesOptionalLazy.get().ifPresent(
                            statusBar -> statusBar.showScreenPinningRequest(taskId,
                                    false /* allowCancel */)));
                    mScreenPinningRequest.showPrompt(taskId, false /* allowCancel */));
        }

        @Override
@@ -572,6 +571,7 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
            Lazy<NavigationBarController> navBarControllerLazy,
            Lazy<Optional<CentralSurfaces>> centralSurfacesOptionalLazy,
            Lazy<ShadeViewController> shadeViewControllerLazy,
            ScreenPinningRequest screenPinningRequest,
            NavigationModeController navModeController,
            NotificationShadeWindowController statusBarWinController,
            SysUiState sysUiState,
@@ -601,6 +601,7 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
        mShadeViewControllerLazy = shadeViewControllerLazy;
        mHandler = new Handler();
        mNavBarControllerLazy = navBarControllerLazy;
        mScreenPinningRequest = screenPinningRequest;
        mStatusBarWinController = statusBarWinController;
        mSceneInteractor = sceneInteractor;
        mUserTracker = userTracker;
+9 −2
Original line number Diff line number Diff line
@@ -53,8 +53,10 @@ import android.widget.TextView;

import androidx.annotation.NonNull;

import com.android.systemui.CoreStartable;
import com.android.systemui.R;
import com.android.systemui.broadcast.BroadcastDispatcher;
import com.android.systemui.dagger.SysUISingleton;
import com.android.systemui.navigationbar.NavigationBarView;
import com.android.systemui.navigationbar.NavigationModeController;
import com.android.systemui.settings.UserTracker;
@@ -69,8 +71,9 @@ import javax.inject.Inject;

import dagger.Lazy;

@SysUISingleton
public class ScreenPinningRequest implements View.OnClickListener,
        NavigationModeController.ModeChangedListener {
        NavigationModeController.ModeChangedListener, CoreStartable {
    private static final String TAG = "ScreenPinningRequest";

    private final Context mContext;
@@ -113,6 +116,9 @@ public class ScreenPinningRequest implements View.OnClickListener,
        mUserTracker = userTracker;
    }

    @Override
    public void start() {}

    public void clearPrompt() {
        if (mRequestWindow != null) {
            mWindowManager.removeView(mRequestWindow);
@@ -144,7 +150,8 @@ public class ScreenPinningRequest implements View.OnClickListener,
        mNavBarMode = mode;
    }

    public void onConfigurationChanged() {
    @Override
    public void onConfigurationChanged(Configuration newConfig) {
        if (mRequestWindow != null) {
            mRequestWindow.onConfigurationChanged();
        }
+0 −2
Original line number Diff line number Diff line
@@ -269,8 +269,6 @@ public interface CentralSurfaces extends Dumpable, LifecycleOwner {

    boolean isScreenFullyOff();

    void showScreenPinningRequest(int taskId, boolean allowCancel);

    @Nullable
    Intent getEmergencyActionIntent();

+5 −1
Original line number Diff line number Diff line
@@ -59,6 +59,7 @@ import com.android.systemui.keyguard.WakefulnessLifecycle;
import com.android.systemui.plugins.ActivityStarter;
import com.android.systemui.qs.QSHost;
import com.android.systemui.qs.QSPanelController;
import com.android.systemui.recents.ScreenPinningRequest;
import com.android.systemui.settings.UserTracker;
import com.android.systemui.shade.CameraLauncher;
import com.android.systemui.shade.QuickSettingsController;
@@ -84,6 +85,7 @@ import javax.inject.Inject;
public class CentralSurfacesCommandQueueCallbacks implements CommandQueue.Callbacks {
    private final CentralSurfaces mCentralSurfaces;
    private final Context mContext;
    private final ScreenPinningRequest mScreenPinningRequest;
    private final com.android.systemui.shade.ShadeController mShadeController;
    private final CommandQueue mCommandQueue;
    private final ShadeViewController mShadeViewController;
@@ -126,6 +128,7 @@ public class CentralSurfacesCommandQueueCallbacks implements CommandQueue.Callba
            QuickSettingsController quickSettingsController,
            Context context,
            @Main Resources resources,
            ScreenPinningRequest screenPinningRequest,
            ShadeController shadeController,
            CommandQueue commandQueue,
            ShadeViewController shadeViewController,
@@ -155,6 +158,7 @@ public class CentralSurfacesCommandQueueCallbacks implements CommandQueue.Callba
        mCentralSurfaces = centralSurfaces;
        mQsController = quickSettingsController;
        mContext = context;
        mScreenPinningRequest = screenPinningRequest;
        mShadeController = shadeController;
        mCommandQueue = commandQueue;
        mShadeViewController = shadeViewController;
@@ -516,7 +520,7 @@ public class CentralSurfacesCommandQueueCallbacks implements CommandQueue.Callba
            return;
        }
        // Show screen pinning request, since this comes from an app, show 'no thanks', button.
        mCentralSurfaces.showScreenPinningRequest(taskId, true);
        mScreenPinningRequest.showPrompt(taskId, true);
    }

    @Override
Loading