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

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

Merge changes I614fdc8d,I2e56ef71,Ic736fc76,If47c1138,I1f2a3ef0 into main

* changes:
  [CS] Remove CentralSurfaces from SystemActions.
  [CS] Remove CentralSurfaces#isKeyguardShowing.
  [CS] Remove CS#isKeyguardShowing from OverviewProxyRecentsImpl.
  [CS] Remove CS#isKeyguardShowing from SystemActions.
  [CS] Update NavBar to call KeyguardStateController not CentralSurfaces.
parents 322ea4c9 7672f59b
Loading
Loading
Loading
Loading
+8 −14
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@
package com.android.systemui.accessibility;

import static android.view.WindowManager.ScreenshotSource.SCREENSHOT_ACCESSIBILITY_ACTIONS;

import static com.android.internal.accessibility.common.ShortcutConstants.CHOOSER_PACKAGE_NAME;

import android.accessibilityservice.AccessibilityService;
@@ -57,8 +56,8 @@ import com.android.systemui.shade.ShadeController;
import com.android.systemui.shade.ShadeViewController;
import com.android.systemui.statusbar.CommandQueue;
import com.android.systemui.statusbar.NotificationShadeWindowController;
import com.android.systemui.statusbar.phone.CentralSurfaces;
import com.android.systemui.statusbar.phone.StatusBarWindowCallback;
import com.android.systemui.statusbar.policy.KeyguardStateController;
import com.android.systemui.util.Assert;

import dagger.Lazy;
@@ -186,8 +185,8 @@ public class SystemActions implements CoreStartable {
    private final DisplayTracker mDisplayTracker;
    private Locale mLocale;
    private final AccessibilityManager mA11yManager;
    private final Lazy<Optional<CentralSurfaces>> mCentralSurfacesOptionalLazy;
    private final NotificationShadeWindowController mNotificationShadeController;
    private final KeyguardStateController mKeyguardStateController;
    private final ShadeController mShadeController;
    private final Lazy<ShadeViewController> mShadeViewController;
    private final StatusBarWindowCallback mNotificationShadeCallback;
@@ -197,13 +196,14 @@ public class SystemActions implements CoreStartable {
    public SystemActions(Context context,
            UserTracker userTracker,
            NotificationShadeWindowController notificationShadeController,
            KeyguardStateController keyguardStateController,
            ShadeController shadeController,
            Lazy<ShadeViewController> shadeViewController,
            Lazy<Optional<CentralSurfaces>> centralSurfacesOptionalLazy,
            Optional<Recents> recentsOptional,
            DisplayTracker displayTracker) {
        mContext = context;
        mUserTracker = userTracker;
        mKeyguardStateController = keyguardStateController;
        mShadeController = shadeController;
        mShadeViewController = shadeViewController;
        mRecentsOptional = recentsOptional;
@@ -219,7 +219,6 @@ public class SystemActions implements CoreStartable {
                (keyguardShowing, keyguardOccluded, keyguardGoingAway, bouncerShowing, mDozing,
                        panelExpanded, isDreaming) ->
                        registerOrUnregisterDismissNotificationShadeAction();
        mCentralSurfacesOptionalLazy = centralSurfacesOptionalLazy;
    }

    @Override
@@ -307,8 +306,8 @@ public class SystemActions implements CoreStartable {
        mA11yManager.registerSystemAction(actionBack, SYSTEM_ACTION_ID_BACK);
        mA11yManager.registerSystemAction(actionHome, SYSTEM_ACTION_ID_HOME);
        mA11yManager.registerSystemAction(actionRecents, SYSTEM_ACTION_ID_RECENTS);
        if (mCentralSurfacesOptionalLazy.get().isPresent()) {
            // These two actions require the CentralSurfaces instance.
        if (mShadeController.isShadeEnabled()) {
            // These two actions require the shade to be enabled.
            mA11yManager.registerSystemAction(actionNotifications, SYSTEM_ACTION_ID_NOTIFICATIONS);
            mA11yManager.registerSystemAction(actionQuickSettings, SYSTEM_ACTION_ID_QUICK_SETTINGS);
        }
@@ -329,13 +328,8 @@ public class SystemActions implements CoreStartable {
    private void registerOrUnregisterDismissNotificationShadeAction() {
        Assert.isMainThread();

        // Saving state in instance variable since this callback is called quite often to avoid
        // binder calls
        final Optional<CentralSurfaces> centralSurfacesOptional =
                mCentralSurfacesOptionalLazy.get();
        if (centralSurfacesOptional.isPresent()
                && mShadeViewController.get().isPanelExpanded()
                && !centralSurfacesOptional.get().isKeyguardShowing()) {
        if (mShadeViewController.get().isPanelExpanded()
                && !mKeyguardStateController.isShowing()) {
            if (!mDismissNotificationShadeActionRegistered) {
                mA11yManager.registerSystemAction(
                        createRemoteAction(
+6 −7
Original line number Diff line number Diff line
@@ -133,7 +133,6 @@ import com.android.systemui.recents.Recents;
import com.android.systemui.settings.DisplayTracker;
import com.android.systemui.settings.UserContextProvider;
import com.android.systemui.settings.UserTracker;
import com.android.systemui.shade.ShadeController;
import com.android.systemui.shade.ShadeViewController;
import com.android.systemui.shared.navigationbar.RegionSamplingHelper;
import com.android.systemui.shared.recents.utilities.Utilities;
@@ -156,6 +155,7 @@ import com.android.systemui.statusbar.phone.CentralSurfaces;
import com.android.systemui.statusbar.phone.LightBarController;
import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager;
import com.android.systemui.statusbar.policy.DeviceProvisionedController;
import com.android.systemui.statusbar.policy.KeyguardStateController;
import com.android.systemui.util.DeviceConfigProxy;
import com.android.systemui.util.ViewController;
import com.android.wm.shell.back.BackAnimation;
@@ -200,7 +200,7 @@ public class NavigationBar extends ViewController<NavigationBarView> implements
    private final StatusBarKeyguardViewManager mStatusBarKeyguardViewManager;
    private final SysUiState mSysUiFlagsContainer;
    private final Lazy<Optional<CentralSurfaces>> mCentralSurfacesOptionalLazy;
    private final ShadeController mShadeController;
    private final KeyguardStateController mKeyguardStateController;
    private final ShadeViewController mShadeViewController;
    private final NotificationRemoteInputManager mNotificationRemoteInputManager;
    private final OverviewProxyService mOverviewProxyService;
@@ -262,7 +262,7 @@ public class NavigationBar extends ViewController<NavigationBarView> implements
    @VisibleForTesting
    public int mDisplayId;
    private boolean mIsOnDefaultDisplay;
    public boolean mHomeBlockedThisTouch;
    private boolean mHomeBlockedThisTouch;

    /**
     * When user is QuickSwitching between apps of different orientations, we'll draw a fake
@@ -531,7 +531,6 @@ public class NavigationBar extends ViewController<NavigationBarView> implements
    @Inject
    NavigationBar(
            NavigationBarView navigationBarView,
            ShadeController shadeController,
            NavigationBarFrame navigationBarFrame,
            @Nullable Bundle savedState,
            @DisplayId Context context,
@@ -550,6 +549,7 @@ public class NavigationBar extends ViewController<NavigationBarView> implements
            Optional<Pip> pipOptional,
            Optional<Recents> recentsOptional,
            Lazy<Optional<CentralSurfaces>> centralSurfacesOptionalLazy,
            KeyguardStateController keyguardStateController,
            ShadeViewController shadeViewController,
            NotificationRemoteInputManager notificationRemoteInputManager,
            NotificationShadeDepthController notificationShadeDepthController,
@@ -585,7 +585,7 @@ public class NavigationBar extends ViewController<NavigationBarView> implements
        mStatusBarKeyguardViewManager = statusBarKeyguardViewManager;
        mSysUiFlagsContainer = sysUiFlagsContainer;
        mCentralSurfacesOptionalLazy = centralSurfacesOptionalLazy;
        mShadeController = shadeController;
        mKeyguardStateController = keyguardStateController;
        mShadeViewController = shadeViewController;
        mNotificationRemoteInputManager = notificationRemoteInputManager;
        mOverviewProxyService = overviewProxyService;
@@ -1326,8 +1326,7 @@ public class NavigationBar extends ViewController<NavigationBarView> implements
                mHomeBlockedThisTouch = false;
                if (mTelecomManagerOptional.isPresent()
                        && mTelecomManagerOptional.get().isRinging()) {
                    if (centralSurfacesOptional.map(CentralSurfaces::isKeyguardShowing)
                            .orElse(false)) {
                    if (mKeyguardStateController.isShowing()) {
                        Log.i(TAG, "Ignoring HOME; there's a ringing incoming call. " +
                                "No heads up");
                        mHomeBlockedThisTouch = true;
+8 −15
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@

package com.android.systemui.recents;

import android.annotation.Nullable;
import android.content.Context;
import android.os.Handler;
import android.os.RemoteException;
@@ -25,11 +24,7 @@ import android.util.Log;
import com.android.systemui.dagger.SysUISingleton;
import com.android.systemui.plugins.ActivityStarter;
import com.android.systemui.shared.recents.IOverviewProxy;
import com.android.systemui.statusbar.phone.CentralSurfaces;

import dagger.Lazy;

import java.util.Optional;
import com.android.systemui.statusbar.policy.KeyguardStateController;

import javax.inject.Inject;

@@ -40,20 +35,20 @@ import javax.inject.Inject;
public class OverviewProxyRecentsImpl implements RecentsImplementation {

    private final static String TAG = "OverviewProxyRecentsImpl";
    @Nullable
    private final Lazy<Optional<CentralSurfaces>> mCentralSurfacesOptionalLazy;

    private Handler mHandler;
    private final OverviewProxyService mOverviewProxyService;
    private final ActivityStarter mActivityStarter;
    private final KeyguardStateController mKeyguardStateController;

    @SuppressWarnings("OptionalUsedAsFieldOrParameterType")
    @Inject
    public OverviewProxyRecentsImpl(Lazy<Optional<CentralSurfaces>> centralSurfacesOptionalLazy,
            OverviewProxyService overviewProxyService, ActivityStarter activityStarter) {
        mCentralSurfacesOptionalLazy = centralSurfacesOptionalLazy;
    public OverviewProxyRecentsImpl(
            OverviewProxyService overviewProxyService,
            ActivityStarter activityStarter,
            KeyguardStateController keyguardStateController) {
        mOverviewProxyService = overviewProxyService;
        mActivityStarter = activityStarter;
        mKeyguardStateController = keyguardStateController;
    }

    @Override
@@ -101,9 +96,7 @@ public class OverviewProxyRecentsImpl implements RecentsImplementation {
                }
            };
            // Preload only if device for current user is unlocked
            final Optional<CentralSurfaces> centralSurfacesOptional =
                    mCentralSurfacesOptionalLazy.get();
            if (centralSurfacesOptional.map(CentralSurfaces::isKeyguardShowing).orElse(false)) {
            if (mKeyguardStateController.isShowing()) {
                mActivityStarter.executeRunnableDismissingKeyguard(
                        () -> mHandler.post(toggleRecents), null, true /* dismissShade */,
                        false /* afterKeyguardGone */,
+2 −0
Original line number Diff line number Diff line
@@ -33,6 +33,8 @@ import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager;
 * {@link com.android.systemui.keyguard.KeyguardViewMediator} and others.
 */
public interface ShadeController extends CoreStartable {
    /** True if the shade UI is enabled on this particular Android variant and false otherwise. */
    boolean isShadeEnabled();

    /** Make our window larger and the shade expanded */
    void instantExpandShade();
+1 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import javax.inject.Inject
/** Empty implementation of ShadeController for variants of Android without shades. */
@SysUISingleton
open class ShadeControllerEmptyImpl @Inject constructor() : ShadeController {
    override fun isShadeEnabled() = false
    override fun start() {}
    override fun instantExpandShade() {}
    override fun instantCollapseShade() {}
Loading