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

Commit fbd069e3 authored by Dave Mankoff's avatar Dave Mankoff
Browse files

Make CentralSurfaces an Interface.

CentralSurfaces is now an interface. It is a very large and ugly one.
This allows us to remove the provider in StatusBarPhoneModule, and
will make it easier to control how the Optional for CentralSurfaces
is setup.

It is renamed CentralSurfacesInt temporarily to allow maintenance of
the blame and history of CentralSurfaces in CentralSurfacesImpl.

Bug: 229228871
Test: atest SystemUITests && manual
Change-Id: Iab41b70e0c65d75560010d961dcb52a11fd237f5
Merged-In: Iab41b70e0c65d75560010d961dcb52a11fd237f5
parent b5e24da9
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -3,7 +3,7 @@


-keep class com.android.systemui.recents.OverviewProxyRecentsImpl
-keep class com.android.systemui.recents.OverviewProxyRecentsImpl
-keep class com.android.systemui.statusbar.car.CarStatusBar
-keep class com.android.systemui.statusbar.car.CarStatusBar
-keep class com.android.systemui.statusbar.phone.CentralSurfaces
-keep class com.android.systemui.statusbar.phone.CentralSurfacesInt
-keep class com.android.systemui.statusbar.tv.TvStatusBar
-keep class com.android.systemui.statusbar.tv.TvStatusBar
-keep class com.android.systemui.car.CarSystemUIFactory
-keep class com.android.systemui.car.CarSystemUIFactory
-keep class com.android.systemui.SystemUIFactory
-keep class com.android.systemui.SystemUIFactory
+2 −2
Original line number Original line Diff line number Diff line
@@ -24,7 +24,7 @@ import androidx.annotation.Nullable;


import com.android.systemui.keyguard.KeyguardViewMediator;
import com.android.systemui.keyguard.KeyguardViewMediator;
import com.android.systemui.statusbar.phone.BiometricUnlockController;
import com.android.systemui.statusbar.phone.BiometricUnlockController;
import com.android.systemui.statusbar.phone.CentralSurfaces;
import com.android.systemui.statusbar.phone.CentralSurfacesInt;
import com.android.systemui.statusbar.phone.KeyguardBypassController;
import com.android.systemui.statusbar.phone.KeyguardBypassController;
import com.android.systemui.statusbar.phone.NotificationPanelViewController;
import com.android.systemui.statusbar.phone.NotificationPanelViewController;
import com.android.systemui.statusbar.phone.panelstate.PanelExpansionStateManager;
import com.android.systemui.statusbar.phone.panelstate.PanelExpansionStateManager;
@@ -183,7 +183,7 @@ public interface KeyguardViewController {
    /**
    /**
     * Registers the CentralSurfaces to which this Keyguard View is mounted.
     * Registers the CentralSurfaces to which this Keyguard View is mounted.
     */
     */
    void registerCentralSurfaces(CentralSurfaces centralSurfaces,
    void registerCentralSurfaces(CentralSurfacesInt centralSurfaces,
            NotificationPanelViewController notificationPanelViewController,
            NotificationPanelViewController notificationPanelViewController,
            @Nullable PanelExpansionStateManager panelExpansionStateManager,
            @Nullable PanelExpansionStateManager panelExpansionStateManager,
            BiometricUnlockController biometricUnlockController,
            BiometricUnlockController biometricUnlockController,
+3 −3
Original line number Original line Diff line number Diff line
@@ -24,7 +24,7 @@ import androidx.annotation.Nullable;
import com.android.systemui.animation.ActivityLaunchAnimator;
import com.android.systemui.animation.ActivityLaunchAnimator;
import com.android.systemui.dagger.SysUISingleton;
import com.android.systemui.dagger.SysUISingleton;
import com.android.systemui.plugins.ActivityStarter;
import com.android.systemui.plugins.ActivityStarter;
import com.android.systemui.statusbar.phone.CentralSurfaces;
import com.android.systemui.statusbar.phone.CentralSurfacesInt;


import java.util.Optional;
import java.util.Optional;


@@ -40,10 +40,10 @@ import dagger.Lazy;
@SysUISingleton
@SysUISingleton
public class ActivityStarterDelegate implements ActivityStarter {
public class ActivityStarterDelegate implements ActivityStarter {


    private Lazy<Optional<CentralSurfaces>> mActualStarterOptionalLazy;
    private Lazy<Optional<CentralSurfacesInt>> mActualStarterOptionalLazy;


    @Inject
    @Inject
    public ActivityStarterDelegate(Lazy<Optional<CentralSurfaces>> centralSurfacesOptionalLazy) {
    public ActivityStarterDelegate(Lazy<Optional<CentralSurfacesInt>> centralSurfacesOptionalLazy) {
        mActualStarterOptionalLazy = centralSurfacesOptionalLazy;
        mActualStarterOptionalLazy = centralSurfacesOptionalLazy;
    }
    }


+6 −6
Original line number Original line Diff line number Diff line
@@ -54,7 +54,7 @@ import com.android.systemui.dagger.SysUISingleton;
import com.android.systemui.recents.Recents;
import com.android.systemui.recents.Recents;
import com.android.systemui.statusbar.CommandQueue;
import com.android.systemui.statusbar.CommandQueue;
import com.android.systemui.statusbar.NotificationShadeWindowController;
import com.android.systemui.statusbar.NotificationShadeWindowController;
import com.android.systemui.statusbar.phone.CentralSurfaces;
import com.android.systemui.statusbar.phone.CentralSurfacesInt;
import com.android.systemui.statusbar.phone.StatusBarWindowCallback;
import com.android.systemui.statusbar.phone.StatusBarWindowCallback;
import com.android.systemui.util.Assert;
import com.android.systemui.util.Assert;


@@ -180,7 +180,7 @@ public class SystemActions extends CoreStartable {
    private final Optional<Recents> mRecentsOptional;
    private final Optional<Recents> mRecentsOptional;
    private Locale mLocale;
    private Locale mLocale;
    private final AccessibilityManager mA11yManager;
    private final AccessibilityManager mA11yManager;
    private final Lazy<Optional<CentralSurfaces>> mCentralSurfacesOptionalLazy;
    private final Lazy<Optional<CentralSurfacesInt>> mCentralSurfacesOptionalLazy;
    private final NotificationShadeWindowController mNotificationShadeController;
    private final NotificationShadeWindowController mNotificationShadeController;
    private final StatusBarWindowCallback mNotificationShadeCallback;
    private final StatusBarWindowCallback mNotificationShadeCallback;
    private boolean mDismissNotificationShadeActionRegistered;
    private boolean mDismissNotificationShadeActionRegistered;
@@ -188,7 +188,7 @@ public class SystemActions extends CoreStartable {
    @Inject
    @Inject
    public SystemActions(Context context,
    public SystemActions(Context context,
            NotificationShadeWindowController notificationShadeController,
            NotificationShadeWindowController notificationShadeController,
            Lazy<Optional<CentralSurfaces>> centralSurfacesOptionalLazy,
            Lazy<Optional<CentralSurfacesInt>> centralSurfacesOptionalLazy,
            Optional<Recents> recentsOptional) {
            Optional<Recents> recentsOptional) {
        super(context);
        super(context);
        mRecentsOptional = recentsOptional;
        mRecentsOptional = recentsOptional;
@@ -311,9 +311,9 @@ public class SystemActions extends CoreStartable {


        // Saving state in instance variable since this callback is called quite often to avoid
        // Saving state in instance variable since this callback is called quite often to avoid
        // binder calls
        // binder calls
        final Optional<CentralSurfaces> centralSurfacesOptional =
        final Optional<CentralSurfacesInt> centralSurfacesOptional =
                mCentralSurfacesOptionalLazy.get();
                mCentralSurfacesOptionalLazy.get();
        if (centralSurfacesOptional.map(CentralSurfaces::isPanelExpanded).orElse(false)
        if (centralSurfacesOptional.map(CentralSurfacesInt::isPanelExpanded).orElse(false)
                && !centralSurfacesOptional.get().isKeyguardShowing()) {
                && !centralSurfacesOptional.get().isKeyguardShowing()) {
            if (!mDismissNotificationShadeActionRegistered) {
            if (!mDismissNotificationShadeActionRegistered) {
                mA11yManager.registerSystemAction(
                mA11yManager.registerSystemAction(
@@ -467,7 +467,7 @@ public class SystemActions extends CoreStartable {
    }
    }


    private void handleNotifications() {
    private void handleNotifications() {
        mCentralSurfacesOptionalLazy.get().ifPresent(CentralSurfaces::animateExpandNotificationsPanel);
        mCentralSurfacesOptionalLazy.get().ifPresent(CentralSurfacesInt::animateExpandNotificationsPanel);
    }
    }


    private void handleQuickSettings() {
    private void handleQuickSettings() {
+4 −4
Original line number Original line Diff line number Diff line
@@ -36,7 +36,7 @@ import com.android.systemui.shared.system.PackageManagerWrapper;
import com.android.systemui.shared.system.TaskStackChangeListener;
import com.android.systemui.shared.system.TaskStackChangeListener;
import com.android.systemui.shared.system.TaskStackChangeListeners;
import com.android.systemui.shared.system.TaskStackChangeListeners;
import com.android.systemui.statusbar.StatusBarState;
import com.android.systemui.statusbar.StatusBarState;
import com.android.systemui.statusbar.phone.CentralSurfaces;
import com.android.systemui.statusbar.phone.CentralSurfacesInt;


import java.util.ArrayList;
import java.util.ArrayList;
import java.util.List;
import java.util.List;
@@ -69,7 +69,7 @@ public final class PhoneStateMonitor {
    };
    };


    private final Context mContext;
    private final Context mContext;
    private final Lazy<Optional<CentralSurfaces>> mCentralSurfacesOptionalLazy;
    private final Lazy<Optional<CentralSurfacesInt>> mCentralSurfacesOptionalLazy;
    private final StatusBarStateController mStatusBarStateController;
    private final StatusBarStateController mStatusBarStateController;


    private boolean mLauncherShowing;
    private boolean mLauncherShowing;
@@ -77,7 +77,7 @@ public final class PhoneStateMonitor {


    @Inject
    @Inject
    PhoneStateMonitor(Context context, BroadcastDispatcher broadcastDispatcher,
    PhoneStateMonitor(Context context, BroadcastDispatcher broadcastDispatcher,
            Lazy<Optional<CentralSurfaces>> centralSurfacesOptionalLazy,
            Lazy<Optional<CentralSurfacesInt>> centralSurfacesOptionalLazy,
            BootCompleteCache bootCompleteCache,
            BootCompleteCache bootCompleteCache,
            StatusBarStateController statusBarStateController) {
            StatusBarStateController statusBarStateController) {
        mContext = context;
        mContext = context;
@@ -182,7 +182,7 @@ public final class PhoneStateMonitor {


    private boolean isBouncerShowing() {
    private boolean isBouncerShowing() {
        return mCentralSurfacesOptionalLazy.get()
        return mCentralSurfacesOptionalLazy.get()
                .map(CentralSurfaces::isBouncerShowing).orElse(false);
                .map(CentralSurfacesInt::isBouncerShowing).orElse(false);
    }
    }


    private boolean isKeyguardLocked() {
    private boolean isKeyguardLocked() {
Loading