diff options
128 files changed, 956 insertions, 916 deletions
diff --git a/packages/SystemUI/AndroidManifest.xml b/packages/SystemUI/AndroidManifest.xml index 4b1d00bb18e3..7f8b2f51754c 100644 --- a/packages/SystemUI/AndroidManifest.xml +++ b/packages/SystemUI/AndroidManifest.xml @@ -154,7 +154,7 @@ <!-- Needed for WallpaperManager.clear in ImageWallpaper.updateWallpaperLocked --> <uses-permission android:name="android.permission.SET_WALLPAPER"/> - <!-- Needed for WallpaperManager.getWallpaperDimAmount in StatusBar.updateTheme --> + <!-- Needed for WallpaperManager.getWallpaperDimAmount in CentralSurfaces.updateTheme --> <uses-permission android:name="android.permission.SET_WALLPAPER_DIM_AMOUNT"/> <!-- Wifi Display --> diff --git a/packages/SystemUI/proguard.flags b/packages/SystemUI/proguard.flags index 6352f81b4474..c97ebe8d5559 100644 --- a/packages/SystemUI/proguard.flags +++ b/packages/SystemUI/proguard.flags @@ -3,7 +3,7 @@ -keep class com.android.systemui.recents.OverviewProxyRecentsImpl -keep class com.android.systemui.statusbar.car.CarStatusBar --keep class com.android.systemui.statusbar.phone.StatusBar +-keep class com.android.systemui.statusbar.phone.CentralSurfaces -keep class com.android.systemui.statusbar.tv.TvStatusBar -keep class com.android.systemui.car.CarSystemUIFactory -keep class com.android.systemui.SystemUIFactory diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardViewController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardViewController.java index 122f3d7f23f1..295d77d55b56 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardViewController.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardViewController.java @@ -24,9 +24,9 @@ import androidx.annotation.Nullable; import com.android.systemui.keyguard.KeyguardViewMediator; import com.android.systemui.statusbar.phone.BiometricUnlockController; +import com.android.systemui.statusbar.phone.CentralSurfaces; import com.android.systemui.statusbar.phone.KeyguardBypassController; import com.android.systemui.statusbar.phone.NotificationPanelViewController; -import com.android.systemui.statusbar.phone.StatusBar; import com.android.systemui.statusbar.phone.panelstate.PanelExpansionStateManager; /** @@ -176,9 +176,9 @@ public interface KeyguardViewController { // achieving complete abstraction away from where the Keyguard View is mounted. /** - * Registers the StatusBar to which this Keyguard View is mounted. + * Registers the CentralSurfaces to which this Keyguard View is mounted. */ - void registerStatusBar(StatusBar statusBar, + void registerCentralSurfaces(CentralSurfaces centralSurfaces, NotificationPanelViewController notificationPanelViewController, @Nullable PanelExpansionStateManager panelExpansionStateManager, BiometricUnlockController biometricUnlockController, diff --git a/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java b/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java index 4ad51835687f..370686a1e682 100644 --- a/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java +++ b/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java @@ -60,7 +60,7 @@ import com.android.systemui.plugins.FalsingManager; import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.statusbar.StatusBarState; import com.android.systemui.statusbar.VibratorHelper; -import com.android.systemui.statusbar.phone.dagger.StatusBarComponent; +import com.android.systemui.statusbar.phone.dagger.CentralSurfacesComponent; import com.android.systemui.statusbar.policy.ConfigurationController; import com.android.systemui.statusbar.policy.KeyguardStateController; import com.android.systemui.util.ViewController; @@ -78,7 +78,7 @@ import javax.inject.Inject; * For devices with UDFPS, the lock icon will show at the sensor location. Else, the lock * icon will show a set distance from the bottom of the device. */ -@StatusBarComponent.StatusBarScope +@CentralSurfacesComponent.CentralSurfacesScope public class LockIconViewController extends ViewController<LockIconView> implements Dumpable { private static final String TAG = "LockIconViewController"; private static final float sDefaultDensity = diff --git a/packages/SystemUI/src/com/android/keyguard/dagger/KeyguardBouncerScope.java b/packages/SystemUI/src/com/android/keyguard/dagger/KeyguardBouncerScope.java index 207ac2852f2f..8dbe5e00ab7e 100644 --- a/packages/SystemUI/src/com/android/keyguard/dagger/KeyguardBouncerScope.java +++ b/packages/SystemUI/src/com/android/keyguard/dagger/KeyguardBouncerScope.java @@ -24,7 +24,7 @@ import java.lang.annotation.Retention; import javax.inject.Scope; /** - * Scope annotation for singleton items within the StatusBarComponent. + * Scope annotation for singleton items within the CentralSurfacesComponent. */ @Documented @Retention(RUNTIME) diff --git a/packages/SystemUI/src/com/android/keyguard/dagger/KeyguardStatusBarViewScope.java b/packages/SystemUI/src/com/android/keyguard/dagger/KeyguardStatusBarViewScope.java index ba0642f57a88..f498ef3466ef 100644 --- a/packages/SystemUI/src/com/android/keyguard/dagger/KeyguardStatusBarViewScope.java +++ b/packages/SystemUI/src/com/android/keyguard/dagger/KeyguardStatusBarViewScope.java @@ -24,7 +24,7 @@ import java.lang.annotation.Retention; import javax.inject.Scope; /** - * Scope annotation for singleton items within the StatusBarComponent. + * Scope annotation for singleton items within the CentralSurfacesComponent. */ @Documented @Retention(RUNTIME) diff --git a/packages/SystemUI/src/com/android/keyguard/dagger/KeyguardStatusViewScope.java b/packages/SystemUI/src/com/android/keyguard/dagger/KeyguardStatusViewScope.java index 880822aa7343..aeae8e3d4b27 100644 --- a/packages/SystemUI/src/com/android/keyguard/dagger/KeyguardStatusViewScope.java +++ b/packages/SystemUI/src/com/android/keyguard/dagger/KeyguardStatusViewScope.java @@ -24,7 +24,7 @@ import java.lang.annotation.Retention; import javax.inject.Scope; /** - * Scope annotation for singleton items within the StatusBarComponent. + * Scope annotation for singleton items within the CentralSurfacesComponent. */ @Documented @Retention(RUNTIME) diff --git a/packages/SystemUI/src/com/android/systemui/ActivityStarterDelegate.java b/packages/SystemUI/src/com/android/systemui/ActivityStarterDelegate.java index cc166c210078..5bd620e873b0 100644 --- a/packages/SystemUI/src/com/android/systemui/ActivityStarterDelegate.java +++ b/packages/SystemUI/src/com/android/systemui/ActivityStarterDelegate.java @@ -23,7 +23,7 @@ import androidx.annotation.Nullable; import com.android.systemui.animation.ActivityLaunchAnimator; import com.android.systemui.dagger.SysUISingleton; import com.android.systemui.plugins.ActivityStarter; -import com.android.systemui.statusbar.phone.StatusBar; +import com.android.systemui.statusbar.phone.CentralSurfaces; import java.util.Optional; @@ -33,17 +33,17 @@ import dagger.Lazy; /** * Single common instance of ActivityStarter that can be gotten and referenced from anywhere, but - * delegates to an actual implementation (StatusBar). + * delegates to an actual implementation (CentralSurfaces). */ @SuppressWarnings("OptionalUsedAsFieldOrParameterType") @SysUISingleton public class ActivityStarterDelegate implements ActivityStarter { - private Lazy<Optional<StatusBar>> mActualStarterOptionalLazy; + private Lazy<Optional<CentralSurfaces>> mActualStarterOptionalLazy; @Inject - public ActivityStarterDelegate(Lazy<Optional<StatusBar>> statusBarOptionalLazy) { - mActualStarterOptionalLazy = statusBarOptionalLazy; + public ActivityStarterDelegate(Lazy<Optional<CentralSurfaces>> centralSurfacesOptionalLazy) { + mActualStarterOptionalLazy = centralSurfacesOptionalLazy; } @Override diff --git a/packages/SystemUI/src/com/android/systemui/accessibility/SystemActions.java b/packages/SystemUI/src/com/android/systemui/accessibility/SystemActions.java index 881e6a917a45..bd8e44ceab80 100644 --- a/packages/SystemUI/src/com/android/systemui/accessibility/SystemActions.java +++ b/packages/SystemUI/src/com/android/systemui/accessibility/SystemActions.java @@ -54,7 +54,7 @@ import com.android.systemui.dagger.SysUISingleton; import com.android.systemui.recents.Recents; import com.android.systemui.statusbar.CommandQueue; import com.android.systemui.statusbar.NotificationShadeWindowController; -import com.android.systemui.statusbar.phone.StatusBar; +import com.android.systemui.statusbar.phone.CentralSurfaces; import com.android.systemui.statusbar.phone.StatusBarWindowCallback; import com.android.systemui.util.Assert; @@ -180,7 +180,7 @@ public class SystemActions extends CoreStartable { private final Optional<Recents> mRecentsOptional; private Locale mLocale; private final AccessibilityManager mA11yManager; - private final Lazy<Optional<StatusBar>> mStatusBarOptionalLazy; + private final Lazy<Optional<CentralSurfaces>> mCentralSurfacesOptionalLazy; private final NotificationShadeWindowController mNotificationShadeController; private final StatusBarWindowCallback mNotificationShadeCallback; private boolean mDismissNotificationShadeActionRegistered; @@ -188,7 +188,7 @@ public class SystemActions extends CoreStartable { @Inject public SystemActions(Context context, NotificationShadeWindowController notificationShadeController, - Lazy<Optional<StatusBar>> statusBarOptionalLazy, + Lazy<Optional<CentralSurfaces>> centralSurfacesOptionalLazy, Optional<Recents> recentsOptional) { super(context); mRecentsOptional = recentsOptional; @@ -201,7 +201,7 @@ public class SystemActions extends CoreStartable { // NotificationShadeWindowController.registerCallback() only keeps weak references. mNotificationShadeCallback = (keyguardShowing, keyguardOccluded, bouncerShowing, mDozing) -> registerOrUnregisterDismissNotificationShadeAction(); - mStatusBarOptionalLazy = statusBarOptionalLazy; + mCentralSurfacesOptionalLazy = centralSurfacesOptionalLazy; } @Override @@ -311,9 +311,10 @@ public class SystemActions extends CoreStartable { // Saving state in instance variable since this callback is called quite often to avoid // binder calls - final Optional<StatusBar> statusBarOptional = mStatusBarOptionalLazy.get(); - if (statusBarOptional.map(StatusBar::isPanelExpanded).orElse(false) - && !statusBarOptional.get().isKeyguardShowing()) { + final Optional<CentralSurfaces> centralSurfacesOptional = + mCentralSurfacesOptionalLazy.get(); + if (centralSurfacesOptional.map(CentralSurfaces::isPanelExpanded).orElse(false) + && !centralSurfacesOptional.get().isKeyguardShowing()) { if (!mDismissNotificationShadeActionRegistered) { mA11yManager.registerSystemAction( createRemoteAction( @@ -466,12 +467,12 @@ public class SystemActions extends CoreStartable { } private void handleNotifications() { - mStatusBarOptionalLazy.get().ifPresent(StatusBar::animateExpandNotificationsPanel); + mCentralSurfacesOptionalLazy.get().ifPresent(CentralSurfaces::animateExpandNotificationsPanel); } private void handleQuickSettings() { - mStatusBarOptionalLazy.get().ifPresent( - statusBar -> statusBar.animateExpandSettingsPanel(null)); + mCentralSurfacesOptionalLazy.get().ifPresent( + centralSurfaces -> centralSurfaces.animateExpandSettingsPanel(null)); } private void handlePowerDialog() { @@ -524,8 +525,8 @@ public class SystemActions extends CoreStartable { } private void handleAccessibilityDismissNotificationShade() { - mStatusBarOptionalLazy.get().ifPresent( - statusBar -> statusBar.animateCollapsePanels( + mCentralSurfacesOptionalLazy.get().ifPresent( + centralSurfaces -> centralSurfaces.animateCollapsePanels( CommandQueue.FLAG_EXCLUDE_NONE, false /* force */)); } diff --git a/packages/SystemUI/src/com/android/systemui/assist/PhoneStateMonitor.java b/packages/SystemUI/src/com/android/systemui/assist/PhoneStateMonitor.java index aedaf968ac7d..dfff00b90ef2 100644 --- a/packages/SystemUI/src/com/android/systemui/assist/PhoneStateMonitor.java +++ b/packages/SystemUI/src/com/android/systemui/assist/PhoneStateMonitor.java @@ -36,7 +36,7 @@ import com.android.systemui.shared.system.PackageManagerWrapper; import com.android.systemui.shared.system.TaskStackChangeListener; import com.android.systemui.shared.system.TaskStackChangeListeners; import com.android.systemui.statusbar.StatusBarState; -import com.android.systemui.statusbar.phone.StatusBar; +import com.android.systemui.statusbar.phone.CentralSurfaces; import java.util.ArrayList; import java.util.List; @@ -69,7 +69,7 @@ public final class PhoneStateMonitor { }; private final Context mContext; - private final Lazy<Optional<StatusBar>> mStatusBarOptionalLazy; + private final Lazy<Optional<CentralSurfaces>> mCentralSurfacesOptionalLazy; private final StatusBarStateController mStatusBarStateController; private boolean mLauncherShowing; @@ -77,10 +77,11 @@ public final class PhoneStateMonitor { @Inject PhoneStateMonitor(Context context, BroadcastDispatcher broadcastDispatcher, - Lazy<Optional<StatusBar>> statusBarOptionalLazy, BootCompleteCache bootCompleteCache, + Lazy<Optional<CentralSurfaces>> centralSurfacesOptionalLazy, + BootCompleteCache bootCompleteCache, StatusBarStateController statusBarStateController) { mContext = context; - mStatusBarOptionalLazy = statusBarOptionalLazy; + mCentralSurfacesOptionalLazy = centralSurfacesOptionalLazy; mStatusBarStateController = statusBarStateController; mDefaultHome = getCurrentDefaultHome(); @@ -180,7 +181,8 @@ public final class PhoneStateMonitor { } private boolean isBouncerShowing() { - return mStatusBarOptionalLazy.get().map(StatusBar::isBouncerShowing).orElse(false); + return mCentralSurfacesOptionalLazy.get() + .map(CentralSurfaces::isBouncerShowing).orElse(false); } private boolean isKeyguardLocked() { diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/AuthRippleController.kt b/packages/SystemUI/src/com/android/systemui/biometrics/AuthRippleController.kt index f82ea790bb64..99f27d7f48e7 100644 --- a/packages/SystemUI/src/com/android/systemui/biometrics/AuthRippleController.kt +++ b/packages/SystemUI/src/com/android/systemui/biometrics/AuthRippleController.kt @@ -40,8 +40,8 @@ import com.android.systemui.statusbar.commandline.Command import com.android.systemui.statusbar.commandline.CommandRegistry import com.android.systemui.statusbar.phone.BiometricUnlockController import com.android.systemui.statusbar.phone.KeyguardBypassController -import com.android.systemui.statusbar.phone.StatusBar -import com.android.systemui.statusbar.phone.dagger.StatusBarComponent.StatusBarScope +import com.android.systemui.statusbar.phone.CentralSurfaces +import com.android.systemui.statusbar.phone.dagger.CentralSurfacesComponent.CentralSurfacesScope import com.android.systemui.statusbar.policy.ConfigurationController import com.android.systemui.statusbar.policy.KeyguardStateController import com.android.systemui.util.ViewController @@ -54,9 +54,9 @@ import javax.inject.Provider * Controls the ripple effect that shows when authentication is successful. * The ripple uses the accent color of the current theme. */ -@StatusBarScope +@CentralSurfacesScope class AuthRippleController @Inject constructor( - private val statusBar: StatusBar, + private val centralSurfaces: CentralSurfaces, private val sysuiContext: Context, private val authController: AuthController, private val configurationController: ConfigurationController, @@ -137,7 +137,7 @@ class AuthRippleController @Inject constructor( private fun showUnlockedRipple() { notificationShadeWindowController.setForcePluginOpen(true, this) - val lightRevealScrim = statusBar.lightRevealScrim + val lightRevealScrim = centralSurfaces.lightRevealScrim if (statusBarStateController.isDozing || biometricUnlockController.isWakeAndUnlock) { circleReveal?.let { lightRevealScrim?.revealEffect = it @@ -155,7 +155,7 @@ class AuthRippleController @Inject constructor( override fun onKeyguardFadingAwayChanged() { if (keyguardStateController.isKeyguardFadingAway) { - val lightRevealScrim = statusBar.lightRevealScrim + val lightRevealScrim = centralSurfaces.lightRevealScrim if (startLightRevealScrimOnKeyguardFadingAway && lightRevealScrim != null) { ValueAnimator.ofFloat(.1f, 1f).apply { interpolator = Interpolators.LINEAR_OUT_SLOW_IN @@ -170,7 +170,7 @@ class AuthRippleController @Inject constructor( } addListener(object : AnimatorListenerAdapter() { override fun onAnimationEnd(animation: Animator?) { - // Reset light reveal scrim to the default, so the StatusBar + // Reset light reveal scrim to the default, so the CentralSurfaces // can handle any subsequent light reveal changes // (ie: from dozing changes) if (lightRevealScrim.revealEffect == circleReveal) { @@ -199,8 +199,8 @@ class AuthRippleController @Inject constructor( it.y, 0f, Math.max( - Math.max(it.x, statusBar.displayWidth - it.x), - Math.max(it.y, statusBar.displayHeight - it.y) + Math.max(it.x, centralSurfaces.displayWidth - it.x), + Math.max(it.y, centralSurfaces.displayHeight - it.y) ) ) } diff --git a/packages/SystemUI/src/com/android/systemui/dagger/SystemUIBinder.java b/packages/SystemUI/src/com/android/systemui/dagger/SystemUIBinder.java index b32f8786899a..2f041acb649d 100644 --- a/packages/SystemUI/src/com/android/systemui/dagger/SystemUIBinder.java +++ b/packages/SystemUI/src/com/android/systemui/dagger/SystemUIBinder.java @@ -18,7 +18,7 @@ package com.android.systemui.dagger; import com.android.systemui.keyguard.dagger.KeyguardModule; import com.android.systemui.recents.RecentsModule; -import com.android.systemui.statusbar.dagger.StatusBarModule; +import com.android.systemui.statusbar.dagger.CentralSurfacesModule; import dagger.Module; @@ -27,7 +27,7 @@ import dagger.Module; */ @Module(includes = { RecentsModule.class, - StatusBarModule.class, + CentralSurfacesModule.class, KeyguardModule.class, }) public abstract class SystemUIBinder { diff --git a/packages/SystemUI/src/com/android/systemui/dagger/SystemUIDefaultModule.java b/packages/SystemUI/src/com/android/systemui/dagger/SystemUIDefaultModule.java index a4da6b422bde..5d154c3b4f6b 100644 --- a/packages/SystemUI/src/com/android/systemui/dagger/SystemUIDefaultModule.java +++ b/packages/SystemUI/src/com/android/systemui/dagger/SystemUIDefaultModule.java @@ -48,7 +48,7 @@ import com.android.systemui.statusbar.CommandQueue; import com.android.systemui.statusbar.NotificationLockscreenUserManager; import com.android.systemui.statusbar.NotificationLockscreenUserManagerImpl; import com.android.systemui.statusbar.NotificationShadeWindowController; -import com.android.systemui.statusbar.dagger.StartStatusBarModule; +import com.android.systemui.statusbar.dagger.StartCentralSurfacesModule; import com.android.systemui.statusbar.notification.NotificationEntryManager; import com.android.systemui.statusbar.notification.collection.provider.VisualStabilityProvider; import com.android.systemui.statusbar.notification.collection.render.GroupMembershipManager; @@ -87,7 +87,7 @@ import dagger.Provides; MediaModule.class, PowerModule.class, QSModule.class, - StartStatusBarModule.class, + StartCentralSurfacesModule.class, VolumeModule.class }) public abstract class SystemUIDefaultModule { diff --git a/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java b/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java index 13067bf71165..27993010c917 100644 --- a/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java +++ b/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java @@ -67,8 +67,8 @@ import com.android.systemui.statusbar.notification.row.dagger.ExpandableNotifica import com.android.systemui.statusbar.notification.row.dagger.NotificationRowComponent; import com.android.systemui.statusbar.notification.row.dagger.NotificationShelfComponent; import com.android.systemui.statusbar.phone.ShadeController; -import com.android.systemui.statusbar.phone.StatusBar; -import com.android.systemui.statusbar.phone.dagger.StatusBarComponent; +import com.android.systemui.statusbar.phone.CentralSurfaces; +import com.android.systemui.statusbar.phone.dagger.CentralSurfacesComponent; import com.android.systemui.statusbar.policy.ConfigurationController; import com.android.systemui.statusbar.policy.HeadsUpManager; import com.android.systemui.statusbar.policy.ZenModeController; @@ -131,7 +131,7 @@ import dagger.Provides; WalletModule.class }, subcomponents = { - StatusBarComponent.class, + CentralSurfacesComponent.class, NotificationRowComponent.class, DozeComponent.class, ExpandableNotificationRowComponent.class, @@ -175,7 +175,7 @@ public abstract class SystemUIModule { abstract Recents optionalRecents(); @BindsOptionalOf - abstract StatusBar optionalStatusBar(); + abstract CentralSurfaces optionalCentralSurfaces(); @BindsOptionalOf abstract UdfpsHbmProvider optionalUdfpsHbmProvider(); diff --git a/packages/SystemUI/src/com/android/systemui/dreams/touch/BouncerSwipeTouchHandler.java b/packages/SystemUI/src/com/android/systemui/dreams/touch/BouncerSwipeTouchHandler.java index 0509c66f2cb6..e140f6b0faa2 100644 --- a/packages/SystemUI/src/com/android/systemui/dreams/touch/BouncerSwipeTouchHandler.java +++ b/packages/SystemUI/src/com/android/systemui/dreams/touch/BouncerSwipeTouchHandler.java @@ -32,7 +32,7 @@ import android.view.VelocityTracker; import com.android.systemui.statusbar.NotificationShadeWindowController; import com.android.systemui.statusbar.phone.KeyguardBouncer; -import com.android.systemui.statusbar.phone.StatusBar; +import com.android.systemui.statusbar.phone.CentralSurfaces; import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager; import com.android.wm.shell.animation.FlingAnimationUtils; @@ -71,7 +71,7 @@ public class BouncerSwipeTouchHandler implements DreamTouchHandler { private StatusBarKeyguardViewManager mStatusBarKeyguardViewManager; private float mCurrentExpansion; - private final StatusBar mStatusBar; + private final CentralSurfaces mCentralSurfaces; private VelocityTracker mVelocityTracker; @@ -114,10 +114,9 @@ public class BouncerSwipeTouchHandler implements DreamTouchHandler { // is fully hidden at full expansion (1) and fully visible when fully collapsed // (0). final float screenTravelPercentage = - Math.abs((e1.getY() - e2.getY()) / mStatusBar.getDisplayHeight()); - setPanelExpansion(mStatusBar.isBouncerShowing() + Math.abs((e1.getY() - e2.getY()) / mCentralSurfaces.getDisplayHeight()); + setPanelExpansion(mCentralSurfaces.isBouncerShowing() ? screenTravelPercentage : 1 - screenTravelPercentage); - return true; } }; @@ -131,7 +130,7 @@ public class BouncerSwipeTouchHandler implements DreamTouchHandler { public BouncerSwipeTouchHandler( DisplayMetrics displayMetrics, StatusBarKeyguardViewManager statusBarKeyguardViewManager, - StatusBar statusBar, + CentralSurfaces centralSurfaces, NotificationShadeWindowController notificationShadeWindowController, ValueAnimatorCreator valueAnimatorCreator, VelocityTrackerFactory velocityTrackerFactory, @@ -141,7 +140,7 @@ public class BouncerSwipeTouchHandler implements DreamTouchHandler { FlingAnimationUtils flingAnimationUtilsClosing, @Named(SWIPE_TO_BOUNCER_START_REGION) float swipeRegionPercentage) { mDisplayMetrics = displayMetrics; - mStatusBar = statusBar; + mCentralSurfaces = centralSurfaces; mStatusBarKeyguardViewManager = statusBarKeyguardViewManager; mNotificationShadeWindowController = notificationShadeWindowController; mBouncerZoneScreenPercentage = swipeRegionPercentage; @@ -153,7 +152,7 @@ public class BouncerSwipeTouchHandler implements DreamTouchHandler { @Override public void getTouchInitiationRegion(Region region) { - if (mStatusBar.isBouncerShowing()) { + if (mCentralSurfaces.isBouncerShowing()) { region.op(new Rect(0, 0, mDisplayMetrics.widthPixels, Math.round(mDisplayMetrics.heightPixels * mBouncerZoneScreenPercentage)), Region.Op.UNION); @@ -247,7 +246,7 @@ public class BouncerSwipeTouchHandler implements DreamTouchHandler { } protected void flingToExpansion(float velocity, float expansion) { - final float viewHeight = mStatusBar.getDisplayHeight(); + final float viewHeight = mCentralSurfaces.getDisplayHeight(); final float currentHeight = viewHeight * mCurrentExpansion; final float targetHeight = viewHeight * expansion; diff --git a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsComponent.java b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsComponent.java index e746cafb5ea0..74d5bd577cf4 100644 --- a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsComponent.java +++ b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsComponent.java @@ -33,7 +33,7 @@ import javax.inject.Inject; import javax.inject.Provider; /** - * Manages power menu plugins and communicates power menu actions to the StatusBar. + * Manages power menu plugins and communicates power menu actions to the CentralSurfaces. */ @SysUISingleton public class GlobalActionsComponent extends CoreStartable diff --git a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialogLite.java b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialogLite.java index e3886cd80a42..7a278f786a67 100644 --- a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialogLite.java +++ b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialogLite.java @@ -121,7 +121,7 @@ import com.android.systemui.plugins.GlobalActionsPanelPlugin; import com.android.systemui.scrim.ScrimDrawable; import com.android.systemui.statusbar.NotificationShadeWindowController; import com.android.systemui.statusbar.VibratorHelper; -import com.android.systemui.statusbar.phone.StatusBar; +import com.android.systemui.statusbar.phone.CentralSurfaces; import com.android.systemui.statusbar.phone.SystemUIDialog; import com.android.systemui.statusbar.policy.ConfigurationController; import com.android.systemui.statusbar.policy.KeyguardStateController; @@ -236,7 +236,7 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene private int mDialogPressDelay = DIALOG_PRESS_DELAY; // ms protected Handler mMainHandler; private int mSmallestScreenWidthDp; - private final Optional<StatusBar> mStatusBarOptional; + private final Optional<CentralSurfaces> mCentralSurfacesOptional; private final KeyguardUpdateMonitor mKeyguardUpdateMonitor; private final DialogLaunchAnimator mDialogLaunchAnimator; @@ -344,7 +344,7 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene RingerModeTracker ringerModeTracker, @Main Handler handler, PackageManager packageManager, - Optional<StatusBar> statusBarOptional, + Optional<CentralSurfaces> centralSurfacesOptional, KeyguardUpdateMonitor keyguardUpdateMonitor, DialogLaunchAnimator dialogLaunchAnimator) { mContext = context; @@ -374,7 +374,7 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene mRingerModeTracker = ringerModeTracker; mMainHandler = handler; mSmallestScreenWidthDp = resources.getConfiguration().smallestScreenWidthDp; - mStatusBarOptional = statusBarOptional; + mCentralSurfacesOptional = centralSurfacesOptional; mKeyguardUpdateMonitor = keyguardUpdateMonitor; mDialogLaunchAnimator = dialogLaunchAnimator; @@ -426,8 +426,8 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene return mUiEventLogger; } - protected Optional<StatusBar> getStatusBar() { - return mStatusBarOptional; + protected Optional<CentralSurfaces> getCentralSurfaces() { + return mCentralSurfacesOptional; } protected KeyguardUpdateMonitor getKeyguardUpdateMonitor() { @@ -675,7 +675,7 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene com.android.systemui.R.style.Theme_SystemUI_Dialog_GlobalActionsLite, mAdapter, mOverflowAdapter, mSysuiColorExtractor, mStatusBarService, mNotificationShadeWindowController, this::onRefresh, mKeyguardShowing, - mPowerAdapter, mUiEventLogger, mStatusBarOptional, mKeyguardUpdateMonitor, + mPowerAdapter, mUiEventLogger, mCentralSurfacesOptional, mKeyguardUpdateMonitor, mLockPatternUtils); dialog.setOnDismissListener(this); @@ -866,7 +866,7 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene mUiEventLogger.log(GlobalActionsEvent.GA_EMERGENCY_DIALER_PRESS); if (mTelecomManager != null) { // Close shade so user sees the activity - mStatusBarOptional.ifPresent(StatusBar::collapseShade); + mCentralSurfacesOptional.ifPresent(CentralSurfaces::collapseShade); Intent intent = mTelecomManager.createLaunchEmergencyDialerIntent( null /* number */); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK @@ -998,7 +998,7 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene mIActivityManager.requestInteractiveBugReport(); } // Close shade so user sees the activity - mStatusBarOptional.ifPresent(StatusBar::collapseShade); + mCentralSurfacesOptional.ifPresent(CentralSurfaces::collapseShade); } catch (RemoteException e) { } } @@ -1018,7 +1018,7 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene mUiEventLogger.log(GlobalActionsEvent.GA_BUGREPORT_LONG_PRESS); mIActivityManager.requestFullBugReport(); // Close shade so user sees the activity - mStatusBarOptional.ifPresent(StatusBar::collapseShade); + mCentralSurfacesOptional.ifPresent(CentralSurfaces::collapseShade); } catch (RemoteException e) { } return false; @@ -2160,7 +2160,7 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene protected final Runnable mOnRefreshCallback; private UiEventLogger mUiEventLogger; private GestureDetector mGestureDetector; - private Optional<StatusBar> mStatusBarOptional; + private Optional<CentralSurfaces> mCentralSurfacesOptional; private KeyguardUpdateMonitor mKeyguardUpdateMonitor; private LockPatternUtils mLockPatternUtils; private float mWindowDimAmount; @@ -2188,8 +2188,8 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) { if (distanceY < 0 && distanceY > distanceX - && e1.getY() <= mStatusBarOptional.map( - StatusBar::getStatusBarHeight).orElse(0)) { + && e1.getY() <= mCentralSurfacesOptional.map( + CentralSurfaces::getStatusBarHeight).orElse(0)) { // Downwards scroll from top openShadeAndDismiss(); return true; @@ -2201,8 +2201,8 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) { if (velocityY > 0 && Math.abs(velocityY) > Math.abs(velocityX) - && e1.getY() <= mStatusBarOptional.map( - StatusBar::getStatusBarHeight).orElse(0)) { + && e1.getY() <= mCentralSurfacesOptional.map( + CentralSurfaces::getStatusBarHeight).orElse(0)) { // Downwards fling from top openShadeAndDismiss(); return true; @@ -2217,7 +2217,8 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene NotificationShadeWindowController notificationShadeWindowController, Runnable onRefreshCallback, boolean keyguardShowing, MyPowerOptionsAdapter powerAdapter, UiEventLogger uiEventLogger, - Optional<StatusBar> statusBarOptional, KeyguardUpdateMonitor keyguardUpdateMonitor, + Optional<CentralSurfaces> centralSurfacesOptional, + KeyguardUpdateMonitor keyguardUpdateMonitor, LockPatternUtils lockPatternUtils) { // We set dismissOnDeviceLock to false because we have a custom broadcast receiver to // dismiss this dialog when the device is locked. @@ -2232,7 +2233,7 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene mOnRefreshCallback = onRefreshCallback; mKeyguardShowing = keyguardShowing; mUiEventLogger = uiEventLogger; - mStatusBarOptional = statusBarOptional; + mCentralSurfacesOptional = centralSurfacesOptional; mKeyguardUpdateMonitor = keyguardUpdateMonitor; mLockPatternUtils = lockPatternUtils; mGestureDetector = new GestureDetector(mContext, mGestureListener); @@ -2262,14 +2263,14 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene private void openShadeAndDismiss() { mUiEventLogger.log(GlobalActionsEvent.GA_CLOSE_TAP_OUTSIDE); - if (mStatusBarOptional.map(StatusBar::isKeyguardShowing).orElse(false)) { + if (mCentralSurfacesOptional.map(CentralSurfaces::isKeyguardShowing).orElse(false)) { // match existing lockscreen behavior to open QS when swiping from status bar - mStatusBarOptional.ifPresent( - statusBar -> statusBar.animateExpandSettingsPanel(null)); + mCentralSurfacesOptional.ifPresent( + centralSurfaces -> centralSurfaces.animateExpandSettingsPanel(null)); } else { // otherwise, swiping down should expand notification shade - mStatusBarOptional.ifPresent( - statusBar -> statusBar.animateExpandNotificationsPanel()); + mCentralSurfacesOptional.ifPresent( + centralSurfaces -> centralSurfaces.animateExpandNotificationsPanel()); } dismiss(); } diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java index ae7147ecae03..07dfa33620a0 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java @@ -127,7 +127,7 @@ import com.android.systemui.statusbar.phone.DozeParameters; import com.android.systemui.statusbar.phone.KeyguardBypassController; import com.android.systemui.statusbar.phone.NotificationPanelViewController; import com.android.systemui.statusbar.phone.ScreenOffAnimationController; -import com.android.systemui.statusbar.phone.StatusBar; +import com.android.systemui.statusbar.phone.CentralSurfaces; import com.android.systemui.statusbar.phone.panelstate.PanelExpansionStateManager; import com.android.systemui.statusbar.policy.KeyguardStateController; import com.android.systemui.statusbar.policy.UserSwitcherController; @@ -2717,22 +2717,22 @@ public class KeyguardViewMediator extends CoreStartable implements Dumpable, } /** - * Registers the StatusBar to which the Keyguard View is mounted. + * Registers the CentralSurfaces to which the Keyguard View is mounted. * - * @param statusBar + * @param centralSurfaces * @param panelView * @param biometricUnlockController * @param notificationContainer * @param bypassController * @return the View Controller for the Keyguard View this class is mediating. */ - public KeyguardViewController registerStatusBar(StatusBar statusBar, + public KeyguardViewController registerCentralSurfaces(CentralSurfaces centralSurfaces, NotificationPanelViewController panelView, @Nullable PanelExpansionStateManager panelExpansionStateManager, BiometricUnlockController biometricUnlockController, View notificationContainer, KeyguardBypassController bypassController) { - mKeyguardViewControllerLazy.get().registerStatusBar( - statusBar, + mKeyguardViewControllerLazy.get().registerCentralSurfaces( + centralSurfaces, panelView, panelExpansionStateManager, biometricUnlockController, diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/dagger/KeyguardModule.java b/packages/SystemUI/src/com/android/systemui/keyguard/dagger/KeyguardModule.java index 195ef1a84c43..c69f947f5f3f 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/dagger/KeyguardModule.java +++ b/packages/SystemUI/src/com/android/systemui/keyguard/dagger/KeyguardModule.java @@ -48,10 +48,10 @@ import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.statusbar.NotificationShadeDepthController; import com.android.systemui.statusbar.NotificationShadeWindowController; import com.android.systemui.statusbar.SysuiStatusBarStateController; +import com.android.systemui.statusbar.phone.CentralSurfaces; import com.android.systemui.statusbar.phone.DozeParameters; import com.android.systemui.statusbar.phone.KeyguardLiftController; import com.android.systemui.statusbar.phone.ScreenOffAnimationController; -import com.android.systemui.statusbar.phone.StatusBar; import com.android.systemui.statusbar.policy.KeyguardStateController; import com.android.systemui.statusbar.policy.UserSwitcherController; import com.android.systemui.util.DeviceConfigProxy; @@ -64,7 +64,7 @@ import dagger.Module; import dagger.Provides; /** - * Dagger Module providing {@link StatusBar}. + * Dagger Module providing keyguard. */ @Module(subcomponents = { KeyguardQsUserSwitchComponent.class, diff --git a/packages/SystemUI/src/com/android/systemui/navigationbar/NavBarHelper.java b/packages/SystemUI/src/com/android/systemui/navigationbar/NavBarHelper.java index 5e9edb7c906e..a1a319814269 100644 --- a/packages/SystemUI/src/com/android/systemui/navigationbar/NavBarHelper.java +++ b/packages/SystemUI/src/com/android/systemui/navigationbar/NavBarHelper.java @@ -49,8 +49,7 @@ import com.android.systemui.dump.DumpManager; import com.android.systemui.recents.OverviewProxyService; import com.android.systemui.settings.UserTracker; import com.android.systemui.shared.system.QuickStepContract; -import com.android.systemui.statusbar.phone.StatusBar; -import com.android.systemui.statusbar.policy.AccessibilityManagerWrapper; +import com.android.systemui.statusbar.phone.CentralSurfaces; import java.io.FileDescriptor; import java.io.PrintWriter; @@ -79,7 +78,7 @@ public final class NavBarHelper implements Dumpable { private final AccessibilityManager mAccessibilityManager; private final Lazy<AssistManager> mAssistManagerLazy; - private final Lazy<Optional<StatusBar>> mStatusBarOptionalLazy; + private final Lazy<Optional<CentralSurfaces>> mCentralSurfacesOptionalLazy; private final UserTracker mUserTracker; private final SystemActions mSystemActions; private final AccessibilityButtonModeObserver mAccessibilityButtonModeObserver; @@ -113,7 +112,7 @@ public final class NavBarHelper implements SystemActions systemActions, OverviewProxyService overviewProxyService, Lazy<AssistManager> assistManagerLazy, - Lazy<Optional<StatusBar>> statusBarOptionalLazy, + Lazy<Optional<CentralSurfaces>> centralSurfacesOptionalLazy, NavigationModeController navigationModeController, UserTracker userTracker, DumpManager dumpManager) { @@ -121,7 +120,7 @@ public final class NavBarHelper implements mContentResolver = mContext.getContentResolver(); mAccessibilityManager = accessibilityManager; mAssistManagerLazy = assistManagerLazy; - mStatusBarOptionalLazy = statusBarOptionalLazy; + mCentralSurfacesOptionalLazy = centralSurfacesOptionalLazy; mUserTracker = userTracker; mSystemActions = systemActions; accessibilityManager.addAccessibilityServicesStateChangeListener( @@ -295,8 +294,8 @@ public final class NavBarHelper implements * {@link InputMethodService} and the keyguard states. */ public boolean isImeShown(int vis) { - View shadeWindowView = mStatusBarOptionalLazy.get().get().getNotificationShadeWindowView(); - boolean isKeyguardShowing = mStatusBarOptionalLazy.get().get().isKeyguardShowing(); + View shadeWindowView = mCentralSurfacesOptionalLazy.get().get().getNotificationShadeWindowView(); + boolean isKeyguardShowing = mCentralSurfacesOptionalLazy.get().get().isKeyguardShowing(); boolean imeVisibleOnShade = shadeWindowView != null && shadeWindowView.isAttachedToWindow() && shadeWindowView.getRootWindowInsets().isVisible(WindowInsets.Type.ime()); return imeVisibleOnShade diff --git a/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBar.java b/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBar.java index 76914f3fd8ee..3ab1216777e9 100644 --- a/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBar.java +++ b/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBar.java @@ -53,8 +53,8 @@ import static com.android.systemui.statusbar.phone.BarTransitions.MODE_OPAQUE; import static com.android.systemui.statusbar.phone.BarTransitions.MODE_SEMI_TRANSPARENT; import static com.android.systemui.statusbar.phone.BarTransitions.MODE_TRANSPARENT; import static com.android.systemui.statusbar.phone.BarTransitions.TransitionMode; -import static com.android.systemui.statusbar.phone.StatusBar.DEBUG_WINDOW_STATE; -import static com.android.systemui.statusbar.phone.StatusBar.dumpBarTransitions; +import static com.android.systemui.statusbar.phone.CentralSurfaces.DEBUG_WINDOW_STATE; +import static com.android.systemui.statusbar.phone.CentralSurfaces.dumpBarTransitions; import android.annotation.IdRes; import android.app.ActivityTaskManager; @@ -134,9 +134,9 @@ import com.android.systemui.statusbar.StatusBarState; import com.android.systemui.statusbar.notification.stack.StackStateAnimator; import com.android.systemui.statusbar.phone.AutoHideController; import com.android.systemui.statusbar.phone.BarTransitions; +import com.android.systemui.statusbar.phone.CentralSurfaces; import com.android.systemui.statusbar.phone.LightBarController; import com.android.systemui.statusbar.phone.ShadeController; -import com.android.systemui.statusbar.phone.StatusBar; import com.android.systemui.statusbar.policy.DeviceProvisionedController; import com.android.wm.shell.back.BackAnimation; import com.android.wm.shell.pip.Pip; @@ -176,7 +176,7 @@ public class NavigationBar implements View.OnAttachStateChangeListener, private final MetricsLogger mMetricsLogger; private final Lazy<AssistManager> mAssistManagerLazy; private final SysUiState mSysUiFlagsContainer; - private final Lazy<Optional<StatusBar>> mStatusBarOptionalLazy; + private final Lazy<Optional<CentralSurfaces>> mCentralSurfacesOptionalLazy; private final ShadeController mShadeController; private final NotificationRemoteInputManager mNotificationRemoteInputManager; private final OverviewProxyService mOverviewProxyService; @@ -486,7 +486,7 @@ public class NavigationBar implements View.OnAttachStateChangeListener, CommandQueue commandQueue, Optional<Pip> pipOptional, Optional<Recents> recentsOptional, - Lazy<Optional<StatusBar>> statusBarOptionalLazy, + Lazy<Optional<CentralSurfaces>> centralSurfacesOptionalLazy, ShadeController shadeController, NotificationRemoteInputManager notificationRemoteInputManager, NotificationShadeDepthController notificationShadeDepthController, @@ -509,7 +509,7 @@ public class NavigationBar implements View.OnAttachStateChangeListener, mMetricsLogger = metricsLogger; mAssistManagerLazy = assistManagerLazy; mSysUiFlagsContainer = sysUiFlagsContainer; - mStatusBarOptionalLazy = statusBarOptionalLazy; + mCentralSurfacesOptionalLazy = centralSurfacesOptionalLazy; mShadeController = shadeController; mNotificationRemoteInputManager = notificationRemoteInputManager; mOverviewProxyService = overviewProxyService; @@ -611,7 +611,7 @@ public class NavigationBar implements View.OnAttachStateChangeListener, public void onViewAttachedToWindow(View v) { final Display display = v.getDisplay(); mNavigationBarView.setComponents(mRecentsOptional); - mNavigationBarView.setComponents(mStatusBarOptionalLazy.get().get().getPanelController()); + mNavigationBarView.setComponents(mCentralSurfacesOptionalLazy.get().get().getPanelController()); mNavigationBarView.setDisabledFlags(mDisabledFlags1); mNavigationBarView.setOnVerticalChangedListener(this::onVerticalChanged); mNavigationBarView.setOnTouchListener(this::onNavigationTouch); @@ -1165,13 +1165,14 @@ public class NavigationBar implements View.OnAttachStateChangeListener, // If an incoming call is ringing, HOME is totally disabled. // (The user is already on the InCallUI at this point, // and their ONLY options are to answer or reject the call.) - final Optional<StatusBar> statusBarOptional = mStatusBarOptionalLazy.get(); + final Optional<CentralSurfaces> centralSurfacesOptional = mCentralSurfacesOptionalLazy.get(); switch (event.getAction()) { case MotionEvent.ACTION_DOWN: mHomeBlockedThisTouch = false; if (mTelecomManagerOptional.isPresent() && mTelecomManagerOptional.get().isRinging()) { - if (statusBarOptional.map(StatusBar::isKeyguardShowing).orElse(false)) { + if (centralSurfacesOptional.map(CentralSurfaces::isKeyguardShowing) + .orElse(false)) { Log.i(TAG, "Ignoring HOME; there's a ringing incoming call. " + "No heads up"); mHomeBlockedThisTouch = true; @@ -1187,14 +1188,14 @@ public class NavigationBar implements View.OnAttachStateChangeListener, case MotionEvent.ACTION_UP: case MotionEvent.ACTION_CANCEL: mHandler.removeCallbacks(mOnVariableDurationHomeLongClick); - statusBarOptional.ifPresent(StatusBar::awakenDreams); + centralSurfacesOptional.ifPresent(CentralSurfaces::awakenDreams); break; } return false; } private void onVerticalChanged(boolean isVertical) { - mStatusBarOptionalLazy.get().ifPresent( + mCentralSurfacesOptionalLazy.get().ifPresent( statusBar -> statusBar.setQsScrimEnabled(!isVertical)); } @@ -1221,7 +1222,7 @@ public class NavigationBar implements View.OnAttachStateChangeListener, AssistManager.INVOCATION_TYPE_KEY, AssistManager.INVOCATION_TYPE_HOME_BUTTON_LONG_PRESS); mAssistManagerLazy.get().startAssist(args); - mStatusBarOptionalLazy.get().ifPresent(StatusBar::awakenDreams); + mCentralSurfacesOptionalLazy.get().ifPresent(CentralSurfaces::awakenDreams); mNavigationBarView.abortCurrentGesture(); return true; } @@ -1247,7 +1248,7 @@ public class NavigationBar implements View.OnAttachStateChangeListener, LatencyTracker.getInstance(mContext).onActionStart( LatencyTracker.ACTION_TOGGLE_RECENTS); } - mStatusBarOptionalLazy.get().ifPresent(StatusBar::awakenDreams); + mCentralSurfacesOptionalLazy.get().ifPresent(CentralSurfaces::awakenDreams); mCommandQueue.toggleRecentApps(); } @@ -1431,7 +1432,7 @@ public class NavigationBar implements View.OnAttachStateChangeListener, private void checkBarModes() { // We only have status bar on default display now. if (mIsOnDefaultDisplay) { - mStatusBarOptionalLazy.get().ifPresent(StatusBar::checkBarModes); + mCentralSurfacesOptionalLazy.get().ifPresent(CentralSurfaces::checkBarModes); } else { checkNavBarModes(); } @@ -1450,7 +1451,8 @@ public class NavigationBar implements View.OnAttachStateChangeListener, */ public void checkNavBarModes() { final boolean anim = - mStatusBarOptionalLazy.get().map(StatusBar::isDeviceInteractive).orElse(false) + mCentralSurfacesOptionalLazy.get().map(CentralSurfaces::isDeviceInteractive) + .orElse(false) && mNavigationBarWindowState != WINDOW_STATE_HIDDEN; mNavigationBarView.getBarTransitions().transitionTo(mNavigationBarMode, anim); } @@ -1626,7 +1628,7 @@ public class NavigationBar implements View.OnAttachStateChangeListener, private final CommandQueue mCommandQueue; private final Optional<Pip> mPipOptional; private final Optional<Recents> mRecentsOptional; - private final Lazy<Optional<StatusBar>> mStatusBarOptionalLazy; + private final Lazy<Optional<CentralSurfaces>> mCentralSurfacesOptionalLazy; private final ShadeController mShadeController; private final NotificationRemoteInputManager mNotificationRemoteInputManager; private final NotificationShadeDepthController mNotificationShadeDepthController; @@ -1657,7 +1659,7 @@ public class NavigationBar implements View.OnAttachStateChangeListener, CommandQueue commandQueue, Optional<Pip> pipOptional, Optional<Recents> recentsOptional, - Lazy<Optional<StatusBar>> statusBarOptionalLazy, + Lazy<Optional<CentralSurfaces>> centralSurfacesOptionalLazy, ShadeController shadeController, NotificationRemoteInputManager notificationRemoteInputManager, NotificationShadeDepthController notificationShadeDepthController, @@ -1685,7 +1687,7 @@ public class NavigationBar implements View.OnAttachStateChangeListener, mCommandQueue = commandQueue; mPipOptional = pipOptional; mRecentsOptional = recentsOptional; - mStatusBarOptionalLazy = statusBarOptionalLazy; + mCentralSurfacesOptionalLazy = centralSurfacesOptionalLazy; mShadeController = shadeController; mNotificationRemoteInputManager = notificationRemoteInputManager; mNotificationShadeDepthController = notificationShadeDepthController; @@ -1710,7 +1712,7 @@ public class NavigationBar implements View.OnAttachStateChangeListener, mOverviewProxyService, mNavigationModeController, mAccessibilityButtonModeObserver, mStatusBarStateController, mSysUiFlagsContainer, mBroadcastDispatcher, mCommandQueue, mPipOptional, - mRecentsOptional, mStatusBarOptionalLazy, + mRecentsOptional, mCentralSurfacesOptionalLazy, mShadeController, mNotificationRemoteInputManager, mNotificationShadeDepthController, mMainHandler, mNavbarOverlayController, mUiEventLogger, mNavBarHelper, diff --git a/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarView.java b/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarView.java index ede10a5f2f18..017bbdffdc4f 100644 --- a/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarView.java +++ b/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarView.java @@ -90,7 +90,7 @@ import com.android.systemui.statusbar.CommandQueue; import com.android.systemui.statusbar.phone.AutoHideController; import com.android.systemui.statusbar.phone.LightBarTransitionsController; import com.android.systemui.statusbar.phone.NotificationPanelViewController; -import com.android.systemui.statusbar.phone.StatusBar; +import com.android.systemui.statusbar.phone.CentralSurfaces; import com.android.wm.shell.back.BackAnimation; import com.android.wm.shell.pip.Pip; @@ -1362,7 +1362,7 @@ public class NavigationBarView extends FrameLayout implements getContextDisplay().getRealSize(size); pw.println("NavigationBarView:"); - pw.println(String.format(" this: " + StatusBar.viewInfo(this) + pw.println(String.format(" this: " + CentralSurfaces.viewInfo(this) + " " + visibilityToString(getVisibility()))); getWindowVisibleDisplayFrame(r); diff --git a/packages/SystemUI/src/com/android/systemui/power/PowerUI.java b/packages/SystemUI/src/com/android/systemui/power/PowerUI.java index 642af593c211..a7ed871b9fbb 100644 --- a/packages/SystemUI/src/com/android/systemui/power/PowerUI.java +++ b/packages/SystemUI/src/com/android/systemui/power/PowerUI.java @@ -47,7 +47,7 @@ import com.android.systemui.R; import com.android.systemui.broadcast.BroadcastDispatcher; import com.android.systemui.dagger.SysUISingleton; import com.android.systemui.statusbar.CommandQueue; -import com.android.systemui.statusbar.phone.StatusBar; +import com.android.systemui.statusbar.phone.CentralSurfaces; import java.io.FileDescriptor; import java.io.PrintWriter; @@ -108,17 +108,17 @@ public class PowerUI extends CoreStartable implements CommandQueue.Callbacks { private IThermalEventListener mUsbThermalEventListener; private final BroadcastDispatcher mBroadcastDispatcher; private final CommandQueue mCommandQueue; - private final Lazy<Optional<StatusBar>> mStatusBarOptionalLazy; + private final Lazy<Optional<CentralSurfaces>> mCentralSurfacesOptionalLazy; @Inject public PowerUI(Context context, BroadcastDispatcher broadcastDispatcher, - CommandQueue commandQueue, Lazy<Optional<StatusBar>> statusBarOptionalLazy, + CommandQueue commandQueue, Lazy<Optional<CentralSurfaces>> centralSurfacesOptionalLazy, WarningsUI warningsUI, EnhancedEstimates enhancedEstimates, PowerManager powerManager) { super(context); mBroadcastDispatcher = broadcastDispatcher; mCommandQueue = commandQueue; - mStatusBarOptionalLazy = statusBarOptionalLazy; + mCentralSurfacesOptionalLazy = centralSurfacesOptionalLazy; mWarnings = warningsUI; mEnhancedEstimates = enhancedEstimates; mPowerManager = powerManager; @@ -712,8 +712,10 @@ public class PowerUI extends CoreStartable implements CommandQueue.Callbacks { int status = temp.getStatus(); if (status >= Temperature.THROTTLING_EMERGENCY) { - final Optional<StatusBar> statusBarOptional = mStatusBarOptionalLazy.get(); - if (!statusBarOptional.map(StatusBar::isDeviceInVrMode).orElse(false)) { + final Optional<CentralSurfaces> centralSurfacesOptional = + mCentralSurfacesOptionalLazy.get(); + if (!centralSurfacesOptional.map(CentralSurfaces::isDeviceInVrMode) + .orElse(false)) { mWarnings.showHighTemperatureWarning(); Slog.d(TAG, "SkinThermalEventListener: notifyThrottling was called " + ", current skin status = " + status diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSTileHost.java b/packages/SystemUI/src/com/android/systemui/qs/QSTileHost.java index c69307548b6e..47af7de9118d 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/QSTileHost.java +++ b/packages/SystemUI/src/com/android/systemui/qs/QSTileHost.java @@ -53,7 +53,7 @@ import com.android.systemui.qs.logging.QSLogger; import com.android.systemui.settings.UserTracker; import com.android.systemui.shared.plugins.PluginManager; import com.android.systemui.statusbar.phone.AutoTileManager; -import com.android.systemui.statusbar.phone.StatusBar; +import com.android.systemui.statusbar.phone.CentralSurfaces; import com.android.systemui.statusbar.phone.StatusBarIconController; import com.android.systemui.tuner.TunerService; import com.android.systemui.tuner.TunerService.Tunable; @@ -102,7 +102,7 @@ public class QSTileHost implements QSHost, Tunable, PluginListener<QSFactory>, D private final StatusBarIconController mIconController; private final ArrayList<QSFactory> mQsFactories = new ArrayList<>(); private int mCurrentUser; - private final Optional<StatusBar> mStatusBarOptional; + private final Optional<CentralSurfaces> mCentralSurfacesOptional; private Context mUserContext; private UserTracker mUserTracker; private SecureSettings mSecureSettings; @@ -121,7 +121,7 @@ public class QSTileHost implements QSHost, Tunable, PluginListener<QSFactory>, D Provider<AutoTileManager> autoTiles, DumpManager dumpManager, BroadcastDispatcher broadcastDispatcher, - Optional<StatusBar> statusBarOptional, + Optional<CentralSurfaces> centralSurfacesOptional, QSLogger qsLogger, UiEventLogger uiEventLogger, UserTracker userTracker, @@ -143,7 +143,7 @@ public class QSTileHost implements QSHost, Tunable, PluginListener<QSFactory>, D mTileLifeCycleManagerFactory = tileLifecycleManagerFactory; mInstanceIdSequence = new InstanceIdSequence(MAX_QS_INSTANCE_ID); - mStatusBarOptional = statusBarOptional; + mCentralSurfacesOptional = centralSurfacesOptional; mQsFactories.add(defaultFactory); pluginManager.addPluginListener(this, QSFactory.class, true); @@ -227,17 +227,17 @@ public class QSTileHost implements QSHost, Tunable, PluginListener<QSFactory>, D @Override public void collapsePanels() { - mStatusBarOptional.ifPresent(StatusBar::postAnimateCollapsePanels); + mCentralSurfacesOptional.ifPresent(CentralSurfaces::postAnimateCollapsePanels); } @Override public void forceCollapsePanels() { - mStatusBarOptional.ifPresent(StatusBar::postAnimateForceCollapsePanels); + mCentralSurfacesOptional.ifPresent(CentralSurfaces::postAnimateForceCollapsePanels); } @Override public void openPanels() { - mStatusBarOptional.ifPresent(StatusBar::postAnimateOpenPanels); + mCentralSurfacesOptional.ifPresent(CentralSurfaces::postAnimateOpenPanels); } @Override diff --git a/packages/SystemUI/src/com/android/systemui/recents/OverviewProxyRecentsImpl.java b/packages/SystemUI/src/com/android/systemui/recents/OverviewProxyRecentsImpl.java index 597f7b7053a2..f389df097d7d 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/OverviewProxyRecentsImpl.java +++ b/packages/SystemUI/src/com/android/systemui/recents/OverviewProxyRecentsImpl.java @@ -26,7 +26,7 @@ import android.util.Log; import com.android.systemui.Dependency; import com.android.systemui.dagger.SysUISingleton; import com.android.systemui.shared.recents.IOverviewProxy; -import com.android.systemui.statusbar.phone.StatusBar; +import com.android.systemui.statusbar.phone.CentralSurfaces; import java.util.Optional; @@ -42,7 +42,7 @@ public class OverviewProxyRecentsImpl implements RecentsImplementation { private final static String TAG = "OverviewProxyRecentsImpl"; @Nullable - private final Lazy<Optional<StatusBar>> mStatusBarOptionalLazy; + private final Lazy<Optional<CentralSurfaces>> mCentralSurfacesOptionalLazy; private Context mContext; private Handler mHandler; @@ -51,8 +51,8 @@ public class OverviewProxyRecentsImpl implements RecentsImplementation { @SuppressWarnings("OptionalUsedAsFieldOrParameterType") @Inject - public OverviewProxyRecentsImpl(Lazy<Optional<StatusBar>> statusBarOptionalLazy) { - mStatusBarOptionalLazy = statusBarOptionalLazy; + public OverviewProxyRecentsImpl(Lazy<Optional<CentralSurfaces>> centralSurfacesOptionalLazy) { + mCentralSurfacesOptionalLazy = centralSurfacesOptionalLazy; } @Override @@ -109,9 +109,10 @@ public class OverviewProxyRecentsImpl implements RecentsImplementation { } }; // Preload only if device for current user is unlocked - final Optional<StatusBar> statusBarOptional = mStatusBarOptionalLazy.get(); - if (statusBarOptional.map(StatusBar::isKeyguardShowing).orElse(false)) { - statusBarOptional.get().executeRunnableDismissingKeyguard(() -> { + final Optional<CentralSurfaces> centralSurfacesOptional = + mCentralSurfacesOptionalLazy.get(); + if (centralSurfacesOptional.map(CentralSurfaces::isKeyguardShowing).orElse(false)) { + centralSurfacesOptional.get().executeRunnableDismissingKeyguard(() -> { mHandler.post(toggleRecents); }, null, true /* dismissShade */, false /* afterKeyguardGone */, true /* deferred */); diff --git a/packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java b/packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java index 7ceaee5fb7bb..a3dea1c68b14 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java +++ b/packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java @@ -102,7 +102,7 @@ import com.android.systemui.shared.system.QuickStepContract; import com.android.systemui.statusbar.CommandQueue; import com.android.systemui.statusbar.NotificationShadeWindowController; import com.android.systemui.statusbar.phone.NotificationPanelViewController; -import com.android.systemui.statusbar.phone.StatusBar; +import com.android.systemui.statusbar.phone.CentralSurfaces; import com.android.systemui.statusbar.phone.StatusBarWindowCallback; import com.android.systemui.statusbar.policy.CallbackController; import com.android.wm.shell.back.BackAnimation; @@ -146,7 +146,7 @@ public class OverviewProxyService extends CurrentUserTracker implements private final Context mContext; private final Optional<Pip> mPipOptional; - private final Lazy<Optional<StatusBar>> mStatusBarOptionalLazy; + private final Lazy<Optional<CentralSurfaces>> mCentralSurfacesOptionalLazy; private final Optional<SplitScreen> mSplitScreenOptional; private SysUiState mSysUiState; private final Handler mHandler; @@ -186,7 +186,7 @@ public class OverviewProxyService extends CurrentUserTracker implements @Override public void startScreenPinning(int taskId) { verifyCallerAndClearCallingIdentityPostMain("startScreenPinning", () -> - mStatusBarOptionalLazy.get().ifPresent( + mCentralSurfacesOptionalLazy.get().ifPresent( statusBar -> statusBar.showScreenPinningRequest(taskId, false /* allowCancel */))); } @@ -207,9 +207,9 @@ public class OverviewProxyService extends CurrentUserTracker implements public void onStatusBarMotionEvent(MotionEvent event) { verifyCallerAndClearCallingIdentity("onStatusBarMotionEvent", () -> { // TODO move this logic to message queue - mStatusBarOptionalLazy.get().ifPresent(statusBar -> { + mCentralSurfacesOptionalLazy.get().ifPresent(centralSurfaces -> { if (event.getActionMasked() == ACTION_DOWN) { - statusBar.getPanelController().startExpandLatencyTracking(); + centralSurfaces.getPanelController().startExpandLatencyTracking(); } mHandler.post(() -> { int action = event.getActionMasked(); @@ -217,7 +217,7 @@ public class OverviewProxyService extends CurrentUserTracker implements mInputFocusTransferStarted = true; mInputFocusTransferStartY = event.getY(); mInputFocusTransferStartMillis = event.getEventTime(); - statusBar.onInputFocusTransfer( + centralSurfaces.onInputFocusTransfer( mInputFocusTransferStarted, false /* cancel */, 0 /* velocity */); } @@ -225,7 +225,7 @@ public class OverviewProxyService extends CurrentUserTracker implements mInputFocusTransferStarted = false; float velocity = (event.getY() - mInputFocusTransferStartY) / (event.getEventTime() - mInputFocusTransferStartMillis); - statusBar.onInputFocusTransfer(mInputFocusTransferStarted, + centralSurfaces.onInputFocusTransfer(mInputFocusTransferStarted, action == ACTION_CANCEL, velocity); } @@ -401,7 +401,7 @@ public class OverviewProxyService extends CurrentUserTracker implements @Override public void toggleNotificationPanel() { verifyCallerAndClearCallingIdentityPostMain("toggleNotificationPanel", () -> - mStatusBarOptionalLazy.get().ifPresent(StatusBar::togglePanel)); + mCentralSurfacesOptionalLazy.get().ifPresent(CentralSurfaces::togglePanel)); } @@ -555,7 +555,7 @@ public class OverviewProxyService extends CurrentUserTracker implements @Inject public OverviewProxyService(Context context, CommandQueue commandQueue, Lazy<NavigationBarController> navBarControllerLazy, - Lazy<Optional<StatusBar>> statusBarOptionalLazy, + Lazy<Optional<CentralSurfaces>> centralSurfacesOptionalLazy, NavigationModeController navModeController, NotificationShadeWindowController statusBarWinController, SysUiState sysUiState, Optional<Pip> pipOptional, @@ -573,7 +573,7 @@ public class OverviewProxyService extends CurrentUserTracker implements super(broadcastDispatcher); mContext = context; mPipOptional = pipOptional; - mStatusBarOptionalLazy = statusBarOptionalLazy; + mCentralSurfacesOptionalLazy = centralSurfacesOptionalLazy; mHandler = new Handler(); mNavBarControllerLazy = navBarControllerLazy; mStatusBarWinController = statusBarWinController; @@ -665,7 +665,7 @@ public class OverviewProxyService extends CurrentUserTracker implements final NavigationBarView navBarView = mNavBarControllerLazy.get().getNavigationBarView(mContext.getDisplayId()); final NotificationPanelViewController panelController = - mStatusBarOptionalLazy.get().get().getPanelController(); + mCentralSurfacesOptionalLazy.get().get().getPanelController(); if (SysUiState.DEBUG) { Log.d(TAG_OPS, "Updating sysui state flags: navBarFragment=" + navBarFragment + " navBarView=" + navBarView + " panelController=" + panelController); @@ -731,9 +731,9 @@ public class OverviewProxyService extends CurrentUserTracker implements public void cleanupAfterDeath() { if (mInputFocusTransferStarted) { mHandler.post(() -> { - mStatusBarOptionalLazy.get().ifPresent(statusBar -> { + mCentralSurfacesOptionalLazy.get().ifPresent(centralSurfaces -> { mInputFocusTransferStarted = false; - statusBar.onInputFocusTransfer(false, true /* cancel */, 0 /* velocity */); + centralSurfaces.onInputFocusTransfer(false, true /* cancel */, 0 /* velocity */); }); }); } diff --git a/packages/SystemUI/src/com/android/systemui/recents/ScreenPinningRequest.java b/packages/SystemUI/src/com/android/systemui/recents/ScreenPinningRequest.java index 7f130cb203c0..15ad7798b3a3 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/ScreenPinningRequest.java +++ b/packages/SystemUI/src/com/android/systemui/recents/ScreenPinningRequest.java @@ -56,7 +56,7 @@ import com.android.systemui.navigationbar.NavigationBarView; import com.android.systemui.navigationbar.NavigationModeController; import com.android.systemui.shared.system.QuickStepContract; import com.android.systemui.shared.system.WindowManagerWrapper; -import com.android.systemui.statusbar.phone.StatusBar; +import com.android.systemui.statusbar.phone.CentralSurfaces; import com.android.systemui.util.leak.RotationUtils; import java.util.ArrayList; @@ -70,7 +70,7 @@ public class ScreenPinningRequest implements View.OnClickListener, NavigationModeController.ModeChangedListener { private final Context mContext; - private final Lazy<Optional<StatusBar>> mStatusBarOptionalLazy; + private final Lazy<Optional<CentralSurfaces>> mCentralSurfacesOptionalLazy; private final AccessibilityManager mAccessibilityService; private final WindowManager mWindowManager; @@ -83,9 +83,11 @@ public class ScreenPinningRequest implements View.OnClickListener, private int taskId; @Inject - public ScreenPinningRequest(Context context, Lazy<Optional<StatusBar>> statusBarOptionalLazy) { + public ScreenPinningRequest( + Context context, + Lazy<Optional<CentralSurfaces>> centralSurfacesOptionalLazy) { mContext = context; - mStatusBarOptionalLazy = statusBarOptionalLazy; + mCentralSurfacesOptionalLazy = centralSurfacesOptionalLazy; mAccessibilityService = (AccessibilityManager) mContext.getSystemService(Context.ACCESSIBILITY_SERVICE); mWindowManager = (WindowManager) @@ -267,9 +269,10 @@ public class ScreenPinningRequest implements View.OnClickListener, .setVisibility(View.INVISIBLE); } - final Optional<StatusBar> statusBarOptional = mStatusBarOptionalLazy.get(); + final Optional<CentralSurfaces> centralSurfacesOptional = + mCentralSurfacesOptionalLazy.get(); NavigationBarView navigationBarView = - statusBarOptional.map(StatusBar::getNavigationBarView).orElse(null); + centralSurfacesOptional.map(CentralSurfaces::getNavigationBarView).orElse(null); final boolean recentsVisible = navigationBarView != null && navigationBarView.isRecentsButtonVisible(); boolean touchExplorationEnabled = mAccessibilityService.isTouchExplorationEnabled(); diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/ActionProxyReceiver.java b/packages/SystemUI/src/com/android/systemui/screenshot/ActionProxyReceiver.java index f14044682b61..daaa897374cb 100644 --- a/packages/SystemUI/src/com/android/systemui/screenshot/ActionProxyReceiver.java +++ b/packages/SystemUI/src/com/android/systemui/screenshot/ActionProxyReceiver.java @@ -24,7 +24,7 @@ import static com.android.systemui.screenshot.ScreenshotController.EXTRA_ACTION_ import static com.android.systemui.screenshot.ScreenshotController.EXTRA_DISALLOW_ENTER_PIP; import static com.android.systemui.screenshot.ScreenshotController.EXTRA_ID; import static com.android.systemui.screenshot.ScreenshotController.EXTRA_SMART_ACTIONS_ENABLED; -import static com.android.systemui.statusbar.phone.StatusBar.SYSTEM_DIALOG_REASON_SCREENSHOT; +import static com.android.systemui.statusbar.phone.CentralSurfaces.SYSTEM_DIALOG_REASON_SCREENSHOT; import android.app.ActivityOptions; import android.app.PendingIntent; @@ -36,7 +36,7 @@ import android.view.RemoteAnimationAdapter; import android.view.WindowManagerGlobal; import com.android.systemui.shared.system.ActivityManagerWrapper; -import com.android.systemui.statusbar.phone.StatusBar; +import com.android.systemui.statusbar.phone.CentralSurfaces; import java.util.Optional; @@ -49,15 +49,15 @@ import javax.inject.Inject; public class ActionProxyReceiver extends BroadcastReceiver { private static final String TAG = "ActionProxyReceiver"; - private final StatusBar mStatusBar; + private final CentralSurfaces mCentralSurfaces; private final ActivityManagerWrapper mActivityManagerWrapper; private final ScreenshotSmartActions mScreenshotSmartActions; @Inject - public ActionProxyReceiver(Optional<StatusBar> statusBar, + public ActionProxyReceiver(Optional<CentralSurfaces> centralSurfacesOptional, ActivityManagerWrapper activityManagerWrapper, ScreenshotSmartActions screenshotSmartActions) { - mStatusBar = statusBar.orElse(null); + mCentralSurfaces = centralSurfacesOptional.orElse(null); mActivityManagerWrapper = activityManagerWrapper; mScreenshotSmartActions = screenshotSmartActions; } @@ -89,8 +89,8 @@ public class ActionProxyReceiver extends BroadcastReceiver { }; - if (mStatusBar != null) { - mStatusBar.executeRunnableDismissingKeyguard(startActivityRunnable, null, + if (mCentralSurfaces != null) { + mCentralSurfaces.executeRunnableDismissingKeyguard(startActivityRunnable, null, true /* dismissShade */, true /* afterKeyguardGone */, true /* deferred */); } else { diff --git a/packages/SystemUI/src/com/android/systemui/settings/brightness/BrightnessController.java b/packages/SystemUI/src/com/android/systemui/settings/brightness/BrightnessController.java index 991a68fb056a..7801c68586f1 100644 --- a/packages/SystemUI/src/com/android/systemui/settings/brightness/BrightnessController.java +++ b/packages/SystemUI/src/com/android/systemui/settings/brightness/BrightnessController.java @@ -54,7 +54,7 @@ import com.android.systemui.statusbar.policy.BrightnessMirrorController; import javax.inject.Inject; public class BrightnessController implements ToggleSlider.Listener, MirroredBrightnessController { - private static final String TAG = "StatusBar.BrightnessController"; + private static final String TAG = "CentralSurfaces.BrightnessController"; private static final int SLIDER_ANIMATION_DURATION = 3000; private static final int MSG_UPDATE_SLIDER = 1; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java b/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java index 645c5accb541..8a02e5952659 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java @@ -23,7 +23,7 @@ import static android.inputmethodservice.InputMethodService.IME_INVISIBLE; import static android.view.Display.DEFAULT_DISPLAY; import static android.view.Display.INVALID_DISPLAY; -import static com.android.systemui.statusbar.phone.StatusBar.ONLY_CORE_APPS; +import static com.android.systemui.statusbar.phone.CentralSurfaces.ONLY_CORE_APPS; import android.annotation.Nullable; import android.app.ITransientNotificationCallback; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/LockscreenShadeTransitionController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/LockscreenShadeTransitionController.kt index 8a9d6ddb2e14..17f42b1a3a43 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/LockscreenShadeTransitionController.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/LockscreenShadeTransitionController.kt @@ -38,7 +38,7 @@ import com.android.systemui.statusbar.phone.KeyguardBypassController import com.android.systemui.statusbar.phone.LSShadeTransitionLogger import com.android.systemui.statusbar.phone.NotificationPanelViewController import com.android.systemui.statusbar.phone.ScrimController -import com.android.systemui.statusbar.phone.StatusBar +import com.android.systemui.statusbar.phone.CentralSurfaces import com.android.systemui.statusbar.policy.ConfigurationController import com.android.systemui.util.Utils import java.io.FileDescriptor @@ -73,7 +73,7 @@ class LockscreenShadeTransitionController @Inject constructor( private var useSplitShade: Boolean = false private lateinit var nsslController: NotificationStackScrollLayoutController lateinit var notificationPanelController: NotificationPanelViewController - lateinit var statusbar: StatusBar + lateinit var centralSurfaces: CentralSurfaces lateinit var qS: QS /** @@ -197,7 +197,7 @@ class LockscreenShadeTransitionController @Inject constructor( // Bind the click listener of the shelf to go to the full shade notificationShelfController.setOnClickListener { if (statusBarStateController.state == StatusBarState.KEYGUARD) { - statusbar.wakeUpIfDozing(SystemClock.uptimeMillis(), it, "SHADE_CLICK") + centralSurfaces.wakeUpIfDozing(SystemClock.uptimeMillis(), it, "SHADE_CLICK") goToLockedShade(it) } } @@ -224,7 +224,7 @@ class LockscreenShadeTransitionController @Inject constructor( if (nsslController.isInLockedDownShade()) { logger.logDraggedDownLockDownShade(startingChild) statusBarStateController.setLeaveOpenOnKeyguardHide(true) - statusbar.dismissKeyguardThenExecute(OnDismissAction { + centralSurfaces.dismissKeyguardThenExecute(OnDismissAction { nextHideKeyguardNeedsNoAnimation = true false }, cancelRunnable, false /* afterKeyguardGone */) @@ -361,7 +361,7 @@ class LockscreenShadeTransitionController @Inject constructor( notificationPanelController.setKeyguardOnlyContentAlpha(1.0f - scrimProgress) depthController.transitionToFullShadeProgress = scrimProgress udfpsKeyguardViewController?.setTransitionToFullShadeProgress(scrimProgress) - statusbar.setTransitionToFullShadeProgress(scrimProgress) + centralSurfaces.setTransitionToFullShadeProgress(scrimProgress) } private fun setDragDownAmountAnimated( @@ -461,7 +461,7 @@ class LockscreenShadeTransitionController @Inject constructor( animationHandler: ((Long) -> Unit)? = null, cancelAction: Runnable? = null ) { - if (statusbar.isShadeDisabled) { + if (centralSurfaces.isShadeDisabled) { cancelAction?.run() logger.logShadeDisabledOnGoToLockedShade() return @@ -503,7 +503,7 @@ class LockscreenShadeTransitionController @Inject constructor( cancelAction?.run() } logger.logShowBouncerOnGoToLockedShade() - statusbar.showBouncerWithDimissAndCancelIfKeyguard(onDismissAction, cancelHandler) + centralSurfaces.showBouncerWithDimissAndCancelIfKeyguard(onDismissAction, cancelHandler) draggedDownEntry = entry } else { logger.logGoingToLockedShade(animationHandler != null) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationListener.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationListener.java index 01bdb401e00c..68d35f9679ed 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationListener.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationListener.java @@ -32,10 +32,10 @@ import android.util.Log; import com.android.systemui.dagger.SysUISingleton; import com.android.systemui.dagger.qualifiers.Main; import com.android.systemui.shared.plugins.PluginManager; -import com.android.systemui.statusbar.dagger.StatusBarModule; +import com.android.systemui.statusbar.dagger.CentralSurfacesModule; import com.android.systemui.statusbar.notification.collection.NotifCollection; +import com.android.systemui.statusbar.phone.CentralSurfaces; import com.android.systemui.statusbar.phone.NotificationListenerWithPlugins; -import com.android.systemui.statusbar.phone.StatusBar; import com.android.systemui.util.time.SystemClock; import java.util.ArrayList; @@ -54,7 +54,7 @@ import javax.inject.Inject; @SuppressLint("OverrideAbstract") public class NotificationListener extends NotificationListenerWithPlugins { private static final String TAG = "NotificationListener"; - private static final boolean DEBUG = StatusBar.DEBUG; + private static final boolean DEBUG = CentralSurfaces.DEBUG; private static final long MAX_RANKING_DELAY_MILLIS = 500L; private final Context mContext; @@ -69,7 +69,7 @@ public class NotificationListener extends NotificationListenerWithPlugins { private long mSkippingRankingUpdatesSince = -1; /** - * Injected constructor. See {@link StatusBarModule}. + * Injected constructor. See {@link CentralSurfacesModule}. */ @Inject public NotificationListener( diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationMediaManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationMediaManager.java index 3730d123021b..052c57e768fe 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationMediaManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationMediaManager.java @@ -16,9 +16,9 @@ package com.android.systemui.statusbar; import static com.android.systemui.statusbar.StatusBarState.KEYGUARD; -import static com.android.systemui.statusbar.phone.StatusBar.DEBUG_MEDIA_FAKE_ARTWORK; -import static com.android.systemui.statusbar.phone.StatusBar.ENABLE_LOCKSCREEN_WALLPAPER; -import static com.android.systemui.statusbar.phone.StatusBar.SHOW_LOCKSCREEN_MEDIA_ARTWORK; +import static com.android.systemui.statusbar.phone.CentralSurfaces.DEBUG_MEDIA_FAKE_ARTWORK; +import static com.android.systemui.statusbar.phone.CentralSurfaces.ENABLE_LOCKSCREEN_WALLPAPER; +import static com.android.systemui.statusbar.phone.CentralSurfaces.SHOW_LOCKSCREEN_MEDIA_ARTWORK; import android.annotation.MainThread; import android.annotation.NonNull; @@ -55,7 +55,7 @@ import com.android.systemui.media.MediaData; import com.android.systemui.media.MediaDataManager; import com.android.systemui.media.SmartspaceMediaData; import com.android.systemui.plugins.statusbar.StatusBarStateController; -import com.android.systemui.statusbar.dagger.StatusBarModule; +import com.android.systemui.statusbar.dagger.CentralSurfacesModule; import com.android.systemui.statusbar.notification.NotifPipelineFlags; import com.android.systemui.statusbar.notification.NotificationEntryListener; import com.android.systemui.statusbar.notification.NotificationEntryManager; @@ -66,11 +66,11 @@ import com.android.systemui.statusbar.notification.collection.notifcollection.Di import com.android.systemui.statusbar.notification.collection.notifcollection.NotifCollectionListener; import com.android.systemui.statusbar.notification.collection.render.NotificationVisibilityProvider; import com.android.systemui.statusbar.phone.BiometricUnlockController; +import com.android.systemui.statusbar.phone.CentralSurfaces; import com.android.systemui.statusbar.phone.KeyguardBypassController; import com.android.systemui.statusbar.phone.LockscreenWallpaper; import com.android.systemui.statusbar.phone.ScrimController; import com.android.systemui.statusbar.phone.ScrimState; -import com.android.systemui.statusbar.phone.StatusBar; import com.android.systemui.statusbar.policy.KeyguardStateController; import com.android.systemui.util.Utils; import com.android.systemui.util.concurrency.DelayableExecutor; @@ -131,7 +131,7 @@ public class NotificationMediaManager implements Dumpable { private final Context mContext; private final ArrayList<MediaListener> mMediaListeners; - private final Lazy<Optional<StatusBar>> mStatusBarOptionalLazy; + private final Lazy<Optional<CentralSurfaces>> mCentralSurfacesOptionalLazy; private final MediaArtworkProcessor mMediaArtworkProcessor; private final Set<AsyncTask<?, ?, ?>> mProcessArtworkTasks = new ArraySet<>(); @@ -172,11 +172,11 @@ public class NotificationMediaManager implements Dumpable { }; /** - * Injected constructor. See {@link StatusBarModule}. + * Injected constructor. See {@link CentralSurfacesModule}. */ public NotificationMediaManager( Context context, - Lazy<Optional<StatusBar>> statusBarOptionalLazy, + Lazy<Optional<CentralSurfaces>> centralSurfacesOptionalLazy, Lazy<NotificationShadeWindowController> notificationShadeWindowController, NotificationVisibilityProvider visibilityProvider, NotificationEntryManager notificationEntryManager, @@ -193,7 +193,7 @@ public class NotificationMediaManager implements Dumpable { mKeyguardBypassController = keyguardBypassController; mMediaListeners = new ArrayList<>(); // TODO: use KeyguardStateController#isOccluded to remove this dependency - mStatusBarOptionalLazy = statusBarOptionalLazy; + mCentralSurfacesOptionalLazy = centralSurfacesOptionalLazy; mNotificationShadeWindowController = notificationShadeWindowController; mVisibilityProvider = visibilityProvider; mEntryManager = notificationEntryManager; @@ -575,7 +575,7 @@ public class NotificationMediaManager implements Dumpable { * Refresh or remove lockscreen artwork from media metadata or the lockscreen wallpaper. */ public void updateMediaMetaData(boolean metaDataChanged, boolean allowEnterAnimation) { - Trace.beginSection("StatusBar#updateMediaMetaData"); + Trace.beginSection("CentralSurfaces#updateMediaMetaData"); if (!SHOW_LOCKSCREEN_MEDIA_ARTWORK) { Trace.endSection(); return; @@ -653,7 +653,8 @@ public class NotificationMediaManager implements Dumpable { NotificationShadeWindowController windowController = mNotificationShadeWindowController.get(); boolean hideBecauseOccluded = - mStatusBarOptionalLazy.get().map(StatusBar::isOccluded).orElse(false); + mCentralSurfacesOptionalLazy.get() + .map(CentralSurfaces::isOccluded).orElse(false); final boolean hasArtwork = artworkDrawable != null; mColorExtractor.setHasMediaArtwork(hasMediaArtwork); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationPresenter.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationPresenter.java index 17bf346fa22b..3b3b5a2d05f9 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationPresenter.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationPresenter.java @@ -19,7 +19,7 @@ import com.android.systemui.statusbar.notification.row.ActivatableNotificationVi import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow; /** - * An abstraction of something that presents notifications, e.g. StatusBar. Contains methods + * An abstraction of something that presents notifications, e.g. CentralSurfaces. Contains methods * for both querying the state of the system (some modularised piece of functionality may * want to act differently based on e.g. whether the presenter is visible to the user or not) and * for affecting the state of the system (e.g. starting an intent, given that the presenter may diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java index 2b5453a56434..94a6d3e99842 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java @@ -55,7 +55,7 @@ import com.android.systemui.R; import com.android.systemui.dagger.qualifiers.Main; import com.android.systemui.dump.DumpManager; import com.android.systemui.plugins.statusbar.StatusBarStateController; -import com.android.systemui.statusbar.dagger.StatusBarDependenciesModule; +import com.android.systemui.statusbar.dagger.CentralSurfacesDependenciesModule; import com.android.systemui.statusbar.notification.NotifPipelineFlags; import com.android.systemui.statusbar.notification.NotificationEntryListener; import com.android.systemui.statusbar.notification.NotificationEntryManager; @@ -64,7 +64,7 @@ import com.android.systemui.statusbar.notification.collection.NotificationEntry. import com.android.systemui.statusbar.notification.collection.render.NotificationVisibilityProvider; import com.android.systemui.statusbar.notification.logging.NotificationLogger; import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow; -import com.android.systemui.statusbar.phone.StatusBar; +import com.android.systemui.statusbar.phone.CentralSurfaces; import com.android.systemui.statusbar.policy.RemoteInputUriController; import com.android.systemui.statusbar.policy.RemoteInputView; import com.android.systemui.util.DumpUtilsKt; @@ -103,7 +103,7 @@ public class NotificationRemoteInputManager implements Dumpable { private final Handler mMainHandler; private final ActionClickLogger mLogger; - private final Lazy<Optional<StatusBar>> mStatusBarOptionalLazy; + private final Lazy<Optional<CentralSurfaces>> mCentralSurfacesOptionalLazy; protected final Context mContext; protected final NotifPipelineFlags mNotifPipelineFlags; @@ -125,8 +125,8 @@ public class NotificationRemoteInputManager implements Dumpable { @Override public boolean onInteraction( View view, PendingIntent pendingIntent, RemoteViews.RemoteResponse response) { - mStatusBarOptionalLazy.get().ifPresent( - statusBar -> statusBar.wakeUpIfDozing( + mCentralSurfacesOptionalLazy.get().ifPresent( + centralSurfaces -> centralSurfaces.wakeUpIfDozing( SystemClock.uptimeMillis(), view, "NOTIFICATION_CLICK")); final NotificationEntry entry = getNotificationForParent(view.getParent()); @@ -253,7 +253,7 @@ public class NotificationRemoteInputManager implements Dumpable { }; /** - * Injected constructor. See {@link StatusBarDependenciesModule}. + * Injected constructor. See {@link CentralSurfacesDependenciesModule}. */ public NotificationRemoteInputManager( Context context, @@ -263,7 +263,7 @@ public class NotificationRemoteInputManager implements Dumpable { NotificationVisibilityProvider visibilityProvider, NotificationEntryManager notificationEntryManager, RemoteInputNotificationRebuilder rebuilder, - Lazy<Optional<StatusBar>> statusBarOptionalLazy, + Lazy<Optional<CentralSurfaces>> centralSurfacesOptionalLazy, StatusBarStateController statusBarStateController, @Main Handler mainHandler, RemoteInputUriController remoteInputUriController, @@ -276,7 +276,7 @@ public class NotificationRemoteInputManager implements Dumpable { mSmartReplyController = smartReplyController; mVisibilityProvider = visibilityProvider; mEntryManager = notificationEntryManager; - mStatusBarOptionalLazy = statusBarOptionalLazy; + mCentralSurfacesOptionalLazy = centralSurfacesOptionalLazy; mMainHandler = mainHandler; mLogger = logger; mBarService = IStatusBarService.Stub.asInterface( diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationViewHierarchyManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationViewHierarchyManager.java index 3f101bb7cfd8..054543c7d2b1 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationViewHierarchyManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationViewHierarchyManager.java @@ -32,7 +32,7 @@ import com.android.systemui.R; import com.android.systemui.dagger.qualifiers.Main; import com.android.systemui.flags.FeatureFlags; import com.android.systemui.plugins.statusbar.StatusBarStateController; -import com.android.systemui.statusbar.dagger.StatusBarModule; +import com.android.systemui.statusbar.dagger.CentralSurfacesModule; import com.android.systemui.statusbar.notification.AssistantFeedbackController; import com.android.systemui.statusbar.notification.DynamicChildBindController; import com.android.systemui.statusbar.notification.DynamicPrivacyController; @@ -113,7 +113,7 @@ public class NotificationViewHierarchyManager implements DynamicPrivacyControlle private boolean mIsHandleDynamicPrivacyChangeScheduled; /** - * Injected constructor. See {@link StatusBarModule}. + * Injected constructor. See {@link CentralSurfacesModule}. */ public NotificationViewHierarchyManager( Context context, diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/QsFrameTranslateController.java b/packages/SystemUI/src/com/android/systemui/statusbar/QsFrameTranslateController.java index 2e1762a26b7e..78077386179a 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/QsFrameTranslateController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/QsFrameTranslateController.java @@ -20,17 +20,17 @@ import android.view.View; import com.android.systemui.plugins.qs.QS; import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayoutController; -import com.android.systemui.statusbar.phone.StatusBar; +import com.android.systemui.statusbar.phone.CentralSurfaces; /** * Calculates and moves the QS frame vertically. */ public abstract class QsFrameTranslateController { - protected StatusBar mStatusBar; + protected CentralSurfaces mCentralSurfaces; - public QsFrameTranslateController(StatusBar statusBar) { - mStatusBar = statusBar; + public QsFrameTranslateController(CentralSurfaces centralSurfaces) { + mCentralSurfaces = centralSurfaces; } /** diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/QsFrameTranslateImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/QsFrameTranslateImpl.java index c15679709c3d..33e224579bef 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/QsFrameTranslateImpl.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/QsFrameTranslateImpl.java @@ -21,7 +21,7 @@ import android.view.View; import com.android.systemui.dagger.SysUISingleton; import com.android.systemui.plugins.qs.QS; import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayoutController; -import com.android.systemui.statusbar.phone.StatusBar; +import com.android.systemui.statusbar.phone.CentralSurfaces; import javax.inject.Inject; @@ -32,8 +32,8 @@ import javax.inject.Inject; public class QsFrameTranslateImpl extends QsFrameTranslateController { @Inject - public QsFrameTranslateImpl(StatusBar statusBar) { - super(statusBar); + public QsFrameTranslateImpl(CentralSurfaces centralSurfaces) { + super(centralSurfaces); } @Override diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/SmartReplyController.java b/packages/SystemUI/src/com/android/systemui/statusbar/SmartReplyController.java index 4ad01aab98a7..058edda20971 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/SmartReplyController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/SmartReplyController.java @@ -25,7 +25,7 @@ import com.android.internal.statusbar.IStatusBarService; import com.android.internal.statusbar.NotificationVisibility; import com.android.systemui.Dumpable; import com.android.systemui.dump.DumpManager; -import com.android.systemui.statusbar.dagger.StatusBarModule; +import com.android.systemui.statusbar.dagger.CentralSurfacesModule; import com.android.systemui.statusbar.notification.collection.NotificationEntry; import com.android.systemui.statusbar.notification.collection.render.NotificationVisibilityProvider; @@ -45,7 +45,7 @@ public class SmartReplyController implements Dumpable { private Callback mCallback; /** - * Injected constructor. See {@link StatusBarModule}. + * Injected constructor. See {@link CentralSurfacesModule}. */ public SmartReplyController( DumpManager dumpManager, diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarStateControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarStateControllerImpl.java index 02870a382056..2763bd711338 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarStateControllerImpl.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarStateControllerImpl.java @@ -420,8 +420,9 @@ public class StatusBarStateControllerImpl implements * notified before unranked, and we will sort ranked listeners from low to high * * @deprecated This method exists only to solve latent inter-dependencies from refactoring - * StatusBarState out of StatusBar.java. Any new listeners should be built not to need ranking - * (i.e., they are non-dependent on the order of operations of StatusBarState listeners). + * StatusBarState out of CentralSurfaces.java. Any new listeners should be built not to need + * ranking (i.e., they are non-dependent on the order of operations of StatusBarState + * listeners). */ @Deprecated @Override diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/SysuiStatusBarStateController.java b/packages/SystemUI/src/com/android/systemui/statusbar/SysuiStatusBarStateController.java index f0b2c2d54dbe..2b3190159ecd 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/SysuiStatusBarStateController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/SysuiStatusBarStateController.java @@ -25,7 +25,7 @@ import android.view.WindowInsetsController.Appearance; import android.view.WindowInsetsController.Behavior; import com.android.systemui.plugins.statusbar.StatusBarStateController; -import com.android.systemui.statusbar.phone.StatusBar; +import com.android.systemui.statusbar.phone.CentralSurfaces; import java.lang.annotation.Retention; @@ -51,8 +51,9 @@ public interface SysuiStatusBarStateController extends StatusBarStateController * notified before unranked, and we will sort ranked listeners from low to high * * @deprecated This method exists only to solve latent inter-dependencies from refactoring - * StatusBarState out of StatusBar.java. Any new listeners should be built not to need ranking - * (i.e., they are non-dependent on the order of operations of StatusBarState listeners). + * StatusBarState out of CentralSurfaces.java. Any new listeners should be built not to need + * ranking (i.e., they are non-dependent on the order of operations of StatusBarState + * listeners). */ @Deprecated void addCallback(StateListener listener, int rank); @@ -91,7 +92,7 @@ public interface SysuiStatusBarStateController extends StatusBarStateController int getCurrentOrUpcomingState(); /** - * Update the dozing state from {@link StatusBar}'s perspective + * Update the dozing state from {@link CentralSurfaces}'s perspective * @param isDozing well, are we dozing? * @return {@code true} if the state changed, else {@code false} */ @@ -116,7 +117,7 @@ public interface SysuiStatusBarStateController extends StatusBarStateController void setAndInstrumentDozeAmount(View view, float dozeAmount, boolean animated); /** - * Update the expanded state from {@link StatusBar}'s perspective + * Update the expanded state from {@link CentralSurfaces}'s perspective * @param expanded are we expanded? * @return {@code true} if the state changed, else {@code false} */ diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/connectivity/MobileSignalController.java b/packages/SystemUI/src/com/android/systemui/statusbar/connectivity/MobileSignalController.java index fe5a69996eb7..41d2b655d805 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/connectivity/MobileSignalController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/connectivity/MobileSignalController.java @@ -843,7 +843,7 @@ public class MobileSignalController extends SignalController<MobileState, Mobile } } - /** Box for StatusBar icon info */ + /** Box for status bar icon info */ private static final class SbInfo { final boolean showTriangle; final int ratTypeIcon; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/core/StatusBarInitializer.kt b/packages/SystemUI/src/com/android/systemui/statusbar/core/StatusBarInitializer.kt index d65fa3acfa37..a62a152ab7f4 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/core/StatusBarInitializer.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/core/StatusBarInitializer.kt @@ -21,18 +21,18 @@ import com.android.systemui.fragments.FragmentHostManager import com.android.systemui.statusbar.phone.PhoneStatusBarTransitions import com.android.systemui.statusbar.phone.PhoneStatusBarView import com.android.systemui.statusbar.phone.PhoneStatusBarViewController -import com.android.systemui.statusbar.phone.dagger.StatusBarComponent -import com.android.systemui.statusbar.phone.dagger.StatusBarComponent.StatusBarScope +import com.android.systemui.statusbar.phone.dagger.CentralSurfacesComponent +import com.android.systemui.statusbar.phone.dagger.CentralSurfacesComponent.CentralSurfacesScope import com.android.systemui.statusbar.phone.fragment.CollapsedStatusBarFragment import com.android.systemui.statusbar.window.StatusBarWindowController import java.lang.IllegalStateException import javax.inject.Inject /** - * Responsible for creating the StatusBar window and initializing the root components of that window - * (see [CollapsedStatusBarFragment]) + * Responsible for creating the status bar window and initializing the root components of that + * window (see [CollapsedStatusBarFragment]) */ -@StatusBarScope +@CentralSurfacesScope class StatusBarInitializer @Inject constructor( private val windowController: StatusBarWindowController ) { @@ -43,7 +43,7 @@ class StatusBarInitializer @Inject constructor( * Creates the status bar window and root views, and initializes the component */ fun initializeStatusBar( - sbComponent: StatusBarComponent + centralSurfacesComponent: CentralSurfacesComponent ) { windowController.fragmentHostManager.addTagListener( CollapsedStatusBarFragment.TAG, @@ -64,7 +64,7 @@ class StatusBarInitializer @Inject constructor( }).fragmentManager .beginTransaction() .replace(R.id.status_bar_container, - sbComponent.createCollapsedStatusBarFragment(), + centralSurfacesComponent.createCollapsedStatusBarFragment(), CollapsedStatusBarFragment.TAG) .commit() } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/dagger/StatusBarDependenciesModule.java b/packages/SystemUI/src/com/android/systemui/statusbar/dagger/CentralSurfacesDependenciesModule.java index 364f36a388c6..83290af24f2a 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/dagger/StatusBarDependenciesModule.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/dagger/CentralSurfacesDependenciesModule.java @@ -60,10 +60,10 @@ import com.android.systemui.statusbar.notification.collection.legacy.Notificatio import com.android.systemui.statusbar.notification.collection.legacy.VisualStabilityManager; import com.android.systemui.statusbar.notification.collection.notifcollection.CommonNotifCollection; import com.android.systemui.statusbar.notification.collection.render.NotificationVisibilityProvider; +import com.android.systemui.statusbar.phone.CentralSurfaces; import com.android.systemui.statusbar.phone.KeyguardBypassController; import com.android.systemui.statusbar.phone.ManagedProfileController; import com.android.systemui.statusbar.phone.ManagedProfileControllerImpl; -import com.android.systemui.statusbar.phone.StatusBar; import com.android.systemui.statusbar.phone.StatusBarIconController; import com.android.systemui.statusbar.phone.StatusBarIconControllerImpl; import com.android.systemui.statusbar.phone.StatusBarRemoteInputCallback; @@ -87,12 +87,13 @@ import dagger.Module; import dagger.Provides; /** - * This module provides instances needed to construct {@link StatusBar}. These are moved to this - * separate from {@link StatusBarModule} module so that components that wish to build their own - * version of StatusBar can include just dependencies, without injecting StatusBar itself. + * This module provides instances needed to construct {@link CentralSurfaces}. These are moved to + * this separate from {@link CentralSurfacesModule} module so that components that wish to build + * their own version of CentralSurfaces can include just dependencies, without injecting + * CentralSurfaces itself. */ @Module -public interface StatusBarDependenciesModule { +public interface CentralSurfacesDependenciesModule { /** */ @SysUISingleton @Provides @@ -104,7 +105,7 @@ public interface StatusBarDependenciesModule { NotificationVisibilityProvider visibilityProvider, NotificationEntryManager notificationEntryManager, RemoteInputNotificationRebuilder rebuilder, - Lazy<Optional<StatusBar>> statusBarOptionalLazy, + Lazy<Optional<CentralSurfaces>> centralSurfacesOptionalLazy, StatusBarStateController statusBarStateController, Handler mainHandler, RemoteInputUriController remoteInputUriController, @@ -119,7 +120,7 @@ public interface StatusBarDependenciesModule { visibilityProvider, notificationEntryManager, rebuilder, - statusBarOptionalLazy, + centralSurfacesOptionalLazy, statusBarStateController, mainHandler, remoteInputUriController, @@ -133,7 +134,7 @@ public interface StatusBarDependenciesModule { @Provides static NotificationMediaManager provideNotificationMediaManager( Context context, - Lazy<Optional<StatusBar>> statusBarOptionalLazy, + Lazy<Optional<CentralSurfaces>> centralSurfacesOptionalLazy, Lazy<NotificationShadeWindowController> notificationShadeWindowController, NotificationVisibilityProvider visibilityProvider, NotificationEntryManager notificationEntryManager, @@ -147,7 +148,7 @@ public interface StatusBarDependenciesModule { DumpManager dumpManager) { return new NotificationMediaManager( context, - statusBarOptionalLazy, + centralSurfacesOptionalLazy, notificationShadeWindowController, visibilityProvider, notificationEntryManager, diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/dagger/StatusBarModule.java b/packages/SystemUI/src/com/android/systemui/statusbar/dagger/CentralSurfacesModule.java index ad5ef2043ccd..99d4b2e525d1 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/dagger/StatusBarModule.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/dagger/CentralSurfacesModule.java @@ -23,7 +23,7 @@ import com.android.systemui.statusbar.phone.dagger.StatusBarPhoneModule; import dagger.Module; /** */ -@Module(includes = {StatusBarPhoneModule.class, StatusBarDependenciesModule.class, +@Module(includes = {StatusBarPhoneModule.class, CentralSurfacesDependenciesModule.class, NotificationsModule.class, NotificationRowModule.class}) -public interface StatusBarModule { +public interface CentralSurfacesModule { } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/dagger/StartStatusBarModule.kt b/packages/SystemUI/src/com/android/systemui/statusbar/dagger/StartCentralSurfacesModule.kt index 46c1abb859b3..fe55dea7333a 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/dagger/StartStatusBarModule.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/dagger/StartCentralSurfacesModule.kt @@ -17,17 +17,17 @@ package com.android.systemui.statusbar.dagger import com.android.systemui.CoreStartable -import com.android.systemui.statusbar.phone.StatusBar +import com.android.systemui.statusbar.phone.CentralSurfaces import dagger.Binds import dagger.Module import dagger.multibindings.ClassKey import dagger.multibindings.IntoMap @Module -interface StartStatusBarModule { - /** Start the StatusBar */ +interface StartCentralSurfacesModule { + /** Start the CentralSurfaces */ @Binds @IntoMap - @ClassKey(StatusBar::class) - abstract fun bindsStatusBar(statusBar: StatusBar): CoreStartable -}
\ No newline at end of file + @ClassKey(CentralSurfaces::class) + abstract fun bindsCentralSurfaces(centralSurfaces: CentralSurfaces): CoreStartable +} diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationClicker.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationClicker.java index da706215863e..392145ad306a 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationClicker.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationClicker.java @@ -24,7 +24,7 @@ import android.view.View; import com.android.systemui.DejankUtils; import com.android.systemui.statusbar.notification.collection.NotificationEntry; import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow; -import com.android.systemui.statusbar.phone.StatusBar; +import com.android.systemui.statusbar.phone.CentralSurfaces; import com.android.wm.shell.bubbles.Bubbles; import java.util.Optional; @@ -39,7 +39,7 @@ public final class NotificationClicker implements View.OnClickListener { private static final String TAG = "NotificationClicker"; private final NotificationClickerLogger mLogger; - private final Optional<StatusBar> mStatusBarOptional; + private final Optional<CentralSurfaces> mCentralSurfacesOptional; private final Optional<Bubbles> mBubblesOptional; private final NotificationActivityStarter mNotificationActivityStarter; @@ -53,11 +53,11 @@ public final class NotificationClicker implements View.OnClickListener { private NotificationClicker( NotificationClickerLogger logger, - Optional<StatusBar> statusBarOptional, + Optional<CentralSurfaces> centralSurfacesOptional, Optional<Bubbles> bubblesOptional, NotificationActivityStarter notificationActivityStarter) { mLogger = logger; - mStatusBarOptional = statusBarOptional; + mCentralSurfacesOptional = centralSurfacesOptional; mBubblesOptional = bubblesOptional; mNotificationActivityStarter = notificationActivityStarter; } @@ -69,7 +69,7 @@ public final class NotificationClicker implements View.OnClickListener { return; } - mStatusBarOptional.ifPresent(statusBar -> statusBar.wakeUpIfDozing( + mCentralSurfacesOptional.ifPresent(centralSurfaces -> centralSurfaces.wakeUpIfDozing( SystemClock.uptimeMillis(), v, "NOTIFICATION_CLICK")); final ExpandableNotificationRow row = (ExpandableNotificationRow) v; @@ -137,13 +137,13 @@ public final class NotificationClicker implements View.OnClickListener { /** Builds an instance. */ public NotificationClicker build( - Optional<StatusBar> statusBarOptional, + Optional<CentralSurfaces> centralSurfacesOptional, Optional<Bubbles> bubblesOptional, NotificationActivityStarter notificationActivityStarter ) { return new NotificationClicker( mLogger, - statusBarOptional, + centralSurfacesOptional, bubblesOptional, notificationActivityStarter); } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationEntryManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationEntryManager.java index 1d96de733eb6..ac5beece880e 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationEntryManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationEntryManager.java @@ -955,7 +955,7 @@ public class NotificationEntryManager implements Trace.endSection(); } - /** dump the current active notification list. Called from StatusBar */ + /** dump the current active notification list. Called from CentralSurfaces */ public void dump(PrintWriter pw, String indent) { pw.println("NotificationEntryManager (Legacy)"); int filteredLen = mSortedAndFiltered.size(); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationLaunchAnimatorController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationLaunchAnimatorController.kt index 92073669e1b5..2c1296f34a42 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationLaunchAnimatorController.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationLaunchAnimatorController.kt @@ -8,14 +8,14 @@ import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow import com.android.systemui.statusbar.notification.stack.NotificationListContainer import com.android.systemui.statusbar.phone.HeadsUpManagerPhone import com.android.systemui.statusbar.phone.NotificationShadeWindowViewController -import com.android.systemui.statusbar.phone.dagger.StatusBarComponent +import com.android.systemui.statusbar.phone.dagger.CentralSurfacesComponent import com.android.systemui.statusbar.policy.HeadsUpUtil import javax.inject.Inject import kotlin.math.ceil import kotlin.math.max /** A provider of [NotificationLaunchAnimatorController]. */ -@StatusBarComponent.StatusBarScope +@CentralSurfacesComponent.CentralSurfacesScope class NotificationLaunchAnimatorControllerProvider @Inject constructor( private val notificationShadeWindowViewController: NotificationShadeWindowViewController, private val notificationListContainer: NotificationListContainer, diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/TargetSdkResolver.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/TargetSdkResolver.kt index 5dc0dcc4d717..c71eade79cdf 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/TargetSdkResolver.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/TargetSdkResolver.kt @@ -23,7 +23,7 @@ import android.util.Log import com.android.systemui.dagger.SysUISingleton import com.android.systemui.statusbar.notification.collection.notifcollection.CommonNotifCollection import com.android.systemui.statusbar.notification.collection.notifcollection.NotifCollectionListener -import com.android.systemui.statusbar.phone.StatusBar +import com.android.systemui.statusbar.phone.CentralSurfaces import javax.inject.Inject @SysUISingleton @@ -39,7 +39,7 @@ class TargetSdkResolver @Inject constructor( } private fun resolveNotificationSdk(sbn: StatusBarNotification): Int { - val pmUser = StatusBar.getPackageManagerForUser(context, sbn.user.identifier) + val pmUser = CentralSurfaces.getPackageManagerForUser(context, sbn.user.identifier) var targetSdk = 0 // Extract target SDK version. try { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/legacy/LegacyNotificationPresenterExtensions.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/legacy/LegacyNotificationPresenterExtensions.java index 4ee08ed4899f..bdbb0eb48e8a 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/legacy/LegacyNotificationPresenterExtensions.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/legacy/LegacyNotificationPresenterExtensions.java @@ -16,7 +16,7 @@ package com.android.systemui.statusbar.notification.collection.legacy; -import static com.android.systemui.statusbar.phone.StatusBar.SPEW; +import static com.android.systemui.statusbar.phone.CentralSurfaces.SPEW; import android.service.notification.StatusBarNotification; import android.util.Log; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/render/NotifPanelEventSource.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/render/NotifPanelEventSource.kt index 920d3c4cbe55..470737e3b772 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/render/NotifPanelEventSource.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/render/NotifPanelEventSource.kt @@ -17,8 +17,8 @@ package com.android.systemui.statusbar.notification.collection.render import com.android.systemui.dagger.SysUISingleton import com.android.systemui.statusbar.phone.NotificationPanelViewController -import com.android.systemui.statusbar.phone.dagger.StatusBarComponent -import com.android.systemui.statusbar.phone.dagger.StatusBarComponent.StatusBarScope +import com.android.systemui.statusbar.phone.dagger.CentralSurfacesComponent +import com.android.systemui.statusbar.phone.dagger.CentralSurfacesComponent.CentralSurfacesScope import com.android.systemui.util.ListenerSet import dagger.Binds import dagger.Module @@ -67,18 +67,18 @@ object StatusBarNotifPanelEventSourceModule { @JvmStatic @Provides @IntoSet - @StatusBarScope + @CentralSurfacesScope fun bindStartable( manager: NotifPanelEventSourceManager, notifPanelController: NotificationPanelViewController - ): StatusBarComponent.Startable = + ): CentralSurfacesComponent.Startable = EventSourceStatusBarStartableImpl(manager, notifPanelController) } /** - * Management layer that bridges [SysUiSingleton] and [StatusBarScope]. Necessary because code that - * wants to listen to [NotifPanelEventSource] lives in [SysUiSingleton], but the events themselves - * come from [NotificationPanelViewController] in [StatusBarScope]. + * Management layer that bridges [SysUiSingleton] and [CentralSurfacesScope]. Necessary because code + * that wants to listen to [NotifPanelEventSource] lives in [SysUiSingleton], but the events + * themselves come from [NotificationPanelViewController] in [CentralSurfacesScope]. */ interface NotifPanelEventSourceManager : NotifPanelEventSource { var eventSource: NotifPanelEventSource? @@ -116,7 +116,7 @@ private class NotifPanelEventSourceManagerImpl private class EventSourceStatusBarStartableImpl( private val manager: NotifPanelEventSourceManager, private val notifPanelController: NotificationPanelViewController -) : StatusBarComponent.Startable { +) : CentralSurfacesComponent.Startable { override fun start() { manager.eventSource = notifPanelController diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/dagger/NotificationsModule.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/dagger/NotificationsModule.java index 1576f96debc6..51bbf1c80478 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/dagger/NotificationsModule.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/dagger/NotificationsModule.java @@ -86,7 +86,7 @@ import com.android.systemui.statusbar.notification.stack.NotificationSectionsMan import com.android.systemui.statusbar.notification.stack.StackScrollAlgorithm; import com.android.systemui.statusbar.phone.KeyguardBypassController; import com.android.systemui.statusbar.phone.ShadeController; -import com.android.systemui.statusbar.phone.StatusBar; +import com.android.systemui.statusbar.phone.CentralSurfaces; import com.android.systemui.statusbar.policy.HeadsUpManager; import com.android.systemui.util.leak.LeakDetector; import com.android.systemui.wmshell.BubblesManager; @@ -149,7 +149,7 @@ public interface NotificationsModule { @Provides static NotificationGutsManager provideNotificationGutsManager( Context context, - Lazy<Optional<StatusBar>> statusBarOptionalLazy, + Lazy<Optional<CentralSurfaces>> centralSurfacesOptionalLazy, @Main Handler mainHandler, @Background Handler bgHandler, AccessibilityManager accessibilityManager, @@ -169,7 +169,7 @@ public interface NotificationsModule { DumpManager dumpManager) { return new NotificationGutsManager( context, - statusBarOptionalLazy, + centralSurfacesOptionalLazy, mainHandler, bgHandler, accessibilityManager, diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/init/NotificationsControllerImpl.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/init/NotificationsControllerImpl.kt index 5926cf05f880..98f45fa070c9 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/init/NotificationsControllerImpl.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/init/NotificationsControllerImpl.kt @@ -44,7 +44,7 @@ import com.android.systemui.statusbar.notification.interruption.HeadsUpViewBinde import com.android.systemui.statusbar.notification.row.NotifBindPipelineInitializer import com.android.systemui.statusbar.notification.stack.NotificationListContainer import com.android.systemui.statusbar.phone.NotificationGroupAlertTransferHelper -import com.android.systemui.statusbar.phone.StatusBar +import com.android.systemui.statusbar.phone.CentralSurfaces import com.android.systemui.statusbar.policy.DeviceProvisionedController import com.android.systemui.statusbar.policy.HeadsUpManager import com.android.systemui.statusbar.policy.RemoteInputUriController @@ -64,7 +64,7 @@ import javax.inject.Inject */ @SysUISingleton class NotificationsControllerImpl @Inject constructor( - private val statusBar: Lazy<StatusBar>, + private val centralSurfaces: Lazy<CentralSurfaces>, private val notifPipelineFlags: NotifPipelineFlags, private val notificationListener: NotificationListener, private val entryManager: NotificationEntryManager, @@ -109,7 +109,7 @@ class NotificationsControllerImpl @Inject constructor( notificationRowBinder.setNotificationClicker( clickerBuilder.build( - Optional.of(statusBar.get()), bubblesOptional, notificationActivityStarter)) + Optional.of(centralSurfaces.get()), bubblesOptional, notificationActivityStarter)) notificationRowBinder.setUpWithPresenter( presenter, listContainer, diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/logging/NotificationLogger.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/logging/NotificationLogger.java index dc3941332f0b..9fbd5c39dedd 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/logging/NotificationLogger.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/logging/NotificationLogger.java @@ -468,7 +468,7 @@ public class NotificationLogger implements StateListener { } /** - * Called by StatusBar to notify the logger that the panel expansion has changed. + * Called by CentralSurfaces to notify the logger that the panel expansion has changed. * The panel may be showing any of the normal notification panel, the AOD, or the bouncer. * @param isExpanded True if the panel is expanded. */ diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java index 1f7d93012e39..c237e1deeae3 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java @@ -112,7 +112,7 @@ import com.android.systemui.statusbar.notification.stack.NotificationChildrenCon import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout; import com.android.systemui.statusbar.notification.stack.SwipeableView; import com.android.systemui.statusbar.phone.KeyguardBypassController; -import com.android.systemui.statusbar.phone.StatusBar; +import com.android.systemui.statusbar.phone.CentralSurfaces; import com.android.systemui.statusbar.policy.HeadsUpManager; import com.android.systemui.statusbar.policy.InflatedSmartReplyState; import com.android.systemui.statusbar.policy.dagger.RemoteInputViewSubcomponent; @@ -388,7 +388,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView } return false; } else { - PackageManager packageManager = StatusBar.getPackageManagerForUser( + PackageManager packageManager = CentralSurfaces.getPackageManagerForUser( context, sbn.getUser().getIdentifier()); Boolean isSystemNotification = null; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentInflater.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentInflater.java index 1530e5238c67..4c693045bc88 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentInflater.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentInflater.java @@ -47,7 +47,7 @@ import com.android.systemui.statusbar.notification.ConversationNotificationProce import com.android.systemui.statusbar.notification.InflationException; import com.android.systemui.statusbar.notification.collection.NotificationEntry; import com.android.systemui.statusbar.notification.row.wrapper.NotificationViewWrapper; -import com.android.systemui.statusbar.phone.StatusBar; +import com.android.systemui.statusbar.phone.CentralSurfaces; import com.android.systemui.statusbar.policy.InflatedSmartReplyState; import com.android.systemui.statusbar.policy.InflatedSmartReplyViewHolder; import com.android.systemui.statusbar.policy.SmartReplyStateInflater; @@ -841,7 +841,7 @@ public class NotificationContentInflater implements NotificationRowContentBinder StatusBarNotification sbn = mEntry.getSbn(); final String ident = sbn.getPackageName() + "/0x" + Integer.toHexString(sbn.getId()); - Log.e(StatusBar.TAG, "couldn't inflate view for notification " + ident, e); + Log.e(CentralSurfaces.TAG, "couldn't inflate view for notification " + ident, e); if (mCallback != null) { mCallback.handleInflationException(mRow.getEntry(), new InflationException("Couldn't inflate contentViews" + e)); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationGutsManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationGutsManager.java index 6d13024e5489..ebe6f03c44e1 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationGutsManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationGutsManager.java @@ -70,8 +70,8 @@ import com.android.systemui.statusbar.notification.collection.render.NotifGutsVi import com.android.systemui.statusbar.notification.dagger.NotificationsModule; import com.android.systemui.statusbar.notification.row.NotificationInfo.CheckSaveListener; import com.android.systemui.statusbar.notification.stack.NotificationListContainer; +import com.android.systemui.statusbar.phone.CentralSurfaces; import com.android.systemui.statusbar.phone.ShadeController; -import com.android.systemui.statusbar.phone.StatusBar; import com.android.systemui.statusbar.policy.DeviceProvisionedController; import com.android.systemui.wmshell.BubblesManager; @@ -120,7 +120,7 @@ public class NotificationGutsManager implements Dumpable, NotificationLifetimeEx @VisibleForTesting protected String mKeyToRemoveOnGutsClosed; - private final Lazy<Optional<StatusBar>> mStatusBarOptionalLazy; + private final Lazy<Optional<CentralSurfaces>> mCentralSurfacesOptionalLazy; private final Handler mMainHandler; private final Handler mBgHandler; private final Optional<BubblesManager> mBubblesManagerOptional; @@ -139,7 +139,7 @@ public class NotificationGutsManager implements Dumpable, NotificationLifetimeEx * Injected constructor. See {@link NotificationsModule}. */ public NotificationGutsManager(Context context, - Lazy<Optional<StatusBar>> statusBarOptionalLazy, + Lazy<Optional<CentralSurfaces>> centralSurfacesOptionalLazy, @Main Handler mainHandler, @Background Handler bgHandler, AccessibilityManager accessibilityManager, @@ -158,7 +158,7 @@ public class NotificationGutsManager implements Dumpable, NotificationLifetimeEx ShadeController shadeController, DumpManager dumpManager) { mContext = context; - mStatusBarOptionalLazy = statusBarOptionalLazy; + mCentralSurfacesOptionalLazy = centralSurfacesOptionalLazy; mMainHandler = mainHandler; mBgHandler = bgHandler; mAccessibilityManager = accessibilityManager; @@ -342,7 +342,7 @@ public class NotificationGutsManager implements Dumpable, NotificationLifetimeEx } StatusBarNotification sbn = row.getEntry().getSbn(); UserHandle userHandle = sbn.getUser(); - PackageManager pmUser = StatusBar.getPackageManagerForUser(mContext, + PackageManager pmUser = CentralSurfaces.getPackageManagerForUser(mContext, userHandle.getIdentifier()); feedbackInfo.bindGuts(pmUser, sbn, row.getEntry(), row, mAssistantFeedbackController); @@ -363,7 +363,7 @@ public class NotificationGutsManager implements Dumpable, NotificationLifetimeEx // Settings link is only valid for notifications that specify a non-system user NotificationInfo.OnSettingsClickListener onSettingsClick = null; UserHandle userHandle = sbn.getUser(); - PackageManager pmUser = StatusBar.getPackageManagerForUser( + PackageManager pmUser = CentralSurfaces.getPackageManagerForUser( mContext, userHandle.getIdentifier()); final NotificationInfo.OnAppSettingsClickListener onAppSettingsClick = (View v, Intent intent) -> { @@ -416,7 +416,7 @@ public class NotificationGutsManager implements Dumpable, NotificationLifetimeEx // Settings link is only valid for notifications that specify a non-system user NotificationInfo.OnSettingsClickListener onSettingsClick = null; UserHandle userHandle = sbn.getUser(); - PackageManager pmUser = StatusBar.getPackageManagerForUser( + PackageManager pmUser = CentralSurfaces.getPackageManagerForUser( mContext, userHandle.getIdentifier()); if (!userHandle.equals(UserHandle.ALL) @@ -458,7 +458,7 @@ public class NotificationGutsManager implements Dumpable, NotificationLifetimeEx // Settings link is only valid for notifications that specify a non-system user NotificationConversationInfo.OnSettingsClickListener onSettingsClick = null; UserHandle userHandle = sbn.getUser(); - PackageManager pmUser = StatusBar.getPackageManagerForUser( + PackageManager pmUser = CentralSurfaces.getPackageManagerForUser( mContext, userHandle.getIdentifier()); final NotificationConversationInfo.OnAppSettingsClickListener onAppSettingsClick = (View v, Intent intent) -> { @@ -571,11 +571,12 @@ public class NotificationGutsManager implements Dumpable, NotificationLifetimeEx .setLeaveOpenOnKeyguardHide(true); } - Optional<StatusBar> statusBarOptional = mStatusBarOptionalLazy.get(); - if (statusBarOptional.isPresent()) { + Optional<CentralSurfaces> centralSurfacesOptional = + mCentralSurfacesOptionalLazy.get(); + if (centralSurfacesOptional.isPresent()) { Runnable r = () -> mMainHandler.post( () -> openGutsInternal(view, x, y, menuItem)); - statusBarOptional.get().executeRunnableDismissingKeyguard( + centralSurfacesOptional.get().executeRunnableDismissingKeyguard( r, null /* cancelAction */, false /* dismissShade */, @@ -584,7 +585,7 @@ public class NotificationGutsManager implements Dumpable, NotificationLifetimeEx return true; } /** - * When {@link StatusBar} doesn't exist, falling through to call + * When {@link CentralSurfaces} doesn't exist, falling through to call * {@link #openGutsInternal(View,int,int,NotificationMenuRowPlugin.MenuItem)}. */ } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/dagger/ExpandableNotificationRowComponent.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/dagger/ExpandableNotificationRowComponent.java index a12d0073ef57..1a7417a78186 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/dagger/ExpandableNotificationRowComponent.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/dagger/ExpandableNotificationRowComponent.java @@ -26,7 +26,7 @@ import com.android.systemui.statusbar.notification.row.ActivatableNotificationVi import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow; import com.android.systemui.statusbar.notification.row.ExpandableNotificationRowController; import com.android.systemui.statusbar.notification.stack.NotificationListContainer; -import com.android.systemui.statusbar.phone.StatusBar; +import com.android.systemui.statusbar.phone.CentralSurfaces; import dagger.Binds; import dagger.BindsInstance; @@ -100,7 +100,7 @@ public interface ExpandableNotificationRowComponent { // but since this field is used in the guts, it must be accurate. // Therefore we will only show the application label, or, failing that, the // package name. No substitutions. - PackageManager pmUser = StatusBar.getPackageManagerForUser( + PackageManager pmUser = CentralSurfaces.getPackageManagerForUser( context, statusBarNotification.getUser().getIdentifier()); final String pkg = statusBarNotification.getPackageName(); try { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/dagger/NotificationRowScope.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/dagger/NotificationRowScope.java index 4555b839a3f2..fa14123df11f 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/dagger/NotificationRowScope.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/dagger/NotificationRowScope.java @@ -24,7 +24,7 @@ import java.lang.annotation.Retention; import javax.inject.Scope; /** - * Scope annotation for singleton items within the StatusBarComponent. + * Scope annotation for singleton items within the CentralSurfacesComponent. */ @Documented @Retention(RUNTIME) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java index f8096437a18e..efe559a64cc4 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java @@ -101,11 +101,11 @@ import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow import com.android.systemui.statusbar.notification.row.ExpandableView; import com.android.systemui.statusbar.notification.row.FooterView; import com.android.systemui.statusbar.notification.row.StackScrollerDecorView; +import com.android.systemui.statusbar.phone.CentralSurfaces; import com.android.systemui.statusbar.phone.HeadsUpAppearanceController; import com.android.systemui.statusbar.phone.HeadsUpTouchHelper; import com.android.systemui.statusbar.phone.ScreenOffAnimationController; import com.android.systemui.statusbar.phone.ShadeController; -import com.android.systemui.statusbar.phone.StatusBar; import com.android.systemui.statusbar.policy.HeadsUpUtil; import com.android.systemui.statusbar.policy.ScrollAdapter; import com.android.systemui.util.Assert; @@ -308,7 +308,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable } }; private NotificationStackScrollLogger mLogger; - private StatusBar mStatusBar; + private CentralSurfaces mCentralSurfaces; private int[] mTempInt2 = new int[2]; private boolean mGenerateChildOrderChangedEvent; private HashSet<Runnable> mAnimationFinishedRunnables = new HashSet<>(); @@ -3959,7 +3959,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable mAmbientState.setExpansionChanging(false); if (!mIsExpanded) { resetScrollPosition(); - mStatusBar.resetUserExpandedStates(); + mCentralSurfaces.resetUserExpandedStates(); clearTemporaryViews(); clearUserLockedViews(); if (mSwipeHelper.isSwiping()) { @@ -4591,8 +4591,8 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable } @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) - public void setStatusBar(StatusBar statusBar) { - this.mStatusBar = statusBar; + public void setCentralSurfaces(CentralSurfaces centralSurfaces) { + this.mCentralSurfaces = centralSurfaces; } @ShadeViewRefactor(RefactorComponent.STATE_RESOLVER) @@ -5260,7 +5260,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable Intent intent = showHistory ? new Intent(Settings.ACTION_NOTIFICATION_HISTORY) : new Intent(Settings.ACTION_NOTIFICATION_SETTINGS); - mStatusBar.startActivity(intent, true, true, Intent.FLAG_ACTIVITY_SINGLE_TOP); + mCentralSurfaces.startActivity(intent, true, true, Intent.FLAG_ACTIVITY_SINGLE_TOP); }); setEmptyShadeView(view); } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java index a352859eb216..df6b8f59fc36 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java @@ -117,8 +117,8 @@ import com.android.systemui.statusbar.phone.HeadsUpTouchHelper; import com.android.systemui.statusbar.phone.KeyguardBypassController; import com.android.systemui.statusbar.phone.ScrimController; import com.android.systemui.statusbar.phone.ShadeController; -import com.android.systemui.statusbar.phone.StatusBar; -import com.android.systemui.statusbar.phone.dagger.StatusBarComponent; +import com.android.systemui.statusbar.phone.CentralSurfaces; +import com.android.systemui.statusbar.phone.dagger.CentralSurfacesComponent; import com.android.systemui.statusbar.policy.ConfigurationController; import com.android.systemui.statusbar.policy.ConfigurationController.ConfigurationListener; import com.android.systemui.statusbar.policy.DeviceProvisionedController; @@ -141,7 +141,7 @@ import kotlin.Unit; /** * Controller for {@link NotificationStackScrollLayout}. */ -@StatusBarComponent.StatusBarScope +@CentralSurfacesComponent.CentralSurfacesScope public class NotificationStackScrollLayoutController { private static final String TAG = "StackScrollerController"; private static final boolean DEBUG = Compile.IS_DEBUG && Log.isLoggable(TAG, Log.DEBUG); @@ -176,8 +176,8 @@ public class NotificationStackScrollLayoutController { private final SysuiStatusBarStateController mStatusBarStateController; private final KeyguardBypassController mKeyguardBypassController; private final NotificationLockscreenUserManager mLockscreenUserManager; - // TODO: StatusBar should be encapsulated behind a Controller - private final StatusBar mStatusBar; + // TODO: CentralSurfaces should be encapsulated behind a Controller + private final CentralSurfaces mCentralSurfaces; private final SectionHeaderController mSilentHeaderController; private final LockscreenShadeTransitionController mLockscreenShadeTransitionController; private final InteractionJankMonitor mJankMonitor; @@ -330,7 +330,7 @@ public class NotificationStackScrollLayoutController { mView.updateSensitiveness(mStatusBarStateController.goingToFullShade(), mLockscreenUserManager.isAnyProfilePublicMode()); mView.onStatePostChange(mStatusBarStateController.fromShadeLocked()); - mNotificationEntryManager.updateNotifications("StatusBar state changed"); + mNotificationEntryManager.updateNotifications("CentralSurfaces state changed"); } }; @@ -431,7 +431,7 @@ public class NotificationStackScrollLayoutController { @Override public void onSnooze(StatusBarNotification sbn, NotificationSwipeActionHelper.SnoozeOption snoozeOption) { - mStatusBar.setNotificationSnoozed(sbn, snoozeOption); + mCentralSurfaces.setNotificationSnoozed(sbn, snoozeOption); } @Override @@ -484,7 +484,7 @@ public class NotificationStackScrollLayoutController { mView.addSwipedOutView(view); mFalsingCollector.onNotificationDismissed(); if (mFalsingCollector.shouldEnforceBouncer()) { - mStatusBar.executeRunnableDismissingKeyguard( + mCentralSurfaces.executeRunnableDismissingKeyguard( null, null /* cancelAction */, false /* dismissShade */, @@ -557,7 +557,7 @@ public class NotificationStackScrollLayoutController { @Override public float getFalsingThresholdFactor() { - return mStatusBar.isWakeUpComingFromTouch() ? 1.5f : 1.0f; + return mCentralSurfaces.isWakeUpComingFromTouch() ? 1.5f : 1.0f; } @Override @@ -644,7 +644,7 @@ public class NotificationStackScrollLayoutController { FalsingManager falsingManager, @Main Resources resources, NotificationSwipeHelper.Builder notificationSwipeHelperBuilder, - StatusBar statusBar, + CentralSurfaces centralSurfaces, ScrimController scrimController, NotificationGroupManagerLegacy legacyGroupManager, GroupExpansionManager groupManager, @@ -685,7 +685,7 @@ public class NotificationStackScrollLayoutController { mFalsingManager = falsingManager; mResources = resources; mNotificationSwipeHelperBuilder = notificationSwipeHelperBuilder; - mStatusBar = statusBar; + mCentralSurfaces = centralSurfaces; mScrimController = scrimController; mJankMonitor = jankMonitor; groupManager.registerGroupExpansionChangeListener( @@ -693,7 +693,7 @@ public class NotificationStackScrollLayoutController { legacyGroupManager.registerGroupChangeListener(new OnGroupChangeListener() { @Override public void onGroupsChanged() { - mStatusBar.requestNotificationUpdate("onGroupsChanged"); + mCentralSurfaces.requestNotificationUpdate("onGroupsChanged"); } }); mNotifPipelineFlags = notifPipelineFlags; @@ -716,7 +716,7 @@ public class NotificationStackScrollLayoutController { mView.setController(this); mView.setLogger(mLogger); mView.setTouchHandler(new TouchHandler()); - mView.setStatusBar(mStatusBar); + mView.setCentralSurfaces(mCentralSurfaces); mView.setClearAllAnimationListener(this::onAnimationEnd); mView.setClearAllListener((selection) -> mUiEventLogger.log( NotificationPanelEvent.fromSelection(selection))); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutListContainerModule.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutListContainerModule.java index ef5b7269f785..3dcaae28e181 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutListContainerModule.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutListContainerModule.java @@ -16,7 +16,7 @@ package com.android.systemui.statusbar.notification.stack; -import com.android.systemui.statusbar.phone.dagger.StatusBarComponent; +import com.android.systemui.statusbar.phone.dagger.CentralSurfacesComponent; import dagger.Module; import dagger.Provides; @@ -24,7 +24,7 @@ import dagger.Provides; @Module public abstract class NotificationStackScrollLayoutListContainerModule { @Provides - @StatusBarComponent.StatusBarScope + @CentralSurfacesComponent.CentralSurfacesScope static NotificationListContainer provideListContainer( NotificationStackScrollLayoutController nsslController) { return nsslController.getNotificationListContainer(); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/BiometricUnlockController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/BiometricUnlockController.java index d5d1ceada88a..fe637c14ee33 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/BiometricUnlockController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/BiometricUnlockController.java @@ -717,7 +717,7 @@ public class BiometricUnlockController extends KeyguardUpdateMonitorCallback imp public void run() { mNotificationShadeWindowController.setForceDozeBrightness(false); } - }, StatusBar.FADE_KEYGUARD_DURATION_PULSING); + }, CentralSurfaces.FADE_KEYGUARD_DURATION_PULSING); } public void finishKeyguardFadingAway() { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfaces.java index b767e17fe861..5642744d3390 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfaces.java @@ -222,7 +222,7 @@ import com.android.systemui.statusbar.notification.row.NotificationGutsManager; import com.android.systemui.statusbar.notification.stack.NotificationListContainer; import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout; import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayoutController; -import com.android.systemui.statusbar.phone.dagger.StatusBarComponent; +import com.android.systemui.statusbar.phone.dagger.CentralSurfacesComponent; import com.android.systemui.statusbar.phone.dagger.StatusBarPhoneModule; import com.android.systemui.statusbar.phone.ongoingcall.OngoingCallController; import com.android.systemui.statusbar.phone.panelstate.PanelExpansionStateManager; @@ -260,8 +260,20 @@ import javax.inject.Named; import dagger.Lazy; -/** */ -public class StatusBar extends CoreStartable implements +/** + * A class handling initialization and coordination between some of the key central surfaces in + * System UI: The notification shade, the keyguard (lockscreen), and the status bar. + * + * This class is not our ideal architecture because it doesn't enforce much isolation between these + * three mostly disparate surfaces. In an ideal world, this class would not exist. Instead, we would + * break it up into three modules -- one for each of those three surfaces -- and we would define any + * APIs that are needed for these surfaces to communicate with each other when necessary. + * + * <b>If at all possible, please avoid adding additional code to this monstrous class! Our goal is + * to break up this class into many small classes, and any code added here will slow down that goal. + * </b> + */ +public class CentralSurfaces extends CoreStartable implements ActivityStarter, LifecycleOwner { public static final boolean MULTIUSER_DEBUG = false; @@ -278,7 +290,7 @@ public class StatusBar extends CoreStartable implements "com.android.systemui.statusbar.banner_action_cancel"; private static final String BANNER_ACTION_SETUP = "com.android.systemui.statusbar.banner_action_setup"; - public static final String TAG = "StatusBar"; + public static final String TAG = "CentralSurfaces"; public static final boolean DEBUG = false; public static final boolean SPEW = false; public static final boolean DUMPTRUCK = true; // extra dumpsys info @@ -343,7 +355,7 @@ public class StatusBar extends CoreStartable implements private final LockscreenShadeTransitionController mLockscreenShadeTransitionController; private final DreamOverlayStateController mDreamOverlayStateController; - private StatusBarCommandQueueCallbacks mCommandQueueCallbacks; + private CentralSurfacesCommandQueueCallbacks mCommandQueueCallbacks; private float mTransitionToFullShadeProgress = 0f; private NotificationListContainer mNotifListContainer; @@ -495,7 +507,7 @@ public class StatusBar extends CoreStartable implements protected NotificationShadeWindowViewController mNotificationShadeWindowViewController; private final DozeParameters mDozeParameters; private final Lazy<BiometricUnlockController> mBiometricUnlockControllerLazy; - private final StatusBarComponent.Factory mStatusBarComponentFactory; + private final CentralSurfacesComponent.Factory mCentralSurfacesComponentFactory; private final PluginManager mPluginManager; private final ShadeController mShadeController; private final InitController mInitController; @@ -542,7 +554,7 @@ public class StatusBar extends CoreStartable implements private final MessageRouter mMessageRouter; private final WallpaperManager mWallpaperManager; - private StatusBarComponent mStatusBarComponent; + private CentralSurfacesComponent mCentralSurfacesComponent; // Flags for disabling the status bar // Two variables becaseu the first one evidently ran out of room for new flags. @@ -683,13 +695,13 @@ public class StatusBar extends CoreStartable implements /** - * Public constructor for StatusBar. + * Public constructor for CentralSurfaces. * - * StatusBar is considered optional, and therefore can not be marked as @Inject directly. + * CentralSurfaces is considered optional, and therefore can not be marked as @Inject directly. * Instead, an @Provide method is included. See {@link StatusBarPhoneModule}. */ @SuppressWarnings("OptionalUsedAsFieldOrParameterType") - public StatusBar( + public CentralSurfaces( Context context, NotificationsController notificationsController, FragmentService fragmentService, @@ -749,7 +761,7 @@ public class StatusBar extends CoreStartable implements DozeScrimController dozeScrimController, VolumeComponent volumeComponent, CommandQueue commandQueue, - StatusBarComponent.Factory statusBarComponentFactory, + CentralSurfacesComponent.Factory centralSurfacesComponentFactory, PluginManager pluginManager, ShadeController shadeController, StatusBarKeyguardViewManager statusBarKeyguardViewManager, @@ -845,7 +857,7 @@ public class StatusBar extends CoreStartable implements mNotificationShadeDepthControllerLazy = notificationShadeDepthControllerLazy; mVolumeComponent = volumeComponent; mCommandQueue = commandQueue; - mStatusBarComponentFactory = statusBarComponentFactory; + mCentralSurfacesComponentFactory = centralSurfacesComponentFactory; mPluginManager = pluginManager; mShadeController = shadeController; mStatusBarKeyguardViewManager = statusBarKeyguardViewManager; @@ -875,7 +887,7 @@ public class StatusBar extends CoreStartable implements mLockscreenShadeTransitionController = lockscreenShadeTransitionController; mStartingSurfaceOptional = startingSurfaceOptional; mNotifPipelineFlags = notifPipelineFlags; - lockscreenShadeTransitionController.setStatusbar(this); + lockscreenShadeTransitionController.setCentralSurfaces(this); statusBarWindowStateController.addListener(this::onStatusBarWindowStateChanged); mScreenOffAnimationController = screenOffAnimationController; @@ -1107,7 +1119,7 @@ public class StatusBar extends CoreStartable implements } private void onFoldedStateChanged(boolean isFolded, boolean willGoToSleep) { - Trace.beginSection("StatusBar#onFoldedStateChanged"); + Trace.beginSection("CentralSurfaces#onFoldedStateChanged"); onFoldedStateChangedInternal(isFolded, willGoToSleep); Trace.endSection(); } @@ -1154,7 +1166,7 @@ public class StatusBar extends CoreStartable implements mNotificationShadeWindowView.setOnTouchListener(getStatusBarWindowTouchListener()); mWallpaperController.setRootView(mNotificationShadeWindowView); - // TODO: Deal with the ugliness that comes from having some of the statusbar broken out + // TODO: Deal with the ugliness that comes from having some of the status bar broken out // into fragments, but the rest here, it leaves some awkward lifecycle and whatnot. mNotificationLogger.setUpWithContainer(mNotifListContainer); mNotificationIconAreaController.setupShelf(mNotificationShelfController); @@ -1166,7 +1178,7 @@ public class StatusBar extends CoreStartable implements mPluginDependencyProvider.allowPluginDependency(StatusBarStateController.class); // Set up CollapsedStatusBarFragment and PhoneStatusBarView - StatusBarInitializer initializer = mStatusBarComponent.getStatusBarInitializer(); + StatusBarInitializer initializer = mCentralSurfacesComponent.getStatusBarInitializer(); initializer.setStatusBarViewUpdatedListener( (statusBarView, statusBarViewController, statusBarTransitions) -> { mStatusBarView = statusBarView; @@ -1183,7 +1195,7 @@ public class StatusBar extends CoreStartable implements setBouncerShowingForStatusBarComponents(mBouncerShowing); checkBarModes(); }); - initializer.initializeStatusBar(mStatusBarComponent); + initializer.initializeStatusBar(mCentralSurfacesComponent); mStatusBarTouchableRegionManager.setup(this, mNotificationShadeWindowView); mHeadsUpManager.addListener(mNotificationPanelViewController.getOnHeadsUpChangedListener()); @@ -1445,7 +1457,7 @@ public class StatusBar extends CoreStartable implements mNotifListContainer, mStackScrollerController.getNotifStackController(), mNotificationActivityStarter, - mStatusBarComponent.getBindRowCallback()); + mCentralSurfacesComponent.getBindRowCallback()); } /** @@ -1503,33 +1515,34 @@ public class StatusBar extends CoreStartable implements } private void inflateStatusBarWindow() { - if (mStatusBarComponent != null) { + if (mCentralSurfacesComponent != null) { // Tear down - for (StatusBarComponent.Startable startable : mStatusBarComponent.getStartables()) { - startable.stop(); + for (CentralSurfacesComponent.Startable s : mCentralSurfacesComponent.getStartables()) { + s.stop(); } } - mStatusBarComponent = mStatusBarComponentFactory.create(); - mFragmentService.addFragmentInstantiationProvider(mStatusBarComponent); + mCentralSurfacesComponent = mCentralSurfacesComponentFactory.create(); + mFragmentService.addFragmentInstantiationProvider(mCentralSurfacesComponent); - mNotificationShadeWindowView = mStatusBarComponent.getNotificationShadeWindowView(); - mNotificationShadeWindowViewController = mStatusBarComponent + mNotificationShadeWindowView = mCentralSurfacesComponent.getNotificationShadeWindowView(); + mNotificationShadeWindowViewController = mCentralSurfacesComponent .getNotificationShadeWindowViewController(); mNotificationShadeWindowController.setNotificationShadeView(mNotificationShadeWindowView); mNotificationShadeWindowViewController.setupExpandedStatusBar(); - mNotificationPanelViewController = mStatusBarComponent.getNotificationPanelViewController(); - mStatusBarComponent.getLockIconViewController().init(); - mStackScrollerController = mStatusBarComponent.getNotificationStackScrollLayoutController(); + mNotificationPanelViewController = + mCentralSurfacesComponent.getNotificationPanelViewController(); + mCentralSurfacesComponent.getLockIconViewController().init(); + mStackScrollerController = + mCentralSurfacesComponent.getNotificationStackScrollLayoutController(); mStackScroller = mStackScrollerController.getView(); - mNotifListContainer = mStatusBarComponent.getNotificationListContainer(); - mPresenter = mStatusBarComponent.getNotificationPresenter(); - mNotificationActivityStarter = mStatusBarComponent.getNotificationActivityStarter(); - mNotificationShelfController = mStatusBarComponent.getNotificationShelfController(); - mAuthRippleController = mStatusBarComponent.getAuthRippleController(); - + mNotifListContainer = mCentralSurfacesComponent.getNotificationListContainer(); + mPresenter = mCentralSurfacesComponent.getNotificationPresenter(); + mNotificationActivityStarter = mCentralSurfacesComponent.getNotificationActivityStarter(); + mNotificationShelfController = mCentralSurfacesComponent.getNotificationShelfController(); + mAuthRippleController = mCentralSurfacesComponent.getAuthRippleController(); mAuthRippleController.init(); - mHeadsUpManager.addListener(mStatusBarComponent.getStatusBarHeadsUpChangeListener()); + mHeadsUpManager.addListener(mCentralSurfacesComponent.getStatusBarHeadsUpChangeListener()); // Listen for demo mode changes mDemoModeController.addCallback(mDemoModeCallback); @@ -1537,18 +1550,19 @@ public class StatusBar extends CoreStartable implements if (mCommandQueueCallbacks != null) { mCommandQueue.removeCallback(mCommandQueueCallbacks); } - mCommandQueueCallbacks = mStatusBarComponent.getStatusBarCommandQueueCallbacks(); + mCommandQueueCallbacks = + mCentralSurfacesComponent.getCentralSurfacesCommandQueueCallbacks(); // Connect in to the status bar manager service mCommandQueue.addCallback(mCommandQueueCallbacks); - // Perform all other initialization for StatusBarScope - for (StatusBarComponent.Startable startable : mStatusBarComponent.getStartables()) { - startable.start(); + // Perform all other initialization for CentralSurfacesScope + for (CentralSurfacesComponent.Startable s : mCentralSurfacesComponent.getStartables()) { + s.start(); } } protected void startKeyguard() { - Trace.beginSection("StatusBar#startKeyguard"); + Trace.beginSection("CentralSurfaces#startKeyguard"); mBiometricUnlockController = mBiometricUnlockControllerLazy.get(); mBiometricUnlockController.setBiometricModeListener( new BiometricUnlockController.BiometricModeListener() { @@ -1569,7 +1583,7 @@ public class StatusBar extends CoreStartable implements @Override public void notifyBiometricAuthModeChanged() { - StatusBar.this.notifyBiometricAuthModeChanged(); + CentralSurfaces.this.notifyBiometricAuthModeChanged(); } private void setWakeAndUnlocking(boolean wakeAndUnlocking) { @@ -1578,7 +1592,7 @@ public class StatusBar extends CoreStartable implements } } }); - mStatusBarKeyguardViewManager.registerStatusBar( + mStatusBarKeyguardViewManager.registerCentralSurfaces( /* statusBar= */ this, mNotificationPanelViewController, mPanelExpansionStateManager, @@ -1707,7 +1721,7 @@ public class StatusBar extends CoreStartable implements getDelegate().onIntentStarted(willAnimate); if (willAnimate) { - StatusBar.this.mIsLaunchingActivityOverLockscreen = true; + CentralSurfaces.this.mIsLaunchingActivityOverLockscreen = true; } } @@ -1717,7 +1731,7 @@ public class StatusBar extends CoreStartable implements // animation so that we can assume that mIsLaunchingActivityOverLockscreen // being true means that we will collapse the shade (or at least run the // post collapse runnables) later on. - StatusBar.this.mIsLaunchingActivityOverLockscreen = false; + CentralSurfaces.this.mIsLaunchingActivityOverLockscreen = false; getDelegate().onLaunchAnimationEnd(isExpandingFullyAbove); } @@ -1727,7 +1741,7 @@ public class StatusBar extends CoreStartable implements // animation so that we can assume that mIsLaunchingActivityOverLockscreen // being true means that we will collapse the shade (or at least run the // post collapse runnables) later on. - StatusBar.this.mIsLaunchingActivityOverLockscreen = false; + CentralSurfaces.this.mIsLaunchingActivityOverLockscreen = false; getDelegate().onLaunchAnimationCancelled(); } }; @@ -2551,7 +2565,7 @@ public class StatusBar extends CoreStartable implements // ordering. mMainExecutor.execute(mShadeController::runPostCollapseRunnables); } - } else if (StatusBar.this.isInLaunchTransition() + } else if (CentralSurfaces.this.isInLaunchTransition() && mNotificationPanelViewController.isLaunchTransitionFinished()) { // We are not dismissing the shade, but the launch transition is already @@ -2574,7 +2588,7 @@ public class StatusBar extends CoreStartable implements private final BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { - Trace.beginSection("StatusBar#onReceive"); + Trace.beginSection("CentralSurfaces#onReceive"); if (DEBUG) Log.v(TAG, "onReceive: " + intent); String action = intent.getAction(); String reason = intent.getStringExtra(SYSTEM_DIALOG_REASON_KEY); @@ -2720,7 +2734,9 @@ public class StatusBar extends CoreStartable implements void handleVisibleToUserChangedImpl(boolean visibleToUser) { if (visibleToUser) { /* The LEDs are turned off when the notification panel is shown, even just a little bit. - * See also StatusBar.setPanelExpanded for another place where we attempt to do this. */ + * See also CentralSurfaces.setPanelExpanded for another place where we attempt to do + * this. + */ boolean pinnedHeadsUp = mHeadsUpManager.hasPinnedHeadsUp(); boolean clearNotificationEffects = !mPresenter.isPresenterFullyCollapsed() && @@ -2900,7 +2916,7 @@ public class StatusBar extends CoreStartable implements } public void showKeyguardImpl() { - Trace.beginSection("StatusBar#showKeyguard"); + Trace.beginSection("CentralSurfaces#showKeyguard"); mIsKeyguard = true; // In case we're locking while a smartspace transition is in progress, reset it. mKeyguardUnlockAnimationController.resetSmartspaceTransition(); @@ -3023,7 +3039,7 @@ public class StatusBar extends CoreStartable implements */ public boolean hideKeyguardImpl(boolean forceStateChange) { mIsKeyguard = false; - Trace.beginSection("StatusBar#hideKeyguard"); + Trace.beginSection("CentralSurfaces#hideKeyguard"); boolean staying = mStatusBarStateController.leaveOpenOnKeyguardHide(); int previousState = mStatusBarStateController.getState(); if (!(mStatusBarStateController.setState(StatusBarState.SHADE, forceStateChange))) { @@ -3140,7 +3156,7 @@ public class StatusBar extends CoreStartable implements private void updateDozingState() { Trace.traceCounter(Trace.TRACE_TAG_APP, "dozing", mDozing ? 1 : 0); - Trace.beginSection("StatusBar#updateDozingState"); + Trace.beginSection("CentralSurfaces#updateDozingState"); boolean visibleNotOccluded = mStatusBarKeyguardViewManager.isShowing() && !mStatusBarKeyguardViewManager.isOccluded(); @@ -3495,7 +3511,7 @@ public class StatusBar extends CoreStartable implements @Override public void onStartedGoingToSleep() { - String tag = "StatusBar#onStartedGoingToSleep"; + String tag = "CentralSurfaces#onStartedGoingToSleep"; DejankUtils.startDetectingBlockingIpcs(tag); updateRevealEffect(false /* wakingUp */); updateNotificationPanelTouchState(); @@ -3515,7 +3531,7 @@ public class StatusBar extends CoreStartable implements @Override public void onStartedWakingUp() { - String tag = "StatusBar#onStartedWakingUp"; + String tag = "CentralSurfaces#onStartedWakingUp"; DejankUtils.startDetectingBlockingIpcs(tag); mNotificationShadeWindowController.batchApplyWindowLayoutParams(()-> { mDeviceInteractive = true; @@ -3590,7 +3606,7 @@ public class StatusBar extends CoreStartable implements @Override public void onScreenTurnedOff() { - Trace.beginSection("StatusBar#onScreenTurnedOff"); + Trace.beginSection("CentralSurfaces#onScreenTurnedOff"); mFalsingCollector.onScreenOff(); mScrimController.onScreenTurnedOff(); if (mCloseQsBeforeScreenOff) { @@ -3701,7 +3717,7 @@ public class StatusBar extends CoreStartable implements @VisibleForTesting public void updateScrimController() { - Trace.beginSection("StatusBar#updateScrimController"); + Trace.beginSection("CentralSurfaces#updateScrimController"); boolean unlocking = mKeyguardStateController.isShowing() && ( mBiometricUnlockController.isWakeAndUnlock() @@ -4267,7 +4283,7 @@ public class StatusBar extends CoreStartable implements if (mBrightnessMirrorController != null) { mBrightnessMirrorController.onDensityOrFontScaleChanged(); } - // TODO: Bring these out of StatusBar. + // TODO: Bring these out of CentralSurfaces. mUserInfoControllerImpl.onDensityOrFontScaleChanged(); mUserSwitcherController.onDensityOrFontScaleChanged(); mNotificationIconAreaController.onDensityOrFontScaleChanged(mContext); @@ -4325,7 +4341,7 @@ public class StatusBar extends CoreStartable implements mDozeServiceHost.updateDozing(); updateTheme(); mNavigationBarController.touchAutoDim(mDisplayId); - Trace.beginSection("StatusBar#updateKeyguardState"); + Trace.beginSection("CentralSurfaces#updateKeyguardState"); if (mState == StatusBarState.KEYGUARD) { mNotificationPanelViewController.cancelPendingPanelCollapse(); } @@ -4348,7 +4364,7 @@ public class StatusBar extends CoreStartable implements @Override public void onDozingChanged(boolean isDozing) { - Trace.beginSection("StatusBar#updateDozing"); + Trace.beginSection("CentralSurfaces#updateDozing"); mDozing = isDozing; // Collapse the notification panel if open diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarCommandQueueCallbacks.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesCommandQueueCallbacks.java index 883445e17162..536be1c1a866 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarCommandQueueCallbacks.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesCommandQueueCallbacks.java @@ -59,7 +59,7 @@ import com.android.systemui.statusbar.DisableFlagsLogger; import com.android.systemui.statusbar.SysuiStatusBarStateController; import com.android.systemui.statusbar.VibratorHelper; import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayoutController; -import com.android.systemui.statusbar.phone.dagger.StatusBarComponent; +import com.android.systemui.statusbar.phone.dagger.CentralSurfacesComponent; import com.android.systemui.statusbar.policy.DeviceProvisionedController; import com.android.systemui.statusbar.policy.HeadsUpManager; import com.android.systemui.statusbar.policy.KeyguardStateController; @@ -70,9 +70,9 @@ import java.util.Optional; import javax.inject.Inject; /** */ -@StatusBarComponent.StatusBarScope -public class StatusBarCommandQueueCallbacks implements CommandQueue.Callbacks { - private final StatusBar mStatusBar; +@CentralSurfacesComponent.CentralSurfacesScope +public class CentralSurfacesCommandQueueCallbacks implements CommandQueue.Callbacks { + private final CentralSurfaces mCentralSurfaces; private final Context mContext; private final ShadeController mShadeController; private final CommandQueue mCommandQueue; @@ -105,8 +105,8 @@ public class StatusBarCommandQueueCallbacks implements CommandQueue.Callbacks { VibrationAttributes.createForUsage(VibrationAttributes.USAGE_HARDWARE_FEEDBACK); @Inject - StatusBarCommandQueueCallbacks( - StatusBar statusBar, + CentralSurfacesCommandQueueCallbacks( + CentralSurfaces centralSurfaces, Context context, @Main Resources resources, ShadeController shadeController, @@ -133,7 +133,7 @@ public class StatusBarCommandQueueCallbacks implements CommandQueue.Callbacks { DisableFlagsLogger disableFlagsLogger, @DisplayId int displayId) { - mStatusBar = statusBar; + mCentralSurfaces = centralSurfaces; mContext = context; mShadeController = shadeController; mCommandQueue = commandQueue; @@ -172,12 +172,12 @@ public class StatusBarCommandQueueCallbacks implements CommandQueue.Callbacks { if (!containsType(types, ITYPE_STATUS_BAR)) { return; } - mStatusBar.clearTransient(); + mCentralSurfaces.clearTransient(); } @Override public void addQsTile(ComponentName tile) { - QSPanelController qsPanelController = mStatusBar.getQSPanelController(); + QSPanelController qsPanelController = mCentralSurfaces.getQSPanelController(); if (qsPanelController != null && qsPanelController.getHost() != null) { qsPanelController.getHost().addTile(tile); } @@ -185,7 +185,7 @@ public class StatusBarCommandQueueCallbacks implements CommandQueue.Callbacks { @Override public void remQsTile(ComponentName tile) { - QSPanelController qsPanelController = mStatusBar.getQSPanelController(); + QSPanelController qsPanelController = mCentralSurfaces.getQSPanelController(); if (qsPanelController != null && qsPanelController.getHost() != null) { qsPanelController.getHost().removeTile(tile); } @@ -193,7 +193,7 @@ public class StatusBarCommandQueueCallbacks implements CommandQueue.Callbacks { @Override public void clickTile(ComponentName tile) { - QSPanelController qsPanelController = mStatusBar.getQSPanelController(); + QSPanelController qsPanelController = mCentralSurfaces.getQSPanelController(); if (qsPanelController != null) { qsPanelController.clickTile(tile); } @@ -207,9 +207,9 @@ public class StatusBarCommandQueueCallbacks implements CommandQueue.Callbacks { @Override public void animateExpandNotificationsPanel() { - if (StatusBar.SPEW) { - Log.d(StatusBar.TAG, - "animateExpand: mExpandedVisible=" + mStatusBar.isExpandedVisible()); + if (CentralSurfaces.SPEW) { + Log.d(CentralSurfaces.TAG, + "animateExpand: mExpandedVisible=" + mCentralSurfaces.isExpandedVisible()); } if (!mCommandQueue.panelsEnabled()) { return; @@ -220,9 +220,9 @@ public class StatusBarCommandQueueCallbacks implements CommandQueue.Callbacks { @Override public void animateExpandSettingsPanel(@Nullable String subPanel) { - if (StatusBar.SPEW) { - Log.d(StatusBar.TAG, - "animateExpand: mExpandedVisible=" + mStatusBar.isExpandedVisible()); + if (CentralSurfaces.SPEW) { + Log.d(CentralSurfaces.TAG, + "animateExpand: mExpandedVisible=" + mCentralSurfaces.isExpandedVisible()); } if (!mCommandQueue.panelsEnabled()) { return; @@ -244,7 +244,7 @@ public class StatusBarCommandQueueCallbacks implements CommandQueue.Callbacks { @Override public void dismissKeyboardShortcutsMenu() { - mStatusBar.resendMessage(StatusBar.MSG_DISMISS_KEYBOARD_SHORTCUTS_MENU); + mCentralSurfaces.resendMessage(CentralSurfaces.MSG_DISMISS_KEYBOARD_SHORTCUTS_MENU); } /** * State is one or more of the DISABLE constants from StatusBarManager. @@ -257,22 +257,22 @@ public class StatusBarCommandQueueCallbacks implements CommandQueue.Callbacks { int state2BeforeAdjustment = state2; state2 = mRemoteInputQuickSettingsDisabler.adjustDisableFlags(state2); - Log.d(StatusBar.TAG, + Log.d(CentralSurfaces.TAG, mDisableFlagsLogger.getDisableFlagsString( /* old= */ new DisableFlagsLogger.DisableState( - mStatusBar.getDisabled1(), mStatusBar.getDisabled2()), + mCentralSurfaces.getDisabled1(), mCentralSurfaces.getDisabled2()), /* new= */ new DisableFlagsLogger.DisableState( state1, state2BeforeAdjustment), /* newStateAfterLocalModification= */ new DisableFlagsLogger.DisableState( state1, state2))); - final int old1 = mStatusBar.getDisabled1(); + final int old1 = mCentralSurfaces.getDisabled1(); final int diff1 = state1 ^ old1; - mStatusBar.setDisabled1(state1); + mCentralSurfaces.setDisabled1(state1); - final int old2 = mStatusBar.getDisabled2(); + final int old2 = mCentralSurfaces.getDisabled2(); final int diff2 = state2 ^ old2; - mStatusBar.setDisabled2(state2); + mCentralSurfaces.setDisabled2(state2); if ((diff1 & StatusBarManager.DISABLE_EXPAND) != 0) { if ((state1 & StatusBarManager.DISABLE_EXPAND) != 0) { @@ -281,17 +281,17 @@ public class StatusBarCommandQueueCallbacks implements CommandQueue.Callbacks { } if ((diff1 & StatusBarManager.DISABLE_NOTIFICATION_ALERTS) != 0) { - if (mStatusBar.areNotificationAlertsDisabled()) { + if (mCentralSurfaces.areNotificationAlertsDisabled()) { mHeadsUpManager.releaseAllImmediately(); } } if ((diff2 & StatusBarManager.DISABLE2_QUICK_SETTINGS) != 0) { - mStatusBar.updateQsExpansionEnabled(); + mCentralSurfaces.updateQsExpansionEnabled(); } if ((diff2 & StatusBarManager.DISABLE2_NOTIFICATION_SHADE) != 0) { - mStatusBar.updateQsExpansionEnabled(); + mCentralSurfaces.updateQsExpansionEnabled(); if ((state2 & StatusBarManager.DISABLE2_NOTIFICATION_SHADE) != 0) { mShadeController.animateCollapsePanels(); } @@ -304,8 +304,8 @@ public class StatusBarCommandQueueCallbacks implements CommandQueue.Callbacks { */ @Override public void handleSystemKey(int key) { - if (StatusBar.SPEW) { - Log.d(StatusBar.TAG, "handleNavigationKey: " + key); + if (CentralSurfaces.SPEW) { + Log.d(CentralSurfaces.TAG, "handleNavigationKey: " + key); } if (!mCommandQueue.panelsEnabled() || !mKeyguardUpdateMonitor.isDeviceInteractive() || mKeyguardStateController.isShowing() && !mKeyguardStateController.isOccluded()) { @@ -341,81 +341,82 @@ public class StatusBarCommandQueueCallbacks implements CommandQueue.Callbacks { @Override public void onCameraLaunchGestureDetected(int source) { - mStatusBar.setLastCameraLaunchSource(source); - if (mStatusBar.isGoingToSleep()) { - if (StatusBar.DEBUG_CAMERA_LIFT) { - Slog.d(StatusBar.TAG, "Finish going to sleep before launching camera"); + mCentralSurfaces.setLastCameraLaunchSource(source); + if (mCentralSurfaces.isGoingToSleep()) { + if (CentralSurfaces.DEBUG_CAMERA_LIFT) { + Slog.d(CentralSurfaces.TAG, "Finish going to sleep before launching camera"); } - mStatusBar.setLaunchCameraOnFinishedGoingToSleep(true); + mCentralSurfaces.setLaunchCameraOnFinishedGoingToSleep(true); return; } if (!mNotificationPanelViewController.canCameraGestureBeLaunched()) { - if (StatusBar.DEBUG_CAMERA_LIFT) { - Slog.d(StatusBar.TAG, "Can't launch camera right now"); + if (CentralSurfaces.DEBUG_CAMERA_LIFT) { + Slog.d(CentralSurfaces.TAG, "Can't launch camera right now"); } return; } - if (!mStatusBar.isDeviceInteractive()) { + if (!mCentralSurfaces.isDeviceInteractive()) { mPowerManager.wakeUp(SystemClock.uptimeMillis(), PowerManager.WAKE_REASON_CAMERA_LAUNCH, "com.android.systemui:CAMERA_GESTURE"); } vibrateForCameraGesture(); if (source == StatusBarManager.CAMERA_LAUNCH_SOURCE_POWER_DOUBLE_TAP) { - Log.v(StatusBar.TAG, "Camera launch"); + Log.v(CentralSurfaces.TAG, "Camera launch"); mKeyguardUpdateMonitor.onCameraLaunched(); } if (!mStatusBarKeyguardViewManager.isShowing()) { final Intent cameraIntent = CameraIntents.getInsecureCameraIntent(mContext); - mStatusBar.startActivityDismissingKeyguard(cameraIntent, + mCentralSurfaces.startActivityDismissingKeyguard(cameraIntent, false /* onlyProvisioned */, true /* dismissShade */, true /* disallowEnterPictureInPictureWhileLaunching */, null /* callback */, 0, null /* animationController */); } else { - if (!mStatusBar.isDeviceInteractive()) { + if (!mCentralSurfaces.isDeviceInteractive()) { // Avoid flickering of the scrim when we instant launch the camera and the bouncer // comes on. - mStatusBar.acquireGestureWakeLock(StatusBar.LAUNCH_TRANSITION_TIMEOUT_MS + 1000L); + mCentralSurfaces.acquireGestureWakeLock( + CentralSurfaces.LAUNCH_TRANSITION_TIMEOUT_MS + 1000L); } if (isWakingUpOrAwake()) { - if (StatusBar.DEBUG_CAMERA_LIFT) { - Slog.d(StatusBar.TAG, "Launching camera"); + if (CentralSurfaces.DEBUG_CAMERA_LIFT) { + Slog.d(CentralSurfaces.TAG, "Launching camera"); } if (mStatusBarKeyguardViewManager.isBouncerShowing()) { mStatusBarKeyguardViewManager.reset(true /* hide */); } mNotificationPanelViewController.launchCamera( - mStatusBar.isDeviceInteractive() /* animate */, source); - mStatusBar.updateScrimController(); + mCentralSurfaces.isDeviceInteractive() /* animate */, source); + mCentralSurfaces.updateScrimController(); } else { // We need to defer the camera launch until the screen comes on, since otherwise // we will dismiss us too early since we are waiting on an activity to be drawn and // incorrectly get notified because of the screen on event (which resumes and pauses // some activities) - if (StatusBar.DEBUG_CAMERA_LIFT) { - Slog.d(StatusBar.TAG, "Deferring until screen turns on"); + if (CentralSurfaces.DEBUG_CAMERA_LIFT) { + Slog.d(CentralSurfaces.TAG, "Deferring until screen turns on"); } - mStatusBar.setLaunchCameraOnFinishedWaking(true); + mCentralSurfaces.setLaunchCameraOnFinishedWaking(true); } } } @Override public void onEmergencyActionLaunchGestureDetected() { - Intent emergencyIntent = mStatusBar.getEmergencyActionIntent(); + Intent emergencyIntent = mCentralSurfaces.getEmergencyActionIntent(); if (emergencyIntent == null) { - Log.wtf(StatusBar.TAG, "Couldn't find an app to process the emergency intent."); + Log.wtf(CentralSurfaces.TAG, "Couldn't find an app to process the emergency intent."); return; } if (isGoingToSleep()) { - mStatusBar.setLaunchEmergencyActionOnFinishedGoingToSleep(true); + mCentralSurfaces.setLaunchEmergencyActionOnFinishedGoingToSleep(true); return; } - if (!mStatusBar.isDeviceInteractive()) { + if (!mCentralSurfaces.isDeviceInteractive()) { mPowerManager.wakeUp(SystemClock.uptimeMillis(), PowerManager.WAKE_REASON_GESTURE, "com.android.systemui:EMERGENCY_GESTURE"); @@ -424,17 +425,18 @@ public class StatusBarCommandQueueCallbacks implements CommandQueue.Callbacks { // app-side haptic experimentation. if (!mStatusBarKeyguardViewManager.isShowing()) { - mStatusBar.startActivityDismissingKeyguard(emergencyIntent, + mCentralSurfaces.startActivityDismissingKeyguard(emergencyIntent, false /* onlyProvisioned */, true /* dismissShade */, true /* disallowEnterPictureInPictureWhileLaunching */, null /* callback */, 0, null /* animationController */); return; } - if (!mStatusBar.isDeviceInteractive()) { + if (!mCentralSurfaces.isDeviceInteractive()) { // Avoid flickering of the scrim when we instant launch the camera and the bouncer // comes on. - mStatusBar.acquireGestureWakeLock(StatusBar.LAUNCH_TRANSITION_TIMEOUT_MS + 1000L); + mCentralSurfaces.acquireGestureWakeLock( + CentralSurfaces.LAUNCH_TRANSITION_TIMEOUT_MS + 1000L); } if (isWakingUpOrAwake()) { @@ -448,12 +450,12 @@ public class StatusBarCommandQueueCallbacks implements CommandQueue.Callbacks { // we will dismiss us too early since we are waiting on an activity to be drawn and // incorrectly get notified because of the screen on event (which resumes and pauses // some activities) - mStatusBar.setLaunchEmergencyActionOnFinishedWaking(true); + mCentralSurfaces.setLaunchEmergencyActionOnFinishedWaking(true); } @Override public void onRecentsAnimationStateChanged(boolean running) { - mStatusBar.setInteracting(StatusBarManager.WINDOW_NAVIGATION_BAR, running); + mCentralSurfaces.setInteracting(StatusBarManager.WINDOW_NAVIGATION_BAR, running); } @@ -464,12 +466,12 @@ public class StatusBarCommandQueueCallbacks implements CommandQueue.Callbacks { if (displayId != mDisplayId) { return; } - boolean barModeChanged = mStatusBar.setAppearance(appearance); + boolean barModeChanged = mCentralSurfaces.setAppearance(appearance); mLightBarController.onStatusBarAppearanceChanged(appearanceRegions, barModeChanged, - mStatusBar.getBarMode(), navbarColorManagedByIme); + mCentralSurfaces.getBarMode(), navbarColorManagedByIme); - mStatusBar.updateBubblesVisibility(); + mCentralSurfaces.updateBubblesVisibility(); mStatusBarStateController.setSystemBarAttributes( appearance, behavior, requestedVisibilities, packageName); } @@ -483,12 +485,12 @@ public class StatusBarCommandQueueCallbacks implements CommandQueue.Callbacks { if (!containsType(types, ITYPE_STATUS_BAR)) { return; } - mStatusBar.showTransientUnchecked(); + mCentralSurfaces.showTransientUnchecked(); } @Override public void toggleKeyboardShortcutsMenu(int deviceId) { - mStatusBar.resendMessage(new StatusBar.KeyboardShortcutsMessage(deviceId)); + mCentralSurfaces.resendMessage(new CentralSurfaces.KeyboardShortcutsMessage(deviceId)); } @Override @@ -504,12 +506,12 @@ public class StatusBarCommandQueueCallbacks implements CommandQueue.Callbacks { @Override public void showPinningEnterExitToast(boolean entering) { - mStatusBar.showPinningEnterExitToast(entering); + mCentralSurfaces.showPinningEnterExitToast(entering); } @Override public void showPinningEscapeToast() { - mStatusBar.showPinningEscapeToast(); + mCentralSurfaces.showPinningEscapeToast(); } @Override @@ -519,12 +521,12 @@ public class StatusBarCommandQueueCallbacks implements CommandQueue.Callbacks { return; } // Show screen pinning request, since this comes from an app, show 'no thanks', button. - mStatusBar.showScreenPinningRequest(taskId, true); + mCentralSurfaces.showScreenPinningRequest(taskId, true); } @Override public void showWirelessChargingAnimation(int batteryLevel) { - mStatusBar.showWirelessChargingAnimation(batteryLevel); + mCentralSurfaces.showWirelessChargingAnimation(batteryLevel); } @Override @@ -539,7 +541,7 @@ public class StatusBarCommandQueueCallbacks implements CommandQueue.Callbacks { @Override public void togglePanel() { - if (mStatusBar.isPanelExpanded()) { + if (mCentralSurfaces.isPanelExpanded()) { mShadeController.animateCollapsePanels(); } else { animateExpandNotificationsPanel(); @@ -576,8 +578,8 @@ public class StatusBarCommandQueueCallbacks implements CommandQueue.Callbacks { // Make sure to pass -1 for repeat so VibratorManagerService doesn't stop us when going // to sleep. return VibrationEffect.createWaveform( - StatusBar.CAMERA_LAUNCH_GESTURE_VIBRATION_TIMINGS, - StatusBar.CAMERA_LAUNCH_GESTURE_VIBRATION_AMPLITUDES, + CentralSurfaces.CAMERA_LAUNCH_GESTURE_VIBRATION_TIMINGS, + CentralSurfaces.CAMERA_LAUNCH_GESTURE_VIBRATION_AMPLITUDES, /* repeat= */ -1); } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/DozeServiceHost.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/DozeServiceHost.java index 696c5a760bf6..55b310ff986d 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/DozeServiceHost.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/DozeServiceHost.java @@ -97,7 +97,7 @@ public final class DozeServiceHost implements DozeHost { private StatusBarKeyguardViewManager mStatusBarKeyguardViewManager; private NotificationPanelViewController mNotificationPanel; private View mAmbientIndicationContainer; - private StatusBar mStatusBar; + private CentralSurfaces mCentralSurfaces; private boolean mAlwaysOnSuppressed; @Inject @@ -146,12 +146,12 @@ public final class DozeServiceHost implements DozeHost { * Initialize instance with objects only available later during execution. */ public void initialize( - StatusBar statusBar, + CentralSurfaces centralSurfaces, StatusBarKeyguardViewManager statusBarKeyguardViewManager, NotificationShadeWindowViewController notificationShadeWindowViewController, NotificationPanelViewController notificationPanel, View ambientIndicationContainer) { - mStatusBar = statusBar; + mCentralSurfaces = centralSurfaces; mStatusBarKeyguardViewManager = statusBarKeyguardViewManager; mNotificationPanel = notificationPanel; mNotificationShadeWindowViewController = notificationShadeWindowViewController; @@ -205,7 +205,7 @@ public final class DozeServiceHost implements DozeHost { mDozingRequested = true; updateDozing(); mDozeLog.traceDozing(mStatusBarStateController.isDozing()); - mStatusBar.updateIsKeyguard(); + mCentralSurfaces.updateIsKeyguard(); } } @@ -247,13 +247,13 @@ public final class DozeServiceHost implements DozeHost { && mWakeLockScreenPerformsAuth; // Set the state to pulsing, so ScrimController will know what to do once we ask it to // execute the transition. The pulse callback will then be invoked when the scrims - // are black, indicating that StatusBar is ready to present the rest of the UI. + // are black, indicating that CentralSurfaces is ready to present the rest of the UI. mPulsing = true; mDozeScrimController.pulse(new PulseCallback() { @Override public void onPulseStarted() { callback.onPulseStarted(); - mStatusBar.updateNotificationPanelTouchState(); + mCentralSurfaces.updateNotificationPanelTouchState(); setPulsing(true); } @@ -261,7 +261,7 @@ public final class DozeServiceHost implements DozeHost { public void onPulseFinished() { mPulsing = false; callback.onPulseFinished(); - mStatusBar.updateNotificationPanelTouchState(); + mCentralSurfaces.updateNotificationPanelTouchState(); mScrimController.setWakeLockScreenSensorActive(false); setPulsing(false); } @@ -274,14 +274,14 @@ public final class DozeServiceHost implements DozeHost { if (mKeyguardUpdateMonitor != null && passiveAuthInterrupt) { mKeyguardUpdateMonitor.onAuthInterruptDetected(pulsing /* active */); } - mStatusBar.updateScrimController(); + mCentralSurfaces.updateScrimController(); mPulseExpansionHandler.setPulsing(pulsing); mNotificationWakeUpCoordinator.setPulsing(pulsing); } }, reason); // DozeScrimController is in pulse state, now let's ask ScrimController to start // pulsing and draw the black frame, if necessary. - mStatusBar.updateScrimController(); + mCentralSurfaces.updateScrimController(); } @Override @@ -403,14 +403,14 @@ public final class DozeServiceHost implements DozeHost { Log.w(TAG, "Overlapping onDisplayOffCallback. Ignoring previous one."); } mPendingScreenOffCallback = onDisplayOffCallback; - mStatusBar.updateScrimController(); + mCentralSurfaces.updateScrimController(); } @Override public void cancelGentleSleep() { mPendingScreenOffCallback = null; if (mScrimController.getState() == ScrimState.OFF) { - mStatusBar.updateScrimController(); + mCentralSurfaces.updateScrimController(); } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java index 84103c0bb377..541aeab22a80 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java @@ -118,7 +118,7 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL KeyguardStateController.Callback, AccessibilityController.AccessibilityStateChangedCallback { - final static String TAG = "StatusBar/KeyguardBottomAreaView"; + final static String TAG = "CentralSurfaces/KeyguardBottomAreaView"; public static final String CAMERA_LAUNCH_SOURCE_AFFORDANCE = "lockscreen_affordance"; public static final String CAMERA_LAUNCH_SOURCE_WIGGLE = "wiggle_gesture"; @@ -169,7 +169,7 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL private FlashlightController mFlashlightController; private PreviewInflater mPreviewInflater; private AccessibilityController mAccessibilityController; - private StatusBar mStatusBar; + private CentralSurfaces mCentralSurfaces; private KeyguardAffordanceHelper mAffordanceHelper; private FalsingManager mFalsingManager; private boolean mUserSetupComplete; @@ -274,7 +274,7 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL }; public void initFrom(KeyguardBottomAreaView oldBottomArea) { - setStatusBar(oldBottomArea.mStatusBar); + setCentralSurfaces(oldBottomArea.mCentralSurfaces); // if it exists, continue to use the original ambient indication container // instead of the newly inflated one @@ -473,8 +473,8 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL mRightAffordanceView.setContentDescription(state.contentDescription); } - public void setStatusBar(StatusBar statusBar) { - mStatusBar = statusBar; + public void setCentralSurfaces(CentralSurfaces centralSurfaces) { + mCentralSurfaces = centralSurfaces; updateCameraVisibility(); // in case onFinishInflate() was called too early } @@ -732,7 +732,7 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL } else { boolean dismissShade = !TextUtils.isEmpty(mRightButtonStr) && Dependency.get(TunerService.class).getValue(LOCKSCREEN_RIGHT_UNLOCK, 1) != 0; - mStatusBar.executeRunnableDismissingKeyguard(runnable, null /* cancelAction */, + mCentralSurfaces.executeRunnableDismissingKeyguard(runnable, null /* cancelAction */, dismissShade, false /* afterKeyguardGone */, true /* deferred */); } } @@ -1019,7 +1019,8 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL @Override public IconState getIcon() { - boolean isCameraDisabled = (mStatusBar != null) && !mStatusBar.isCameraAllowedByAdmin(); + boolean isCameraDisabled = (mCentralSurfaces != null) + && !mCentralSurfaces.isCameraAllowedByAdmin(); mIconState.isVisible = !isCameraDisabled && mShowCameraAffordance && mUserSetupComplete diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardEnvironmentImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardEnvironmentImpl.java index 9bdefcd98422..2c4fc6c6f734 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardEnvironmentImpl.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardEnvironmentImpl.java @@ -14,8 +14,8 @@ package com.android.systemui.statusbar.phone; -import static com.android.systemui.statusbar.phone.StatusBar.DEBUG; -import static com.android.systemui.statusbar.phone.StatusBar.MULTIUSER_DEBUG; +import static com.android.systemui.statusbar.phone.CentralSurfaces.DEBUG; +import static com.android.systemui.statusbar.phone.CentralSurfaces.MULTIUSER_DEBUG; import android.service.notification.StatusBarNotification; import android.util.Log; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java index 25f727f25791..61760fb8c78c 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java @@ -189,7 +189,7 @@ import com.android.systemui.statusbar.notification.stack.NotificationStackScroll import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayoutController; import com.android.systemui.statusbar.notification.stack.StackStateAnimator; import com.android.systemui.statusbar.phone.LockscreenGestureLogger.LockscreenUiEvent; -import com.android.systemui.statusbar.phone.dagger.StatusBarComponent; +import com.android.systemui.statusbar.phone.dagger.CentralSurfacesComponent; import com.android.systemui.statusbar.phone.fragment.CollapsedStatusBarFragment; import com.android.systemui.statusbar.phone.panelstate.PanelExpansionStateManager; import com.android.systemui.statusbar.phone.panelstate.PanelState; @@ -222,7 +222,7 @@ import java.util.function.Consumer; import javax.inject.Inject; import javax.inject.Provider; -@StatusBarComponent.StatusBarScope +@CentralSurfacesComponent.CentralSurfacesScope public class NotificationPanelViewController extends PanelViewController implements NotifPanelEventSource { @@ -1132,10 +1132,10 @@ public class NotificationPanelViewController extends PanelViewController return mKeyguardStatusViewController.hasCustomClock(); } - private void setStatusBar(StatusBar bar) { + private void setCentralSurfaces(CentralSurfaces centralSurfaces) { // TODO: this can be injected. - mStatusBar = bar; - mKeyguardBottomArea.setStatusBar(mStatusBar); + mCentralSurfaces = centralSurfaces; + mKeyguardBottomArea.setCentralSurfaces(mCentralSurfaces); } public void updateResources() { @@ -1325,7 +1325,7 @@ public class NotificationPanelViewController extends PanelViewController mAffordanceHelper = new KeyguardAffordanceHelper( mKeyguardAffordanceHelperCallback, mView.getContext(), mFalsingManager); mKeyguardBottomArea.setAffordanceHelper(mAffordanceHelper); - mKeyguardBottomArea.setStatusBar(mStatusBar); + mKeyguardBottomArea.setCentralSurfaces(mCentralSurfaces); mKeyguardBottomArea.setUserSetupComplete(mUserSetupComplete); mKeyguardBottomArea.setFalsingManager(mFalsingManager); mKeyguardBottomArea.initWallet(mQuickAccessWalletController); @@ -1588,7 +1588,7 @@ public class NotificationPanelViewController extends PanelViewController float lockIconPadding = 0; if (mLockIconViewController.getTop() != 0) { - lockIconPadding = mStatusBar.getDisplayHeight() - mLockIconViewController.getTop() + lockIconPadding = mCentralSurfaces.getDisplayHeight() - mLockIconViewController.getTop() + mResources.getDimensionPixelSize(R.dimen.min_lock_icon_padding); } @@ -1742,7 +1742,7 @@ public class NotificationPanelViewController extends PanelViewController mAffordanceHelper.reset(false); mLastCameraLaunchSource = KeyguardBottomAreaView.CAMERA_LAUNCH_SOURCE_AFFORDANCE; } - mStatusBar.getGutsManager().closeAndSaveGuts(true /* leavebehind */, true /* force */, + mCentralSurfaces.getGutsManager().closeAndSaveGuts(true /* leavebehind */, true /* force */, true /* controls */, -1 /* x */, -1 /* y */, true /* resetMenu */); if (animate && !isFullyCollapsed()) { animateCloseQs(true /* animateAway */); @@ -1841,7 +1841,7 @@ public class NotificationPanelViewController extends PanelViewController @Override public void fling(float vel, boolean expand) { - GestureRecorder gr = mStatusBar.getGestureRecorder(); + GestureRecorder gr = mCentralSurfaces.getGestureRecorder(); if (gr != null) { gr.tag("fling " + ((vel > 0) ? "open" : "closed"), "notifications,v=" + vel); } @@ -2030,8 +2030,8 @@ public class NotificationPanelViewController extends PanelViewController mBarState == KEYGUARD ? MetricsEvent.ACTION_LS_QS : MetricsEvent.ACTION_SHADE_QS_PULL; mLockscreenGestureLogger.write(gesture, - (int) ((y - mInitialTouchY) / mStatusBar.getDisplayDensity()), - (int) (vel / mStatusBar.getDisplayDensity())); + (int) ((y - mInitialTouchY) / mCentralSurfaces.getDisplayDensity()), + (int) (vel / mCentralSurfaces.getDisplayDensity())); } private boolean flingExpandsQs(float vel) { @@ -2309,7 +2309,7 @@ public class NotificationPanelViewController extends PanelViewController } private int getFalsingThreshold() { - float factor = mStatusBar.isWakeUpComingFromTouch() ? 1.5f : 1.0f; + float factor = mCentralSurfaces.isWakeUpComingFromTouch() ? 1.5f : 1.0f; return (int) (mQsFalsingThreshold * factor); } @@ -2336,7 +2336,7 @@ public class NotificationPanelViewController extends PanelViewController // When expanding QS, let's authenticate the user if possible, // this will speed up notification actions. if (height == 0) { - mStatusBar.requestFaceAuth(false); + mCentralSurfaces.requestFaceAuth(false); } } @@ -2347,7 +2347,7 @@ public class NotificationPanelViewController extends PanelViewController updateQsState(); requestPanelHeightUpdate(); mFalsingCollector.setQsExpanded(expanded); - mStatusBar.setQsExpanded(expanded); + mCentralSurfaces.setQsExpanded(expanded); mNotificationsQSContainerController.setQsExpanded(expanded); mPulseExpansionHandler.setQsExpanded(expanded); mKeyguardBypassController.setQSExpanded(expanded); @@ -2431,7 +2431,7 @@ public class NotificationPanelViewController extends PanelViewController if (!mFalsingManager.isUnlockingDisabled() && mQsFullyExpanded && mFalsingCollector.shouldEnforceBouncer()) { - mStatusBar.executeRunnableDismissingKeyguard(null, null /* cancelAction */, + mCentralSurfaces.executeRunnableDismissingKeyguard(null, null /* cancelAction */, false /* dismissShade */, true /* afterKeyguardGone */, false /* deferred */); } if (DEBUG) { @@ -3119,7 +3119,7 @@ public class NotificationPanelViewController extends PanelViewController if (mPanelExpanded != isExpanded) { mHeadsUpManager.setIsPanelExpanded(isExpanded); mStatusBarTouchableRegionManager.setPanelExpanded(isExpanded); - mStatusBar.setPanelExpanded(isExpanded); + mCentralSurfaces.setPanelExpanded(isExpanded); mPanelExpanded = isExpanded; if (!isExpanded && mQs != null && mQs.isCustomizing()) { @@ -3244,7 +3244,7 @@ public class NotificationPanelViewController extends PanelViewController mKeyguardBottomArea.setImportantForAccessibility( alpha == 0f ? View.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS : View.IMPORTANT_FOR_ACCESSIBILITY_AUTO); - View ambientIndicationContainer = mStatusBar.getAmbientIndicationContainer(); + View ambientIndicationContainer = mCentralSurfaces.getAmbientIndicationContainer(); if (ambientIndicationContainer != null) { ambientIndicationContainer.setAlpha(alpha); } @@ -3583,7 +3583,7 @@ public class NotificationPanelViewController extends PanelViewController @Override protected void onClosingFinished() { - mStatusBar.onClosingFinished(); + mCentralSurfaces.onClosingFinished(); setClosingWithAlphaFadeout(false); mMediaHierarchyManager.closeGuts(); } @@ -3645,7 +3645,7 @@ public class NotificationPanelViewController extends PanelViewController } public void clearNotificationEffects() { - mStatusBar.clearNotificationEffects(); + mCentralSurfaces.clearNotificationEffects(); } @Override @@ -3707,7 +3707,7 @@ public class NotificationPanelViewController extends PanelViewController * Whether the camera application can be launched for the camera launch gesture. */ public boolean canCameraGestureBeLaunched() { - if (!mStatusBar.isCameraAllowedByAdmin()) { + if (!mCentralSurfaces.isCameraAllowedByAdmin()) { return false; } @@ -4086,10 +4086,10 @@ public class NotificationPanelViewController extends PanelViewController * @param hideExpandedRunnable a runnable to run when we need to hide the expanded panel. */ public void initDependencies( - StatusBar statusBar, + CentralSurfaces centralSurfaces, Runnable hideExpandedRunnable, NotificationShelfController notificationShelfController) { - setStatusBar(statusBar); + setCentralSurfaces(centralSurfaces); mHideExpandedRunnable = hideExpandedRunnable; mNotificationStackScrollLayoutController.setShelfController(notificationShelfController); mNotificationShelfController = notificationShelfController; @@ -4162,7 +4162,7 @@ public class NotificationPanelViewController extends PanelViewController initDownStates(event); // Do not let touches go to shade or QS if the bouncer is visible, // but still let user swipe down to expand the panel, dismissing the bouncer. - if (mStatusBar.isBouncerShowing()) { + if (mCentralSurfaces.isBouncerShowing()) { return true; } if (mCommandQueue.panelsEnabled() @@ -4205,8 +4205,8 @@ public class NotificationPanelViewController extends PanelViewController // Do not allow panel expansion if bouncer is scrimmed or showing over a dream, // otherwise user would be able to pull down QS or expand the shade. - if (mStatusBar.isBouncerShowingScrimmed() - || mStatusBar.isBouncerShowingOverDream()) { + if (mCentralSurfaces.isBouncerShowingScrimmed() + || mCentralSurfaces.isBouncerShowingOverDream()) { return false; } @@ -4270,15 +4270,15 @@ public class NotificationPanelViewController extends PanelViewController new PhoneStatusBarView.TouchEventHandler() { @Override public void onInterceptTouchEvent(MotionEvent event) { - mStatusBar.onTouchEvent(event); + mCentralSurfaces.onTouchEvent(event); } @Override public boolean handleTouchEvent(MotionEvent event) { - mStatusBar.onTouchEvent(event); + mCentralSurfaces.onTouchEvent(event); // TODO(b/202981994): Move the touch debugging in this method to a central - // location. (Right now, it's split between StatusBar and here.) + // location. (Right now, it's split between CentralSurfaces and here.) // If panels aren't enabled, ignore the gesture and don't pass it down to the // panel view. @@ -4495,7 +4495,7 @@ public class NotificationPanelViewController extends PanelViewController : !rightPage; mIsLaunchTransitionRunning = true; mLaunchAnimationEndRunnable = null; - float displayDensity = mStatusBar.getDisplayDensity(); + float displayDensity = mCentralSurfaces.getDisplayDensity(); int lengthDp = Math.abs((int) (translation / displayDensity)); int velocityDp = Math.abs((int) (vel / displayDensity)); if (start) { @@ -4503,7 +4503,7 @@ public class NotificationPanelViewController extends PanelViewController mLockscreenGestureLogger.log(LockscreenUiEvent.LOCKSCREEN_DIALER); mFalsingCollector.onLeftAffordanceOn(); if (mFalsingCollector.shouldEnforceBouncer()) { - mStatusBar.executeRunnableDismissingKeyguard( + mCentralSurfaces.executeRunnableDismissingKeyguard( () -> mKeyguardBottomArea.launchLeftAffordance(), null, true /* dismissShade */, false /* afterKeyguardGone */, true /* deferred */); @@ -4519,7 +4519,7 @@ public class NotificationPanelViewController extends PanelViewController } mFalsingCollector.onCameraOn(); if (mFalsingCollector.shouldEnforceBouncer()) { - mStatusBar.executeRunnableDismissingKeyguard( + mCentralSurfaces.executeRunnableDismissingKeyguard( () -> mKeyguardBottomArea.launchCamera(mLastCameraLaunchSource), null, true /* dismissShade */, false /* afterKeyguardGone */, true /* deferred */); @@ -4527,7 +4527,7 @@ public class NotificationPanelViewController extends PanelViewController mKeyguardBottomArea.launchCamera(mLastCameraLaunchSource); } } - mStatusBar.startLaunchTransitionTimeout(); + mCentralSurfaces.startLaunchTransitionTimeout(); mBlockTouches = true; } @@ -4539,7 +4539,7 @@ public class NotificationPanelViewController extends PanelViewController mLaunchAnimationEndRunnable.run(); mLaunchAnimationEndRunnable = null; } - mStatusBar.readyForKeyguardDone(); + mCentralSurfaces.readyForKeyguardDone(); } @Override @@ -4576,18 +4576,18 @@ public class NotificationPanelViewController extends PanelViewController mHintAnimationRunning = true; mAffordanceHelper.startHintAnimation(rightIcon, () -> { mHintAnimationRunning = false; - mStatusBar.onHintFinished(); + mCentralSurfaces.onHintFinished(); }); rightIcon = mView.getLayoutDirection() == View.LAYOUT_DIRECTION_RTL ? !rightIcon : rightIcon; if (rightIcon) { - mStatusBar.onCameraHintStarted(); + mCentralSurfaces.onCameraHintStarted(); } else { if (mKeyguardBottomArea.isLeftVoiceAssist()) { - mStatusBar.onVoiceAssistHintStarted(); + mCentralSurfaces.onVoiceAssistHintStarted(); } else { - mStatusBar.onPhoneHintStarted(); + mCentralSurfaces.onPhoneHintStarted(); } } } @@ -4618,7 +4618,7 @@ public class NotificationPanelViewController extends PanelViewController @Override public float getAffordanceFalsingFactor() { - return mStatusBar.isWakeUpComingFromTouch() ? 1.5f : 1.0f; + return mCentralSurfaces.isWakeUpComingFromTouch() ? 1.5f : 1.0f; } @Override @@ -5134,7 +5134,7 @@ public class NotificationPanelViewController extends PanelViewController mView.sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED); } if (state == STATE_OPENING) { - mStatusBar.makeExpandedVisible(false); + mCentralSurfaces.makeExpandedVisible(false); } if (state == STATE_CLOSED) { // Close the status bar in the next frame so we can show the end of the diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationShadeWindowControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationShadeWindowControllerImpl.java index 5caf4f604fcd..0ff010aedfff 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationShadeWindowControllerImpl.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationShadeWindowControllerImpl.java @@ -840,7 +840,7 @@ public class NotificationShadeWindowControllerImpl implements NotificationShadeW Set<String> mComponentsForcingTopUi = new HashSet<>(); /** - * The {@link StatusBar} state from the status bar. + * The status bar state from {@link CentralSurfaces}. */ int mStatusBarState; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationShadeWindowView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationShadeWindowView.java index fb0e306b2e8b..1e3a02b0606b 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationShadeWindowView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationShadeWindowView.java @@ -58,7 +58,7 @@ import com.android.systemui.R; */ public class NotificationShadeWindowView extends FrameLayout { public static final String TAG = "NotificationShadeWindowView"; - public static final boolean DEBUG = StatusBar.DEBUG; + public static final boolean DEBUG = CentralSurfaces.DEBUG; private int mRightInset = 0; private int mLeftInset = 0; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationShadeWindowViewController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationShadeWindowViewController.java index 8a191f1614c3..101c86f6dac1 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationShadeWindowViewController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationShadeWindowViewController.java @@ -44,7 +44,7 @@ import com.android.systemui.statusbar.NotificationShadeWindowController; import com.android.systemui.statusbar.SysuiStatusBarStateController; import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout; import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayoutController; -import com.android.systemui.statusbar.phone.dagger.StatusBarComponent; +import com.android.systemui.statusbar.phone.dagger.CentralSurfacesComponent; import com.android.systemui.statusbar.phone.panelstate.PanelExpansionStateManager; import com.android.systemui.statusbar.window.StatusBarWindowStateController; import com.android.systemui.tuner.TunerService; @@ -58,7 +58,7 @@ import javax.inject.Inject; /** * Controller for {@link NotificationShadeWindowView}. */ -@StatusBarComponent.StatusBarScope +@CentralSurfacesComponent.CentralSurfacesScope public class NotificationShadeWindowViewController { private static final String TAG = "NotifShadeWindowVC"; private final FalsingCollector mFalsingCollector; @@ -79,7 +79,7 @@ public class NotificationShadeWindowViewController { private boolean mExpandAnimationRunning; private NotificationStackScrollLayout mStackScrollLayout; private PhoneStatusBarViewController mStatusBarViewController; - private final StatusBar mService; + private final CentralSurfaces mService; private final NotificationShadeWindowController mNotificationShadeWindowController; private DragDownHelper mDragDownHelper; private boolean mDoubleTapEnabled; @@ -108,7 +108,7 @@ public class NotificationShadeWindowViewController { StatusBarWindowStateController statusBarWindowStateController, LockIconViewController lockIconViewController, Optional<LowLightClockController> lowLightClockController, - StatusBar statusBar, + CentralSurfaces centralSurfaces, NotificationShadeWindowController controller) { mLockscreenShadeTransitionController = transitionController; mFalsingCollector = falsingCollector; @@ -124,7 +124,7 @@ public class NotificationShadeWindowViewController { mStatusBarWindowStateController = statusBarWindowStateController; mLockIconViewController = lockIconViewController; mLowLightClockController = lowLightClockController; - mService = statusBar; + mService = centralSurfaces; mNotificationShadeWindowController = controller; // This view is not part of the newly inflated expanded status bar. diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java index 249f9886253c..45dc943de2f8 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java @@ -27,7 +27,7 @@ public abstract class PanelView extends FrameLayout { public static final String TAG = PanelView.class.getSimpleName(); private PanelViewController.TouchHandler mTouchHandler; - protected StatusBar mStatusBar; + protected CentralSurfaces mCentralSurfaces; protected HeadsUpManagerPhone mHeadsUpManager; protected KeyguardBottomAreaView mKeyguardBottomArea; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java index 85e804233ed9..7c1775ed2a5e 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java @@ -113,7 +113,7 @@ public abstract class PanelViewController { Log.v(TAG, (mViewName != null ? (mViewName + ": ") : "") + String.format(fmt, args)); } - protected StatusBar mStatusBar; + protected CentralSurfaces mCentralSurfaces; protected HeadsUpManagerPhone mHeadsUpManager; protected final StatusBarTouchableRegionManager mStatusBarTouchableRegionManager; @@ -349,9 +349,9 @@ public abstract class PanelViewController { //TODO: keyguard opens QS a different way; log that too? // Log the position of the swipe that opened the panel - float width = mStatusBar.getDisplayWidth(); - float height = mStatusBar.getDisplayHeight(); - int rot = mStatusBar.getRotation(); + float width = mCentralSurfaces.getDisplayWidth(); + float height = mCentralSurfaces.getDisplayHeight(); + int rot = mCentralSurfaces.getRotation(); mLockscreenGestureLogger.writeAtFractionalPosition(MetricsEvent.ACTION_PANEL_VIEW_EXPAND, (int) (event.getX() / width * 100), (int) (event.getY() / height * 100), rot); @@ -433,10 +433,11 @@ public abstract class PanelViewController { } mDozeLog.traceFling(expand, mTouchAboveFalsingThreshold, - mStatusBar.isFalsingThresholdNeeded(), mStatusBar.isWakeUpComingFromTouch()); + mCentralSurfaces.isFalsingThresholdNeeded(), + mCentralSurfaces.isWakeUpComingFromTouch()); // Log collapse gesture if on lock screen. if (!expand && onKeyguard) { - float displayDensity = mStatusBar.getDisplayDensity(); + float displayDensity = mCentralSurfaces.getDisplayDensity(); int heightDp = (int) Math.abs((y - mInitialTouchY) / displayDensity); int velocityDp = (int) Math.abs(vel / displayDensity); mLockscreenGestureLogger.write(MetricsEvent.ACTION_LS_UNLOCK, heightDp, velocityDp); @@ -453,7 +454,7 @@ public abstract class PanelViewController { if (mUpdateFlingOnLayout) { mUpdateFlingVelocity = vel; } - } else if (!mStatusBar.isBouncerShowing() + } else if (!mCentralSurfaces.isBouncerShowing() && !mStatusBarKeyguardViewManager.isShowingAlternateAuthOrAnimating() && !mKeyguardStateController.isKeyguardGoingAway()) { boolean expands = onEmptySpaceClick(mInitialTouchX); @@ -469,7 +470,7 @@ public abstract class PanelViewController { } private int getFalsingThreshold() { - float factor = mStatusBar.isWakeUpComingFromTouch() ? 1.5f : 1.0f; + float factor = mCentralSurfaces.isWakeUpComingFromTouch() ? 1.5f : 1.0f; return (int) (mUnlockFalsingThreshold * factor); } @@ -479,14 +480,14 @@ public abstract class PanelViewController { protected void onTrackingStopped(boolean expand) { mTracking = false; - mStatusBar.onTrackingStopped(expand); + mCentralSurfaces.onTrackingStopped(expand); updatePanelExpansionAndVisibility(); } protected void onTrackingStarted() { endClosing(); mTracking = true; - mStatusBar.onTrackingStarted(); + mCentralSurfaces.onTrackingStarted(); notifyExpandingStarted(); updatePanelExpansionAndVisibility(); } @@ -556,7 +557,7 @@ public abstract class PanelViewController { */ private boolean isFalseTouch(float x, float y, @Classifier.InteractionType int interactionType) { - if (!mStatusBar.isFalsingThresholdNeeded()) { + if (!mCentralSurfaces.isFalsingThresholdNeeded()) { return false; } if (mFalsingManager.isClassifierEnabled()) { @@ -921,7 +922,7 @@ public abstract class PanelViewController { mView.getViewTreeObserver().removeOnGlobalLayoutListener(this); return; } - if (mStatusBar.getNotificationShadeWindowView().isVisibleToUser()) { + if (mCentralSurfaces.getNotificationShadeWindowView().isVisibleToUser()) { mView.getViewTreeObserver().removeOnGlobalLayoutListener(this); if (mAnimateAfterExpanding) { notifyExpandingStarted(); @@ -976,11 +977,11 @@ public abstract class PanelViewController { } protected void onUnlockHintFinished() { - mStatusBar.onHintFinished(); + mCentralSurfaces.onHintFinished(); } protected void onUnlockHintStarted() { - mStatusBar.onUnlockHintStarted(); + mCentralSurfaces.onUnlockHintStarted(); } public boolean isUnlockHintRunning() { @@ -1018,7 +1019,7 @@ public abstract class PanelViewController { View[] viewsToAnimate = { mKeyguardBottomArea.getIndicationArea(), - mStatusBar.getAmbientIndicationContainer()}; + mCentralSurfaces.getAmbientIndicationContainer()}; for (View v : viewsToAnimate) { if (v == null) { continue; @@ -1210,7 +1211,7 @@ public abstract class PanelViewController { switch (event.getActionMasked()) { case MotionEvent.ACTION_DOWN: - mStatusBar.userActivity(); + mCentralSurfaces.userActivity(); mAnimatingOnDown = mHeightAnimator != null && !mIsSpringBackAnimation; mMinExpandHeight = 0.0f; mDownTime = SystemClock.uptimeMillis(); @@ -1340,7 +1341,7 @@ public abstract class PanelViewController { onTrackingStarted(); } if (isFullyCollapsed() && !mHeadsUpManager.hasPinnedHeadsUp() - && !mStatusBar.isBouncerShowing()) { + && !mCentralSurfaces.isBouncerShowing()) { startOpening(event); } break; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScreenOffAnimationController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScreenOffAnimationController.kt index ea61a8b94e7e..c8174669cc65 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScreenOffAnimationController.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScreenOffAnimationController.kt @@ -37,8 +37,8 @@ class ScreenOffAnimationController @Inject constructor( private val animations: List<ScreenOffAnimation> = listOfNotNull(foldToAodAnimation, unlockedScreenOffAnimation) - fun initialize(statusBar: StatusBar, lightRevealScrim: LightRevealScrim) { - animations.forEach { it.initialize(statusBar, lightRevealScrim) } + fun initialize(centralSurfaces: CentralSurfaces, lightRevealScrim: LightRevealScrim) { + animations.forEach { it.initialize(centralSurfaces, lightRevealScrim) } wakefulnessLifecycle.addObserver(this) } @@ -131,7 +131,7 @@ class ScreenOffAnimationController @Inject constructor( animations.any { it.isKeyguardHideDelayed() } /** - * Return true to make the StatusBar expanded so we can animate [LightRevealScrim] + * Return true to make the status bar expanded so we can animate [LightRevealScrim] */ fun shouldShowLightRevealScrim(): Boolean = animations.any { it.shouldPlayAnimation() } @@ -197,7 +197,7 @@ class ScreenOffAnimationController @Inject constructor( } interface ScreenOffAnimation { - fun initialize(statusBar: StatusBar, lightRevealScrim: LightRevealScrim) {} + fun initialize(centralSurfaces: CentralSurfaces, lightRevealScrim: LightRevealScrim) {} /** * Called when started going to sleep, should return true if the animation will be played diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java index 8d64041ab76b..a3c795f36d5d 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java @@ -413,7 +413,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump } if (mKeyguardUpdateMonitor.needsSlowUnlockTransition() && mState == ScrimState.UNLOCKED) { - mAnimationDelay = StatusBar.FADE_KEYGUARD_START_DELAY; + mAnimationDelay = CentralSurfaces.FADE_KEYGUARD_START_DELAY; scheduleUpdate(); } else if (((oldState == ScrimState.AOD || oldState == ScrimState.PULSING) // leaving doze && (!mDozeParameters.getAlwaysOn() || mState == ScrimState.UNLOCKED)) @@ -1255,7 +1255,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump public void setScrimBehindChangeRunnable(Runnable changeRunnable) { // TODO: remove this. This is necessary because of an order-of-operations limitation. - // The fix is to move more of these class into @StatusBarScope + // The fix is to move more of these class into @CentralSurfacesScope if (mScrimBehind == null) { mScrimBehindChangeRunnable = changeRunnable; } else { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimState.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimState.java index bfd625bbd288..902887027667 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimState.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimState.java @@ -238,7 +238,7 @@ public enum ScrimState { mAnimationDuration = mKeyguardFadingAway ? mKeyguardFadingAwayDuration - : StatusBar.FADE_KEYGUARD_DURATION; + : CentralSurfaces.FADE_KEYGUARD_DURATION; boolean fromAod = previousState == AOD || previousState == PULSING; mAnimateChange = !mLaunchingAffordanceWithPreview && !fromAod; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ShadeController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ShadeController.java index 24bb7f25f2eb..83ee125f84c2 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ShadeController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ShadeController.java @@ -18,9 +18,9 @@ import com.android.systemui.statusbar.StatusBarState; /** * {@link ShadeController} is an abstraction of the work that used to be hard-coded in - * {@link StatusBar}. The shade itself represents the concept of the status bar window state, and - * can be in multiple states: dozing, locked, showing the bouncer, occluded, etc. All/some of these - * are coordinated with {@link StatusBarKeyguardViewManager} via + * {@link CentralSurfaces}. The shade itself represents the concept of the status bar window state, + * and can be in multiple states: dozing, locked, showing the bouncer, occluded, etc. All/some of + * these are coordinated with {@link StatusBarKeyguardViewManager} via * {@link com.android.systemui.keyguard.KeyguardViewMediator} and others. */ public interface ShadeController { @@ -38,7 +38,7 @@ public interface ShadeController { /** * Collapse the shade animated, showing the bouncer when on {@link StatusBarState#KEYGUARD} or - * dismissing {@link StatusBar} when on {@link StatusBarState#SHADE}. + * dismissing {@link CentralSurfaces} when on {@link StatusBarState#SHADE}. */ void animateCollapsePanels(int flags, boolean force); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ShadeControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ShadeControllerImpl.java index 53ef97dc317c..cee8b335f380 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ShadeControllerImpl.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ShadeControllerImpl.java @@ -47,7 +47,7 @@ public class ShadeControllerImpl implements ShadeController { protected final NotificationShadeWindowController mNotificationShadeWindowController; private final StatusBarKeyguardViewManager mStatusBarKeyguardViewManager; private final int mDisplayId; - protected final Lazy<Optional<StatusBar>> mStatusBarOptionalLazy; + protected final Lazy<Optional<CentralSurfaces>> mCentralSurfacesOptionalLazy; private final Lazy<AssistManager> mAssistManagerLazy; private final ArrayList<Runnable> mPostCollapseRunnables = new ArrayList<>(); @@ -59,7 +59,7 @@ public class ShadeControllerImpl implements ShadeController { NotificationShadeWindowController notificationShadeWindowController, StatusBarKeyguardViewManager statusBarKeyguardViewManager, WindowManager windowManager, - Lazy<Optional<StatusBar>> statusBarOptionalLazy, + Lazy<Optional<CentralSurfaces>> centralSurfacesOptionalLazy, Lazy<AssistManager> assistManagerLazy ) { mCommandQueue = commandQueue; @@ -67,15 +67,15 @@ public class ShadeControllerImpl implements ShadeController { mNotificationShadeWindowController = notificationShadeWindowController; mStatusBarKeyguardViewManager = statusBarKeyguardViewManager; mDisplayId = windowManager.getDefaultDisplay().getDisplayId(); - // TODO: Remove circular reference to StatusBar when possible. - mStatusBarOptionalLazy = statusBarOptionalLazy; + // TODO: Remove circular reference to CentralSurfaces when possible. + mCentralSurfacesOptionalLazy = centralSurfacesOptionalLazy; mAssistManagerLazy = assistManagerLazy; } @Override public void instantExpandNotificationsPanel() { // Make our window larger and the panel expanded. - getStatusBar().makeExpandedVisible(true /* force */); + getCentralSurfaces().makeExpandedVisible(true /* force */); getNotificationPanelViewController().expand(false /* animate */); mCommandQueue.recomputeDisableFlags(mDisplayId, false /* animate */); } @@ -110,7 +110,7 @@ public class ShadeControllerImpl implements ShadeController { } if (SPEW) { Log.d(TAG, "animateCollapse():" - + " mExpandedVisible=" + getStatusBar().isExpandedVisible() + + " mExpandedVisible=" + getCentralSurfaces().isExpandedVisible() + " flags=" + flags); } @@ -124,7 +124,7 @@ public class ShadeControllerImpl implements ShadeController { // release focus immediately to kick off focus change transition mNotificationShadeWindowController.setNotificationShadeFocusable(false); - getStatusBar().getNotificationShadeWindowViewController().cancelExpandHelper(); + getCentralSurfaces().getNotificationShadeWindowViewController().cancelExpandHelper(); getNotificationPanelViewController() .collapsePanel(true /* animate */, delayed, speedUpFactor); } @@ -136,7 +136,7 @@ public class ShadeControllerImpl implements ShadeController { if (!getNotificationPanelViewController().isFullyCollapsed()) { mCommandQueue.animateCollapsePanels( CommandQueue.FLAG_EXCLUDE_RECENTS_PANEL, true /* force */); - getStatusBar().visibilityChanged(false); + getCentralSurfaces().visibilityChanged(false); mAssistManagerLazy.get().hideAssist(); } return false; @@ -155,7 +155,7 @@ public class ShadeControllerImpl implements ShadeController { new ViewTreeObserver.OnGlobalLayoutListener() { @Override public void onGlobalLayout() { - if (getStatusBar().getNotificationShadeWindowView().isVisibleToUser()) { + if (getCentralSurfaces().getNotificationShadeWindowView().isVisibleToUser()) { getNotificationPanelViewController().removeOnGlobalLayoutListener(this); getNotificationPanelViewController().getView().post(executable); } @@ -185,7 +185,7 @@ public class ShadeControllerImpl implements ShadeController { // close the shade if it was open animateCollapsePanels(CommandQueue.FLAG_EXCLUDE_RECENTS_PANEL, true /* force */, true /* delayed */); - getStatusBar().visibilityChanged(false); + getCentralSurfaces().visibilityChanged(false); return true; } else { @@ -201,26 +201,26 @@ public class ShadeControllerImpl implements ShadeController { runPostCollapseRunnables(); } } else if (!getPresenter().isPresenterFullyCollapsed()) { - getStatusBar().instantCollapseNotificationPanel(); - getStatusBar().visibilityChanged(false); + getCentralSurfaces().instantCollapseNotificationPanel(); + getCentralSurfaces().visibilityChanged(false); } else { runPostCollapseRunnables(); } } - private StatusBar getStatusBar() { - return mStatusBarOptionalLazy.get().get(); + private CentralSurfaces getCentralSurfaces() { + return mCentralSurfacesOptionalLazy.get().get(); } private NotificationPresenter getPresenter() { - return getStatusBar().getPresenter(); + return getCentralSurfaces().getPresenter(); } protected NotificationShadeWindowView getNotificationShadeWindowView() { - return getStatusBar().getNotificationShadeWindowView(); + return getCentralSurfaces().getNotificationShadeWindowView(); } private NotificationPanelViewController getNotificationPanelViewController() { - return getStatusBar().getPanelController(); + return getCentralSurfaces().getPanelController(); } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/SplitShadeHeaderController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/phone/SplitShadeHeaderController.kt index a1be5acdac13..7555356af163 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/SplitShadeHeaderController.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/SplitShadeHeaderController.kt @@ -30,7 +30,7 @@ import com.android.systemui.flags.Flags import com.android.systemui.qs.ChipVisibilityListener import com.android.systemui.qs.HeaderPrivacyIconsController import com.android.systemui.qs.carrier.QSCarrierGroupController -import com.android.systemui.statusbar.phone.dagger.StatusBarComponent.StatusBarScope +import com.android.systemui.statusbar.phone.dagger.CentralSurfacesComponent.CentralSurfacesScope import com.android.systemui.statusbar.phone.dagger.StatusBarViewModule.SPLIT_SHADE_BATTERY_CONTROLLER import com.android.systemui.statusbar.phone.dagger.StatusBarViewModule.SPLIT_SHADE_HEADER import java.io.FileDescriptor @@ -38,7 +38,7 @@ import java.io.PrintWriter import javax.inject.Inject import javax.inject.Named -@StatusBarScope +@CentralSurfacesScope class SplitShadeHeaderController @Inject constructor( @Named(SPLIT_SHADE_HEADER) private val statusBar: View, private val statusBarIconController: StatusBarIconController, diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeadsUpChangeListener.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeadsUpChangeListener.java index 6eeae7f29839..50f21691b044 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeadsUpChangeListener.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeadsUpChangeListener.java @@ -22,14 +22,16 @@ import com.android.systemui.statusbar.NotificationShadeWindowController; import com.android.systemui.statusbar.StatusBarState; import com.android.systemui.statusbar.notification.collection.NotificationEntry; import com.android.systemui.statusbar.notification.init.NotificationsController; -import com.android.systemui.statusbar.phone.dagger.StatusBarComponent; +import com.android.systemui.statusbar.phone.dagger.CentralSurfacesComponent; import com.android.systemui.statusbar.policy.OnHeadsUpChangedListener; import com.android.systemui.statusbar.window.StatusBarWindowController; import javax.inject.Inject; -/** Ties the {@link StatusBar} to {@link com.android.systemui.statusbar.policy.HeadsUpManager}. */ -@StatusBarComponent.StatusBarScope +/** + * Ties the {@link CentralSurfaces} to {@link com.android.systemui.statusbar.policy.HeadsUpManager}. + */ +@CentralSurfacesComponent.CentralSurfacesScope public class StatusBarHeadsUpChangeListener implements OnHeadsUpChangedListener { private final NotificationShadeWindowController mNotificationShadeWindowController; private final StatusBarWindowController mStatusBarWindowController; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconControllerImpl.java index c5d3937173e7..94b4979b1fd6 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconControllerImpl.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconControllerImpl.java @@ -245,7 +245,7 @@ public class StatusBarIconControllerImpl extends StatusBarIconList implements Tu /** * Accept a list of CallIndicatorIconStates, and show the call strength icons. - * @param slot StatusBar slot for the call strength icons + * @param slot statusbar slot for the call strength icons * @param states All of the no Calling & SMS icon states */ @Override @@ -272,7 +272,7 @@ public class StatusBarIconControllerImpl extends StatusBarIconList implements Tu /** * Accept a list of CallIndicatorIconStates, and show the no calling icons. - * @param slot StatusBar slot for the no calling icons + * @param slot statusbar slot for the no calling icons * @param states All of the no Calling & SMS icon states */ @Override diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java index a96ba56be58d..c160c22203a5 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java @@ -124,8 +124,8 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb @Override public void onFullyShown() { updateStates(); - mStatusBar.wakeUpIfDozing(SystemClock.uptimeMillis(), - mStatusBar.getBouncerContainer(), "BOUNCER_VISIBLE"); + mCentralSurfaces.wakeUpIfDozing(SystemClock.uptimeMillis(), + mCentralSurfaces.getBouncerContainer(), "BOUNCER_VISIBLE"); } @Override @@ -175,7 +175,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb protected LockPatternUtils mLockPatternUtils; protected ViewMediatorCallback mViewMediatorCallback; - protected StatusBar mStatusBar; + protected CentralSurfaces mCentralSurfaces; private NotificationPanelViewController mNotificationPanelViewController; private BiometricUnlockController mBiometricUnlockController; @@ -277,16 +277,16 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb } @Override - public void registerStatusBar(StatusBar statusBar, + public void registerCentralSurfaces(CentralSurfaces centralSurfaces, NotificationPanelViewController notificationPanelViewController, PanelExpansionStateManager panelExpansionStateManager, BiometricUnlockController biometricUnlockController, View notificationContainer, KeyguardBypassController bypassController) { - mStatusBar = statusBar; + mCentralSurfaces = centralSurfaces; mBiometricUnlockController = biometricUnlockController; - ViewGroup container = mStatusBar.getBouncerContainer(); + ViewGroup container = mCentralSurfaces.getBouncerContainer(); mBouncer = mKeyguardBouncerFactory.create(container, mExpansionCallback); mNotificationPanelViewController = notificationPanelViewController; if (panelExpansionStateManager != null) { @@ -354,13 +354,13 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb } else if (mStatusBarStateController.getState() == StatusBarState.SHADE_LOCKED && mKeyguardUpdateManager.isUdfpsEnrolled()) { // Don't expand to the bouncer. Instead transition back to the lock screen (see - // StatusBar#showBouncerOrLockScreenIfKeyguard) where the user can use the UDFPS + // CentralSurfaces#showBouncerOrLockScreenIfKeyguard) where the user can use the UDFPS // affordance to enter the device (or swipe up to the input bouncer) return; } else if (bouncerNeedsScrimming()) { mBouncer.setExpansion(KeyguardBouncer.EXPANSION_VISIBLE); } else if (mShowing) { - if (!isWakeAndUnlocking() && !mStatusBar.isInLaunchTransition()) { + if (!isWakeAndUnlocking() && !mCentralSurfaces.isInLaunchTransition()) { mBouncer.setExpansion(fraction); } if (fraction != KeyguardBouncer.EXPANSION_HIDDEN && tracking @@ -371,7 +371,9 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb } else if (mPulsing && fraction == KeyguardBouncer.EXPANSION_VISIBLE) { // Panel expanded while pulsing but didn't translate the bouncer (because we are // unlocked.) Let's simply wake-up to dismiss the lock screen. - mStatusBar.wakeUpIfDozing(SystemClock.uptimeMillis(), mStatusBar.getBouncerContainer(), + mCentralSurfaces.wakeUpIfDozing( + SystemClock.uptimeMillis(), + mCentralSurfaces.getBouncerContainer(), "BOUNCER_VISIBLE"); } } @@ -408,10 +410,10 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb protected void showBouncerOrKeyguard(boolean hideBouncerWhenShowing) { if (mBouncer.needsFullscreenBouncer() && !mDozing) { // The keyguard might be showing (already). So we need to hide it. - mStatusBar.hideKeyguard(); + mCentralSurfaces.hideKeyguard(); mBouncer.show(true /* resetSecuritySelection */); } else { - mStatusBar.showKeyguard(); + mCentralSurfaces.showKeyguard(); if (hideBouncerWhenShowing) { hideBouncer(false /* destroyView */); mBouncer.prepare(); @@ -540,7 +542,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb mNotificationPanelViewController.resetViews(/* animate= */ true); // Hide bouncer and quick-quick settings. if (mOccluded && !mDozing) { - mStatusBar.hideKeyguard(); + mCentralSurfaces.hideKeyguard(); if (hideBouncerWhenShowing || mBouncer.needsFullscreenBouncer()) { hideBouncer(false /* destroyView */); } @@ -570,15 +572,15 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb mBypassController.setAltBouncerShowing(isShowingAlternateAuth()); if (updateScrim) { - mStatusBar.updateScrimController(); + mCentralSurfaces.updateScrimController(); } } @Override public void onStartedWakingUp() { - mStatusBar.getNotificationShadeWindowView().getWindowInsetsController() + mCentralSurfaces.getNotificationShadeWindowView().getWindowInsetsController() .setAnimationsDisabled(false); - NavigationBarView navBarView = mStatusBar.getNavigationBarView(); + NavigationBarView navBarView = mCentralSurfaces.getNavigationBarView(); if (navBarView != null) { navBarView.forEachView(view -> view.animate() @@ -590,9 +592,9 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb @Override public void onStartedGoingToSleep() { - mStatusBar.getNotificationShadeWindowView().getWindowInsetsController() + mCentralSurfaces.getNotificationShadeWindowView().getWindowInsetsController() .setAnimationsDisabled(true); - NavigationBarView navBarView = mStatusBar.getNavigationBarView(); + NavigationBarView navBarView = mCentralSurfaces.getNavigationBarView(); if (navBarView != null) { navBarView.forEachView(view -> view.animate() @@ -628,7 +630,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb } /** - * If {@link StatusBar} is pulsing. + * If {@link CentralSurfaces} is pulsing. */ public void setPulsing(boolean pulsing) { if (mPulsing != pulsing) { @@ -649,13 +651,13 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb @Override public void setOccluded(boolean occluded, boolean animate) { - mStatusBar.setOccluded(occluded); + mCentralSurfaces.setOccluded(occluded); if (occluded && !mOccluded && mShowing) { SysUiStatsLog.write(SysUiStatsLog.KEYGUARD_STATE_CHANGED, SysUiStatsLog.KEYGUARD_STATE_CHANGED__STATE__OCCLUDED); - if (mStatusBar.isInLaunchTransition()) { + if (mCentralSurfaces.isInLaunchTransition()) { setOccludedAndUpdateStates(true); - mStatusBar.fadeKeyguardAfterLaunchTransition(null /* beforeFading */, + mCentralSurfaces.fadeKeyguardAfterLaunchTransition(null /* beforeFading */, new Runnable() { @Override public void run() { @@ -666,7 +668,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb return; } - if (mStatusBar.isLaunchingActivityOverLockscreen()) { + if (mCentralSurfaces.isLaunchingActivityOverLockscreen()) { setOccludedAndUpdateStates(true); // When isLaunchingActivityOverLockscreen() is true, we know for sure that the post @@ -695,7 +697,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb reset(isOccluding /* hideBouncerWhenShowing*/); } if (animate && !occluded && mShowing && !mBouncer.isShowing()) { - mStatusBar.animateKeyguardUnoccluding(); + mCentralSurfaces.animateKeyguardUnoccluding(); } } @@ -712,7 +714,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb public void startPreHideAnimation(Runnable finishRunnable) { if (mBouncer.isShowing()) { mBouncer.startPreHideAnimation(finishRunnable); - mStatusBar.onBouncerPreHideAnimation(); + mCentralSurfaces.onBouncerPreHideAnimation(); // We update the state (which will show the keyguard) only if an animation will run on // the keyguard. If there is no animation, we wait before updating the state so that we @@ -745,11 +747,11 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb long uptimeMillis = SystemClock.uptimeMillis(); long delay = Math.max(0, startTime + HIDE_TIMING_CORRECTION_MS - uptimeMillis); - if (mStatusBar.isInLaunchTransition() + if (mCentralSurfaces.isInLaunchTransition() || mKeyguardStateController.isFlingingToDismissKeyguard()) { final boolean wasFlingingToDismissKeyguard = mKeyguardStateController.isFlingingToDismissKeyguard(); - mStatusBar.fadeKeyguardAfterLaunchTransition(new Runnable() { + mCentralSurfaces.fadeKeyguardAfterLaunchTransition(new Runnable() { @Override public void run() { mNotificationShadeWindowController.setKeyguardShowing(false); @@ -760,11 +762,11 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb }, new Runnable() { @Override public void run() { - mStatusBar.hideKeyguard(); + mCentralSurfaces.hideKeyguard(); mNotificationShadeWindowController.setKeyguardFadingAway(false); if (wasFlingingToDismissKeyguard) { - mStatusBar.finishKeyguardFadingAway(); + mCentralSurfaces.finishKeyguardFadingAway(); } mViewMediatorCallback.keyguardGone(); @@ -783,7 +785,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb delay = 0; fadeoutDuration = 240; } - mStatusBar.setKeyguardFadingAway(startTime, delay, fadeoutDuration, needsFading); + mCentralSurfaces.setKeyguardFadingAway(startTime, delay, fadeoutDuration, needsFading); mBiometricUnlockController.startKeyguardFadingAway(); hideBouncer(true /* destroyView */); if (wakeUnlockPulsing) { @@ -793,11 +795,11 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb mNotificationContainer, fadeoutDuration, () -> { - mStatusBar.hideKeyguard(); + mCentralSurfaces.hideKeyguard(); onKeyguardFadedAway(); }); } else { - mStatusBar.fadeKeyguardWhilePulsing(); + mCentralSurfaces.fadeKeyguardWhilePulsing(); } wakeAndUnlockDejank(); } else { @@ -810,20 +812,20 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb mNotificationContainer, fadeoutDuration, () -> { - mStatusBar.hideKeyguard(); + mCentralSurfaces.hideKeyguard(); }); } else { - mStatusBar.hideKeyguard(); + mCentralSurfaces.hideKeyguard(); } // hide() will happen asynchronously and might arrive after the scrims // were already hidden, this means that the transition callback won't // be triggered anymore and StatusBarWindowController will be forever in // the fadingAway state. - mStatusBar.updateScrimController(); + mCentralSurfaces.updateScrimController(); wakeAndUnlockDejank(); } else { - mStatusBar.hideKeyguard(); - mStatusBar.finishKeyguardFadingAway(); + mCentralSurfaces.hideKeyguard(); + mCentralSurfaces.finishKeyguardFadingAway(); mBiometricUnlockController.finishKeyguardFadingAway(); } } @@ -866,7 +868,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb mNotificationContainer.postDelayed(() -> mNotificationShadeWindowController .setKeyguardFadingAway(false), 100); ViewGroupFadeHelper.reset(mNotificationPanelViewController.getView()); - mStatusBar.finishKeyguardFadingAway(); + mCentralSurfaces.finishKeyguardFadingAway(); mBiometricUnlockController.finishKeyguardFadingAway(); WindowManagerGlobal.getInstance().trimMemory( ComponentCallbacks2.TRIM_MEMORY_UI_HIDDEN); @@ -897,7 +899,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb @Override public void dismissAndCollapse() { - mStatusBar.executeRunnableDismissingKeyguard(null, null, true, false, true); + mCentralSurfaces.executeRunnableDismissingKeyguard(null, null, true, false, true); } /** @@ -922,7 +924,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb */ public boolean onBackPressed(boolean hideImmediately) { if (mBouncer.isShowing()) { - mStatusBar.endAffordanceLaunch(); + mCentralSurfaces.endAffordanceLaunch(); // The second condition is for SIM card locked bouncer if (mBouncer.isScrimmed() && !mBouncer.needsFullscreenBouncer()) { hideBouncer(false); @@ -978,11 +980,11 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb private Runnable mMakeNavigationBarVisibleRunnable = new Runnable() { @Override public void run() { - NavigationBarView view = mStatusBar.getNavigationBarView(); + NavigationBarView view = mCentralSurfaces.getNavigationBarView(); if (view != null) { view.setVisibility(View.VISIBLE); } - mStatusBar.getNotificationShadeWindowView().getWindowInsetsController() + mCentralSurfaces.getNotificationShadeWindowView().getWindowInsetsController() .show(navigationBars()); } }; @@ -1013,7 +1015,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb if (bouncerShowing != mLastBouncerShowing || mFirstUpdate) { mNotificationShadeWindowController.setBouncerShowing(bouncerShowing); - mStatusBar.setBouncerShowing(bouncerShowing); + mCentralSurfaces.setBouncerShowing(bouncerShowing); } if (occluded != mLastOccluded || mFirstUpdate) { @@ -1040,11 +1042,11 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb mLastBiometricMode = mBiometricUnlockController.getMode(); mLastGesturalNav = mGesturalNav; mLastIsDocked = mIsDocked; - mStatusBar.onKeyguardViewManagerStatesUpdated(); + mCentralSurfaces.onKeyguardViewManagerStatesUpdated(); } private View getCurrentNavBarView() { - final NavigationBarView navBarView = mStatusBar.getNavigationBarView(); + final NavigationBarView navBarView = mCentralSurfaces.getNavigationBarView(); return navBarView != null ? navBarView.getCurrentView() : null; } @@ -1052,7 +1054,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb * Updates the visibility of the nav bar window (which will cause insets changes). */ protected void updateNavigationBarVisibility(boolean navBarVisible) { - if (mStatusBar.getNavigationBarView() != null) { + if (mCentralSurfaces.getNavigationBarView() != null) { if (navBarVisible) { long delay = getNavBarShowDelay(); if (delay == 0) { @@ -1063,7 +1065,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb } } else { mNotificationContainer.removeCallbacks(mMakeNavigationBarVisibleRunnable); - mStatusBar.getNotificationShadeWindowView().getWindowInsetsController() + mCentralSurfaces.getNotificationShadeWindowView().getWindowInsetsController() .hide(navigationBars()); } } @@ -1120,7 +1122,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb @Override public boolean shouldDisableWindowAnimationsForUnlock() { - return mStatusBar.isInLaunchTransition(); + return mCentralSurfaces.isInLaunchTransition(); } @Override @@ -1139,7 +1141,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb @Override public void keyguardGoingAway() { - mStatusBar.keyguardGoingAway(); + mCentralSurfaces.keyguardGoingAway(); } @Override diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarLaunchAnimatorController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarLaunchAnimatorController.kt index 09fca100749c..56b6dfc42ee3 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarLaunchAnimatorController.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarLaunchAnimatorController.kt @@ -10,34 +10,34 @@ import com.android.systemui.animation.LaunchAnimator */ class StatusBarLaunchAnimatorController( private val delegate: ActivityLaunchAnimator.Controller, - private val statusBar: StatusBar, + private val centralSurfaces: CentralSurfaces, private val isLaunchForActivity: Boolean = true ) : ActivityLaunchAnimator.Controller by delegate { // Always sync the opening window with the shade, given that we draw a hole punch in the shade // of the same size and position as the opening app to make it visible. override val openingWindowSyncView: View? - get() = statusBar.notificationShadeWindowView + get() = centralSurfaces.notificationShadeWindowView override fun onIntentStarted(willAnimate: Boolean) { delegate.onIntentStarted(willAnimate) if (!willAnimate) { - statusBar.collapsePanelOnMainThread() + centralSurfaces.collapsePanelOnMainThread() } } override fun onLaunchAnimationStart(isExpandingFullyAbove: Boolean) { delegate.onLaunchAnimationStart(isExpandingFullyAbove) - statusBar.notificationPanelViewController.setIsLaunchAnimationRunning(true) + centralSurfaces.notificationPanelViewController.setIsLaunchAnimationRunning(true) if (!isExpandingFullyAbove) { - statusBar.collapsePanelWithDuration( + centralSurfaces.collapsePanelWithDuration( ActivityLaunchAnimator.TIMINGS.totalDuration.toInt()) } } override fun onLaunchAnimationEnd(isExpandingFullyAbove: Boolean) { delegate.onLaunchAnimationEnd(isExpandingFullyAbove) - statusBar.notificationPanelViewController.setIsLaunchAnimationRunning(false) - statusBar.onLaunchAnimationEnd(isExpandingFullyAbove) + centralSurfaces.notificationPanelViewController.setIsLaunchAnimationRunning(false) + centralSurfaces.onLaunchAnimationEnd(isExpandingFullyAbove) } override fun onLaunchAnimationProgress( @@ -46,11 +46,11 @@ class StatusBarLaunchAnimatorController( linearProgress: Float ) { delegate.onLaunchAnimationProgress(state, progress, linearProgress) - statusBar.notificationPanelViewController.applyLaunchAnimationProgress(linearProgress) + centralSurfaces.notificationPanelViewController.applyLaunchAnimationProgress(linearProgress) } override fun onLaunchAnimationCancelled() { delegate.onLaunchAnimationCancelled() - statusBar.onLaunchAnimationCancelled(isLaunchForActivity) + centralSurfaces.onLaunchAnimationCancelled(isLaunchForActivity) } }
\ No newline at end of file diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarNotificationActivityStarter.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarNotificationActivityStarter.java index 74a1565df3fe..edbddbb3c3e7 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarNotificationActivityStarter.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarNotificationActivityStarter.java @@ -18,7 +18,7 @@ package com.android.systemui.statusbar.phone; import static android.service.notification.NotificationListenerService.REASON_CLICK; -import static com.android.systemui.statusbar.phone.StatusBar.getActivityOptions; +import static com.android.systemui.statusbar.phone.CentralSurfaces.getActivityOptions; import android.app.ActivityManager; import android.app.KeyguardManager; @@ -72,7 +72,7 @@ import com.android.systemui.statusbar.notification.interruption.NotificationInte import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow; import com.android.systemui.statusbar.notification.row.ExpandableNotificationRowDragController; import com.android.systemui.statusbar.notification.row.OnUserInteractionCallback; -import com.android.systemui.statusbar.phone.dagger.StatusBarComponent; +import com.android.systemui.statusbar.phone.dagger.CentralSurfacesComponent; import com.android.systemui.statusbar.policy.HeadsUpUtil; import com.android.systemui.statusbar.policy.KeyguardStateController; import com.android.systemui.wmshell.BubblesManager; @@ -87,7 +87,7 @@ import dagger.Lazy; /** * Status bar implementation of {@link NotificationActivityStarter}. */ -@StatusBarComponent.StatusBarScope +@CentralSurfacesComponent.CentralSurfacesScope class StatusBarNotificationActivityStarter implements NotificationActivityStarter { private final Context mContext; @@ -122,7 +122,7 @@ class StatusBarNotificationActivityStarter implements NotificationActivityStarte private final MetricsLogger mMetricsLogger; private final StatusBarNotificationActivityStarterLogger mLogger; - private final StatusBar mStatusBar; + private final CentralSurfaces mCentralSurfaces; private final NotificationPresenter mPresenter; private final NotificationPanelViewController mNotificationPanel; private final ActivityLaunchAnimator mActivityLaunchAnimator; @@ -162,7 +162,7 @@ class StatusBarNotificationActivityStarter implements NotificationActivityStarte MetricsLogger metricsLogger, StatusBarNotificationActivityStarterLogger logger, OnUserInteractionCallback onUserInteractionCallback, - StatusBar statusBar, + CentralSurfaces centralSurfaces, NotificationPresenter presenter, NotificationPanelViewController panel, ActivityLaunchAnimator activityLaunchAnimator, @@ -199,7 +199,7 @@ class StatusBarNotificationActivityStarter implements NotificationActivityStarte mOnUserInteractionCallback = onUserInteractionCallback; // TODO: use KeyguardStateController#isOccluded to remove this dependency - mStatusBar = statusBar; + mCentralSurfaces = centralSurfaces; mPresenter = presenter; mNotificationPanel = panel; mActivityLaunchAnimator = activityLaunchAnimator; @@ -259,7 +259,7 @@ class StatusBarNotificationActivityStarter implements NotificationActivityStarte && mActivityIntentHelper.wouldLaunchResolverActivity(intent.getIntent(), mLockscreenUserManager.getCurrentUserId()); final boolean animate = !willLaunchResolverActivity - && mStatusBar.shouldAnimateLaunch(isActivityIntent); + && mCentralSurfaces.shouldAnimateLaunch(isActivityIntent); boolean showOverLockscreen = mKeyguardStateController.isShowing() && intent != null && mActivityIntentHelper.wouldShowOverLockscreen(intent.getIntent(), mLockscreenUserManager.getCurrentUserId()); @@ -300,7 +300,7 @@ class StatusBarNotificationActivityStarter implements NotificationActivityStarte mShadeController.addPostCollapseAction(runnable); mShadeController.collapsePanel(true /* animate */); } else if (mKeyguardStateController.isShowing() - && mStatusBar.isOccluded()) { + && mCentralSurfaces.isOccluded()) { mStatusBarKeyguardViewManager.addAfterKeyguardGoneRunnable(runnable); mShadeController.collapsePanel(); } else { @@ -475,7 +475,8 @@ class StatusBarNotificationActivityStarter implements NotificationActivityStarte try { ActivityLaunchAnimator.Controller animationController = new StatusBarLaunchAnimatorController( - mNotificationAnimationProvider.getAnimatorController(row), mStatusBar, + mNotificationAnimationProvider.getAnimatorController(row), + mCentralSurfaces, isActivityIntent); mActivityLaunchAnimator.startPendingIntentWithAnimation(animationController, @@ -483,11 +484,11 @@ class StatusBarNotificationActivityStarter implements NotificationActivityStarte long eventTime = row.getAndResetLastActionUpTime(); Bundle options = eventTime > 0 ? getActivityOptions( - mStatusBar.getDisplayId(), + mCentralSurfaces.getDisplayId(), adapter, mKeyguardStateController.isShowing(), eventTime) - : getActivityOptions(mStatusBar.getDisplayId(), adapter); + : getActivityOptions(mCentralSurfaces.getDisplayId(), adapter); return intent.sendAndReturnResult(mContext, 0, fillInIntent, null, null, null, options); }); @@ -502,7 +503,7 @@ class StatusBarNotificationActivityStarter implements NotificationActivityStarte @Override public void startNotificationGutsIntent(final Intent intent, final int appUid, ExpandableNotificationRow row) { - boolean animate = mStatusBar.shouldAnimateLaunch(true /* isActivityIntent */); + boolean animate = mCentralSurfaces.shouldAnimateLaunch(true /* isActivityIntent */); ActivityStarter.OnDismissAction onDismissAction = new ActivityStarter.OnDismissAction() { @Override public boolean onDismiss() { @@ -510,14 +511,14 @@ class StatusBarNotificationActivityStarter implements NotificationActivityStarte ActivityLaunchAnimator.Controller animationController = new StatusBarLaunchAnimatorController( mNotificationAnimationProvider.getAnimatorController(row), - mStatusBar, true /* isActivityIntent */); + mCentralSurfaces, true /* isActivityIntent */); mActivityLaunchAnimator.startIntentWithAnimation( animationController, animate, intent.getPackage(), (adapter) -> TaskStackBuilder.create(mContext) .addNextIntentWithParentStack(intent) .startActivities(getActivityOptions( - mStatusBar.getDisplayId(), + mCentralSurfaces.getDisplayId(), adapter), new UserHandle(UserHandle.getUserId(appUid)))); }); @@ -535,7 +536,7 @@ class StatusBarNotificationActivityStarter implements NotificationActivityStarte @Override public void startHistoryIntent(View view, boolean showHistory) { - boolean animate = mStatusBar.shouldAnimateLaunch(true /* isActivityIntent */); + boolean animate = mCentralSurfaces.shouldAnimateLaunch(true /* isActivityIntent */); ActivityStarter.OnDismissAction onDismissAction = new ActivityStarter.OnDismissAction() { @Override public boolean onDismiss() { @@ -555,13 +556,14 @@ class StatusBarNotificationActivityStarter implements NotificationActivityStarte ); ActivityLaunchAnimator.Controller animationController = viewController == null ? null - : new StatusBarLaunchAnimatorController(viewController, mStatusBar, + : new StatusBarLaunchAnimatorController(viewController, + mCentralSurfaces, true /* isActivityIntent */); mActivityLaunchAnimator.startIntentWithAnimation(animationController, animate, intent.getPackage(), (adapter) -> tsb.startActivities( - getActivityOptions(mStatusBar.getDisplayId(), adapter), + getActivityOptions(mCentralSurfaces.getDisplayId(), adapter), UserHandle.CURRENT)); }); return true; @@ -615,7 +617,7 @@ class StatusBarNotificationActivityStarter implements NotificationActivityStarte try { EventLog.writeEvent(EventLogTags.SYSUI_FULLSCREEN_NOTIFICATION, entry.getKey()); - mStatusBar.wakeUpForFullScreenIntent(); + mCentralSurfaces.wakeUpForFullScreenIntent(); fullscreenIntent.send(); entry.notifyFullScreenIntentLaunched(); mMetricsLogger.count("note_fullscreen", 1); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarNotificationPresenter.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarNotificationPresenter.java index de66bb09ccf8..aa061d74f6c6 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarNotificationPresenter.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarNotificationPresenter.java @@ -14,9 +14,9 @@ package com.android.systemui.statusbar.phone; -import static com.android.systemui.statusbar.phone.StatusBar.CLOSE_PANEL_WHEN_EMPTIED; -import static com.android.systemui.statusbar.phone.StatusBar.DEBUG; -import static com.android.systemui.statusbar.phone.StatusBar.MULTIUSER_DEBUG; +import static com.android.systemui.statusbar.phone.CentralSurfaces.CLOSE_PANEL_WHEN_EMPTIED; +import static com.android.systemui.statusbar.phone.CentralSurfaces.DEBUG; +import static com.android.systemui.statusbar.phone.CentralSurfaces.MULTIUSER_DEBUG; import android.app.KeyguardManager; import android.content.Context; @@ -71,7 +71,7 @@ import com.android.systemui.statusbar.notification.row.NotificationInfo.CheckSav import com.android.systemui.statusbar.notification.stack.NotificationListContainer; import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayoutController; import com.android.systemui.statusbar.phone.LockscreenGestureLogger.LockscreenUiEvent; -import com.android.systemui.statusbar.phone.dagger.StatusBarComponent; +import com.android.systemui.statusbar.phone.dagger.CentralSurfacesComponent; import com.android.systemui.statusbar.policy.ConfigurationController; import com.android.systemui.statusbar.policy.KeyguardStateController; @@ -79,7 +79,7 @@ import java.util.List; import javax.inject.Inject; -@StatusBarComponent.StatusBarScope +@CentralSurfacesComponent.CentralSurfacesScope class StatusBarNotificationPresenter implements NotificationPresenter, ConfigurationController.ConfigurationListener, NotificationRowBinderImpl.BindRowCallback, @@ -104,7 +104,7 @@ class StatusBarNotificationPresenter implements NotificationPresenter, private final DozeScrimController mDozeScrimController; private final ScrimController mScrimController; private final KeyguardIndicationController mKeyguardIndicationController; - private final StatusBar mStatusBar; + private final CentralSurfaces mCentralSurfaces; private final ShadeController mShadeController; private final LockscreenShadeTransitionController mShadeTransitionController; private final CommandQueue mCommandQueue; @@ -135,7 +135,7 @@ class StatusBarNotificationPresenter implements NotificationPresenter, DynamicPrivacyController dynamicPrivacyController, KeyguardStateController keyguardStateController, KeyguardIndicationController keyguardIndicationController, - StatusBar statusBar, + CentralSurfaces centralSurfaces, ShadeController shadeController, LockscreenShadeTransitionController shadeTransitionController, CommandQueue commandQueue, @@ -162,7 +162,7 @@ class StatusBarNotificationPresenter implements NotificationPresenter, mDynamicPrivacyController = dynamicPrivacyController; mKeyguardIndicationController = keyguardIndicationController; // TODO: use KeyguardStateController#isOccluded to remove this dependency - mStatusBar = statusBar; + mCentralSurfaces = centralSurfaces; mShadeController = shadeController; mShadeTransitionController = shadeTransitionController; mCommandQueue = commandQueue; @@ -352,7 +352,7 @@ class StatusBarNotificationPresenter implements NotificationPresenter, updateNotificationViews("user switched"); } mMediaManager.clearCurrentMediaNotification(); - mStatusBar.setLockscreenUser(newUserId); + mCentralSurfaces.setLockscreenUser(newUserId); updateMediaMetaData(true, false); } @@ -406,7 +406,8 @@ class StatusBarNotificationPresenter implements NotificationPresenter, public void onExpandClicked(NotificationEntry clickedEntry, View clickedView, boolean nowExpanded) { mHeadsUpManager.setExpanded(clickedEntry, nowExpanded); - mStatusBar.wakeUpIfDozing(SystemClock.uptimeMillis(), clickedView, "NOTIFICATION_CLICK"); + mCentralSurfaces.wakeUpIfDozing( + SystemClock.uptimeMillis(), clickedView, "NOTIFICATION_CLICK"); if (nowExpanded) { if (mStatusBarStateController.getState() == StatusBarState.KEYGUARD) { mShadeTransitionController.goToLockedShade(clickedEntry.getRow()); @@ -474,7 +475,7 @@ class StatusBarNotificationPresenter implements NotificationPresenter, @Override public boolean suppressAwakeHeadsUp(NotificationEntry entry) { final StatusBarNotification sbn = entry.getSbn(); - if (mStatusBar.isOccluded()) { + if (mCentralSurfaces.isOccluded()) { boolean devicePublic = mLockscreenUserManager .isLockscreenPublicMode(mLockscreenUserManager.getCurrentUserId()); boolean userPublic = devicePublic @@ -497,7 +498,7 @@ class StatusBarNotificationPresenter implements NotificationPresenter, // we don't allow head-up on the lockscreen (unless there's a // "showWhenLocked" activity currently showing) if // the potential HUN has a fullscreen intent - if (mKeyguardStateController.isShowing() && !mStatusBar.isOccluded()) { + if (mKeyguardStateController.isShowing() && !mCentralSurfaces.isOccluded()) { if (DEBUG) { Log.d(TAG, "No heads up: entry has fullscreen intent on lockscreen " + sbn.getKey()); @@ -522,7 +523,7 @@ class StatusBarNotificationPresenter implements NotificationPresenter, @Override public boolean suppressInterruptions(NotificationEntry entry) { - return mStatusBar.areNotificationAlertsDisabled(); + return mCentralSurfaces.areNotificationAlertsDisabled(); } }; } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarSignalPolicy.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarSignalPolicy.java index b0206f073011..ee242a4b1b75 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarSignalPolicy.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarSignalPolicy.java @@ -44,7 +44,7 @@ import java.util.Objects; import javax.inject.Inject; -/** Controls the signal policies for icons shown in the StatusBar. **/ +/** Controls the signal policies for icons shown in the statusbar. **/ @SysUISingleton public class StatusBarSignalPolicy implements SignalCallback, SecurityController.SecurityControllerCallback, Tunable { @@ -449,7 +449,7 @@ public class StatusBarSignalPolicy implements SignalCallback, } /** - * Stores the StatusBar state for no Calling & SMS. + * Stores the statusbar state for no Calling & SMS. */ public static class CallIndicatorIconState { public boolean isNoCalling; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarTouchableRegionManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarTouchableRegionManager.java index b742394b18a5..95667cc0b972 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarTouchableRegionManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarTouchableRegionManager.java @@ -59,7 +59,7 @@ public final class StatusBarTouchableRegionManager implements Dumpable { private boolean mIsStatusBarExpanded = false; private boolean mShouldAdjustInsets = false; - private StatusBar mStatusBar; + private CentralSurfaces mCentralSurfaces; private View mNotificationShadeWindowView; private View mNotificationPanelView; private boolean mForceCollapsedUntilLayout = false; @@ -119,9 +119,9 @@ public final class StatusBarTouchableRegionManager implements Dumpable { } protected void setup( - @NonNull StatusBar statusBar, + @NonNull CentralSurfaces centralSurfaces, @NonNull View notificationShadeWindowView) { - mStatusBar = statusBar; + mCentralSurfaces = centralSurfaces; mNotificationShadeWindowView = notificationShadeWindowView; mNotificationPanelView = mNotificationShadeWindowView.findViewById(R.id.notification_panel); } @@ -246,7 +246,7 @@ public final class StatusBarTouchableRegionManager implements Dumpable { new OnComputeInternalInsetsListener() { @Override public void onComputeInternalInsets(ViewTreeObserver.InternalInsetsInfo info) { - if (mIsStatusBarExpanded || mStatusBar.isBouncerShowing()) { + if (mIsStatusBarExpanded || mCentralSurfaces.isBouncerShowing()) { // The touchable region is always the full area when expanded return; } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/TapAgainViewController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/TapAgainViewController.java index 26ba31c6f526..582afb1a23ea 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/TapAgainViewController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/TapAgainViewController.java @@ -20,7 +20,7 @@ import static com.android.systemui.classifier.FalsingModule.DOUBLE_TAP_TIMEOUT_M import com.android.internal.annotations.VisibleForTesting; import com.android.systemui.dagger.qualifiers.Main; -import com.android.systemui.statusbar.phone.dagger.StatusBarComponent; +import com.android.systemui.statusbar.phone.dagger.CentralSurfacesComponent; import com.android.systemui.statusbar.policy.ConfigurationController; import com.android.systemui.statusbar.policy.ConfigurationController.ConfigurationListener; import com.android.systemui.util.ViewController; @@ -32,7 +32,7 @@ import javax.inject.Named; /** * Controller for {@link TapAgainView}. */ -@StatusBarComponent.StatusBarScope +@CentralSurfacesComponent.CentralSurfacesScope public class TapAgainViewController extends ViewController<TapAgainView> { private final DelayableExecutor mDelayableExecutor; private final ConfigurationController mConfigurationController; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/UnlockedScreenOffAnimationController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/phone/UnlockedScreenOffAnimationController.kt index 09ff46bed074..c11d450e47b2 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/UnlockedScreenOffAnimationController.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/UnlockedScreenOffAnimationController.kt @@ -60,7 +60,7 @@ class UnlockedScreenOffAnimationController @Inject constructor( private val handler: Handler = Handler() ) : WakefulnessLifecycle.Observer, ScreenOffAnimation { - private lateinit var statusBar: StatusBar + private lateinit var mCentralSurfaces: CentralSurfaces private lateinit var lightRevealScrim: LightRevealScrim private var animatorDurationScale = 1f @@ -100,7 +100,8 @@ class UnlockedScreenOffAnimationController @Inject constructor( } override fun onAnimationStart(animation: Animator?) { - interactionJankMonitor.begin(statusBar.notificationShadeWindowView, CUJ_SCREEN_OFF) + interactionJankMonitor.begin( + mCentralSurfaces.notificationShadeWindowView, CUJ_SCREEN_OFF) } }) } @@ -112,11 +113,11 @@ class UnlockedScreenOffAnimationController @Inject constructor( } override fun initialize( - statusBar: StatusBar, + centralSurfaces: CentralSurfaces, lightRevealScrim: LightRevealScrim ) { this.lightRevealScrim = lightRevealScrim - this.statusBar = statusBar + this.mCentralSurfaces = centralSurfaces updateAnimatorDurationScale() globalSettings.registerContentObserver( @@ -171,9 +172,9 @@ class UnlockedScreenOffAnimationController @Inject constructor( // Lock the keyguard if it was waiting for the screen off animation to end. keyguardViewMediatorLazy.get().maybeHandlePendingLock() - // Tell the StatusBar to become keyguard for real - we waited on that since - // it is slow and would have caused the animation to jank. - statusBar.updateIsKeyguard() + // Tell the CentralSurfaces to become keyguard for real - we waited on that + // since it is slow and would have caused the animation to jank. + mCentralSurfaces.updateIsKeyguard() // Run the callback given to us by the KeyguardVisibilityHelper. after.run() @@ -191,7 +192,8 @@ class UnlockedScreenOffAnimationController @Inject constructor( override fun onAnimationStart(animation: Animator?) { interactionJankMonitor.begin( - statusBar.notificationShadeWindowView, CUJ_SCREEN_OFF_SHOW_AOD) + mCentralSurfaces.notificationShadeWindowView, + CUJ_SCREEN_OFF_SHOW_AOD) } }) .start() @@ -208,12 +210,12 @@ class UnlockedScreenOffAnimationController @Inject constructor( override fun onFinishedWakingUp() { // Set this to false in onFinishedWakingUp rather than onStartedWakingUp so that other - // observers (such as StatusBar) can ask us whether we were playing the screen off animation - // and reset accordingly. + // observers (such as CentralSurfaces) can ask us whether we were playing the screen off + // animation and reset accordingly. aodUiAnimationPlaying = false - // If we can't control the screen off animation, we shouldn't mess with the StatusBar's - // keyguard state unnecessarily. + // If we can't control the screen off animation, we shouldn't mess with the + // CentralSurfaces's keyguard state unnecessarily. if (dozeParameters.get().canControlUnlockedScreenOff()) { // Make sure the status bar is in the correct keyguard state, forcing it if necessary. // This is required if the screen off animation is cancelled, since it might be @@ -222,7 +224,7 @@ class UnlockedScreenOffAnimationController @Inject constructor( // even if we're going from SHADE to SHADE or KEYGUARD to KEYGUARD, since we might have // changed parts of the UI (such as showing AOD in the shade) without actually changing // the StatusBarState. This ensures that the UI definitely reflects the desired state. - statusBar.updateIsKeyguard(true /* forceStateChange */) + mCentralSurfaces.updateIsKeyguard(true /* forceStateChange */) } } @@ -244,7 +246,7 @@ class UnlockedScreenOffAnimationController @Inject constructor( // Show AOD. That'll cause the KeyguardVisibilityHelper to call // #animateInKeyguard. - statusBar.notificationPanelViewController.showAodUi() + mCentralSurfaces.notificationPanelViewController.showAodUi() } }, (ANIMATE_IN_KEYGUARD_DELAY * animatorDurationScale).toLong()) @@ -280,8 +282,8 @@ class UnlockedScreenOffAnimationController @Inject constructor( // We currently draw both the light reveal scrim, and the AOD UI, in the shade. If it's // already expanded and showing notifications/QS, the animation looks really messy. For now, // disable it if the notification panel is not fully collapsed. - if ((!this::statusBar.isInitialized || - !statusBar.notificationPanelViewController.isFullyCollapsed) && + if ((!this::mCentralSurfaces.isInitialized || + !mCentralSurfaces.notificationPanelViewController.isFullyCollapsed) && // Status bar might be expanded because we have started // playing the animation already !isAnimationPlaying() diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/dagger/StatusBarComponent.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/dagger/CentralSurfacesComponent.java index 75461883fa5e..59c9d0baea3f 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/dagger/StatusBarComponent.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/dagger/CentralSurfacesComponent.java @@ -31,11 +31,11 @@ import com.android.systemui.statusbar.notification.collection.render.StatusBarNo import com.android.systemui.statusbar.notification.stack.NotificationListContainer; import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayoutController; import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayoutListContainerModule; +import com.android.systemui.statusbar.phone.CentralSurfacesCommandQueueCallbacks; import com.android.systemui.statusbar.phone.NotificationPanelViewController; import com.android.systemui.statusbar.phone.NotificationShadeWindowView; import com.android.systemui.statusbar.phone.NotificationShadeWindowViewController; import com.android.systemui.statusbar.phone.SplitShadeHeaderController; -import com.android.systemui.statusbar.phone.StatusBarCommandQueueCallbacks; import com.android.systemui.statusbar.phone.StatusBarHeadsUpChangeListener; import com.android.systemui.statusbar.phone.StatusBarNotificationActivityStarterModule; import com.android.systemui.statusbar.phone.StatusBarNotificationPresenterModule; @@ -52,7 +52,7 @@ import dagger.Subcomponent; /** * Dagger subcomponent for classes (semi-)related to the status bar. The component is created once - * inside {@link com.android.systemui.statusbar.phone.StatusBar} and never re-created. + * inside {@link com.android.systemui.statusbar.phone.CentralSurfaces} and never re-created. * * TODO(b/197137564): This should likely be re-factored a bit. It includes classes that aren't * directly related to status bar functionality, like multiple notification classes. And, the fact @@ -66,27 +66,26 @@ import dagger.Subcomponent; StatusBarNotificationActivityStarterModule.class, StatusBarNotificationPresenterModule.class, }) -@StatusBarComponent.StatusBarScope -public interface StatusBarComponent { - +@CentralSurfacesComponent.CentralSurfacesScope +public interface CentralSurfacesComponent { /** - * Builder for {@link StatusBarComponent}. + * Builder for {@link CentralSurfacesComponent}. */ @Subcomponent.Factory interface Factory { - StatusBarComponent create(); + CentralSurfacesComponent create(); } /** - * Scope annotation for singleton items within the StatusBarComponent. + * Scope annotation for singleton items within the CentralSurfacesComponent. */ @Documented @Retention(RUNTIME) @Scope - @interface StatusBarScope {} + @interface CentralSurfacesScope {} /** - * Performs initialization logic after {@link StatusBarComponent} has been constructed. + * Performs initialization logic after {@link CentralSurfacesComponent} has been constructed. */ interface Startable { void start(); @@ -130,9 +129,9 @@ public interface StatusBarComponent { StatusBarHeadsUpChangeListener getStatusBarHeadsUpChangeListener(); /** - * Creates a StatusBarCommandQueueCallbacks. + * Creates a CentralSurfacesCommandQueueCallbacks. */ - StatusBarCommandQueueCallbacks getStatusBarCommandQueueCallbacks(); + CentralSurfacesCommandQueueCallbacks getCentralSurfacesCommandQueueCallbacks(); /** * Creates a SplitShadeHeaderController. @@ -152,7 +151,7 @@ public interface StatusBarComponent { StatusBarInitializer getStatusBarInitializer(); /** - * Set of startables to be run after a StatusBarComponent has been constructed. + * Set of startables to be run after a CentralSurfacesComponent has been constructed. */ Set<Startable> getStartables(); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/dagger/StatusBarPhoneModule.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/dagger/StatusBarPhoneModule.java index 6bfafac10e9f..c024c7245c45 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/dagger/StatusBarPhoneModule.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/dagger/StatusBarPhoneModule.java @@ -92,7 +92,7 @@ import com.android.systemui.statusbar.phone.PhoneStatusBarPolicy; import com.android.systemui.statusbar.phone.ScreenOffAnimationController; import com.android.systemui.statusbar.phone.ScrimController; import com.android.systemui.statusbar.phone.ShadeController; -import com.android.systemui.statusbar.phone.StatusBar; +import com.android.systemui.statusbar.phone.CentralSurfaces; import com.android.systemui.statusbar.phone.StatusBarHideIconsForBouncerManager; import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager; import com.android.systemui.statusbar.phone.StatusBarSignalPolicy; @@ -126,16 +126,16 @@ import dagger.Module; import dagger.Provides; /** - * Dagger Module providing {@link StatusBar}. + * Dagger Module providing {@link CentralSurfaces}. */ @Module public interface StatusBarPhoneModule { /** - * Provides our instance of StatusBar which is considered optional. + * Provides our instance of CentralSurfaces which is considered optional. */ @Provides @SysUISingleton - static StatusBar provideStatusBar( + static CentralSurfaces provideCentralSurfaces( Context context, NotificationsController notificationsController, FragmentService fragmentService, @@ -195,7 +195,7 @@ public interface StatusBarPhoneModule { DozeScrimController dozeScrimController, VolumeComponent volumeComponent, CommandQueue commandQueue, - StatusBarComponent.Factory statusBarComponentFactory, + CentralSurfacesComponent.Factory statusBarComponentFactory, PluginManager pluginManager, ShadeController shadeController, StatusBarKeyguardViewManager statusBarKeyguardViewManager, @@ -231,7 +231,7 @@ public interface StatusBarPhoneModule { DeviceStateManager deviceStateManager, DreamOverlayStateController dreamOverlayStateController, WiredChargingRippleController wiredChargingRippleController) { - return new StatusBar( + return new CentralSurfaces( context, notificationsController, fragmentService, diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/dagger/StatusBarViewModule.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/dagger/StatusBarViewModule.java index ebd58fb8ebed..fd3e3f61620e 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/dagger/StatusBarViewModule.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/dagger/StatusBarViewModule.java @@ -77,7 +77,7 @@ public abstract class StatusBarViewModule { /** */ @Provides - @StatusBarComponent.StatusBarScope + @CentralSurfacesComponent.CentralSurfacesScope public static NotificationShadeWindowView providesNotificationShadeWindowView( LayoutInflater layoutInflater) { NotificationShadeWindowView notificationShadeWindowView = (NotificationShadeWindowView) @@ -92,7 +92,7 @@ public abstract class StatusBarViewModule { /** */ @Provides - @StatusBarComponent.StatusBarScope + @CentralSurfacesComponent.CentralSurfacesScope public static NotificationStackScrollLayout providesNotificationStackScrollLayout( NotificationShadeWindowView notificationShadeWindowView) { return notificationShadeWindowView.findViewById(R.id.notification_stack_scroller); @@ -100,7 +100,7 @@ public abstract class StatusBarViewModule { /** */ @Provides - @StatusBarComponent.StatusBarScope + @CentralSurfacesComponent.CentralSurfacesScope public static NotificationShelf providesNotificationShelf(LayoutInflater layoutInflater, NotificationStackScrollLayout notificationStackScrollLayout) { NotificationShelf view = (NotificationShelf) layoutInflater.inflate( @@ -115,7 +115,7 @@ public abstract class StatusBarViewModule { /** */ @Provides - @StatusBarComponent.StatusBarScope + @CentralSurfacesComponent.CentralSurfacesScope public static NotificationShelfController providesStatusBarWindowView( NotificationShelfComponent.Builder notificationShelfComponentBuilder, NotificationShelf notificationShelf) { @@ -131,7 +131,7 @@ public abstract class StatusBarViewModule { /** */ @Provides - @StatusBarComponent.StatusBarScope + @CentralSurfacesComponent.CentralSurfacesScope public static NotificationPanelView getNotificationPanelView( NotificationShadeWindowView notificationShadeWindowView) { return notificationShadeWindowView.getNotificationPanelView(); @@ -139,7 +139,7 @@ public abstract class StatusBarViewModule { /** */ @Provides - @StatusBarComponent.StatusBarScope + @CentralSurfacesComponent.CentralSurfacesScope public static LockIconView getLockIconView( NotificationShadeWindowView notificationShadeWindowView) { return notificationShadeWindowView.findViewById(R.id.lock_icon_view); @@ -147,7 +147,7 @@ public abstract class StatusBarViewModule { /** */ @Provides - @StatusBarComponent.StatusBarScope + @CentralSurfacesComponent.CentralSurfacesScope @Nullable public static AuthRippleView getAuthRippleView( NotificationShadeWindowView notificationShadeWindowView) { @@ -157,7 +157,7 @@ public abstract class StatusBarViewModule { /** */ @Provides @Named(SPLIT_SHADE_HEADER) - @StatusBarComponent.StatusBarScope + @CentralSurfacesComponent.CentralSurfacesScope public static View getSplitShadeStatusBarView( NotificationShadeWindowView notificationShadeWindowView, FeatureFlags featureFlags) { @@ -172,7 +172,7 @@ public abstract class StatusBarViewModule { /** */ @Provides - @StatusBarComponent.StatusBarScope + @CentralSurfacesComponent.CentralSurfacesScope public static OngoingPrivacyChip getSplitShadeOngoingPrivacyChip( @Named(SPLIT_SHADE_HEADER) View header) { return header.findViewById(R.id.privacy_chip); @@ -180,21 +180,21 @@ public abstract class StatusBarViewModule { /** */ @Provides - @StatusBarComponent.StatusBarScope + @CentralSurfacesComponent.CentralSurfacesScope static StatusIconContainer providesStatusIconContainer(@Named(SPLIT_SHADE_HEADER) View header) { return header.findViewById(R.id.statusIcons); } /** */ @Provides - @StatusBarComponent.StatusBarScope + @CentralSurfacesComponent.CentralSurfacesScope @Named(SPLIT_SHADE_BATTERY_VIEW) static BatteryMeterView getBatteryMeterView(@Named(SPLIT_SHADE_HEADER) View view) { return view.findViewById(R.id.batteryRemainingIcon); } @Provides - @StatusBarComponent.StatusBarScope + @CentralSurfacesComponent.CentralSurfacesScope @Named(SPLIT_SHADE_BATTERY_CONTROLLER) static BatteryMeterViewController getBatteryMeterViewController( @Named(SPLIT_SHADE_BATTERY_VIEW) BatteryMeterView batteryMeterView, @@ -218,14 +218,14 @@ public abstract class StatusBarViewModule { /** */ @Provides - @StatusBarComponent.StatusBarScope + @CentralSurfacesComponent.CentralSurfacesScope public static TapAgainView getTapAgainView(NotificationPanelView npv) { return npv.getTapAgainView(); } /** */ @Provides - @StatusBarComponent.StatusBarScope + @CentralSurfacesComponent.CentralSurfacesScope public static NotificationsQuickSettingsContainer getNotificationsQuickSettingsContainer( NotificationShadeWindowView notificationShadeWindowView) { return notificationShadeWindowView.findViewById(R.id.notification_container_parent); @@ -235,9 +235,9 @@ public abstract class StatusBarViewModule { * Creates a new {@link CollapsedStatusBarFragment}. * * **IMPORTANT**: This method intentionally does not have - * {@link StatusBarComponent.StatusBarScope}, which means a new fragment *will* be created each - * time this method is called. This is intentional because we need fragments to re-created in - * certain lifecycle scenarios. + * {@link CentralSurfacesComponent.CentralSurfacesScope}, which means a new fragment *will* be + * created each time this method is called. This is intentional because we need fragments to + * re-created in certain lifecycle scenarios. * * This provider is {@link Named} such that it does not conflict with the provider inside of * {@link StatusBarFragmentComponent}. diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/dagger/StatusBarFragmentComponent.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/dagger/StatusBarFragmentComponent.java index 22b7f649775e..2eba325ff63d 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/dagger/StatusBarFragmentComponent.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/dagger/StatusBarFragmentComponent.java @@ -18,12 +18,14 @@ package com.android.systemui.statusbar.phone.fragment.dagger; import com.android.systemui.battery.BatteryMeterViewController; import com.android.systemui.dagger.qualifiers.RootView; +import com.android.systemui.statusbar.phone.CentralSurfaces; import com.android.systemui.statusbar.phone.HeadsUpAppearanceController; import com.android.systemui.statusbar.phone.LightsOutNotifController; import com.android.systemui.statusbar.phone.PhoneStatusBarTransitions; import com.android.systemui.statusbar.phone.PhoneStatusBarView; import com.android.systemui.statusbar.phone.PhoneStatusBarViewController; import com.android.systemui.statusbar.phone.StatusBarDemoMode; +import com.android.systemui.statusbar.phone.dagger.CentralSurfacesComponent; import com.android.systemui.statusbar.phone.fragment.CollapsedStatusBarFragment; import dagger.BindsInstance; @@ -39,12 +41,6 @@ import dagger.Subcomponent; * * Anything that depends on {@link CollapsedStatusBarFragment} or {@link PhoneStatusBarView} * should be included here or in {@link StatusBarFragmentModule}. - * - * Note that this is completely separate from - * {@link com.android.systemui.statusbar.phone.dagger.StatusBarComponent}. This component gets - * re-created on each new fragment creation, whereas - * {@link com.android.systemui.statusbar.phone.dagger.StatusBarComponent} is only created once in - * {@link com.android.systemui.statusbar.phone.StatusBar} and never re-created. */ @Subcomponent(modules = {StatusBarFragmentModule.class}) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/window/StatusBarWindowStateController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/window/StatusBarWindowStateController.kt index 3a1491400f38..60f6df66cb5a 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/window/StatusBarWindowStateController.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/window/StatusBarWindowStateController.kt @@ -25,7 +25,7 @@ import android.util.Log import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dagger.qualifiers.DisplayId import com.android.systemui.statusbar.CommandQueue -import com.android.systemui.statusbar.phone.StatusBar +import com.android.systemui.statusbar.phone.CentralSurfaces import javax.inject.Inject /** @@ -80,8 +80,8 @@ class StatusBarWindowStateController @Inject constructor( } windowState = state - if (StatusBar.DEBUG_WINDOW_STATE) { - Log.d(StatusBar.TAG, "Status bar " + windowStateToString(state)) + if (CentralSurfaces.DEBUG_WINDOW_STATE) { + Log.d(CentralSurfaces.TAG, "Status bar " + windowStateToString(state)) } listeners.forEach { it.onStatusBarWindowStateChanged(state) } } diff --git a/packages/SystemUI/src/com/android/systemui/unfold/FoldAodAnimationController.kt b/packages/SystemUI/src/com/android/systemui/unfold/FoldAodAnimationController.kt index e2374ada15d5..d6dfceac7a63 100644 --- a/packages/SystemUI/src/com/android/systemui/unfold/FoldAodAnimationController.kt +++ b/packages/SystemUI/src/com/android/systemui/unfold/FoldAodAnimationController.kt @@ -26,7 +26,7 @@ import com.android.systemui.dagger.qualifiers.Main import com.android.systemui.keyguard.WakefulnessLifecycle import com.android.systemui.statusbar.LightRevealScrim import com.android.systemui.statusbar.phone.ScreenOffAnimation -import com.android.systemui.statusbar.phone.StatusBar +import com.android.systemui.statusbar.phone.CentralSurfaces import com.android.systemui.statusbar.policy.CallbackController import com.android.systemui.unfold.FoldAodAnimationController.FoldAodAnimationStatus import com.android.systemui.util.settings.GlobalSettings @@ -50,7 +50,7 @@ constructor( private val globalSettings: GlobalSettings ) : CallbackController<FoldAodAnimationStatus>, ScreenOffAnimation, WakefulnessLifecycle.Observer { - private lateinit var statusBar: StatusBar + private lateinit var mCentralSurfaces: CentralSurfaces private var isFolded = false private var isFoldHandled = true @@ -66,14 +66,14 @@ constructor( private val statusListeners = arrayListOf<FoldAodAnimationStatus>() private val startAnimationRunnable = Runnable { - statusBar.notificationPanelViewController.startFoldToAodAnimation { + mCentralSurfaces.notificationPanelViewController.startFoldToAodAnimation { // End action setAnimationState(playing = false) } } - override fun initialize(statusBar: StatusBar, lightRevealScrim: LightRevealScrim) { - this.statusBar = statusBar + override fun initialize(centralSurfaces: CentralSurfaces, lightRevealScrim: LightRevealScrim) { + this.mCentralSurfaces = centralSurfaces deviceStateManager.registerCallback(executor, FoldListener()) wakefulnessLifecycle.addObserver(this) @@ -88,7 +88,7 @@ constructor( globalSettings.getString(Settings.Global.ANIMATOR_DURATION_SCALE) != "0" ) { setAnimationState(playing = true) - statusBar.notificationPanelViewController.prepareFoldToAodAnimation() + mCentralSurfaces.notificationPanelViewController.prepareFoldToAodAnimation() true } else { setAnimationState(playing = false) @@ -98,7 +98,7 @@ constructor( override fun onStartedWakingUp() { if (isAnimationPlaying) { handler.removeCallbacks(startAnimationRunnable) - statusBar.notificationPanelViewController.cancelFoldToAodAnimation() + mCentralSurfaces.notificationPanelViewController.cancelFoldToAodAnimation() } setAnimationState(playing = false) @@ -131,12 +131,14 @@ constructor( // We should play the folding to AOD animation setAnimationState(playing = true) - statusBar.notificationPanelViewController.prepareFoldToAodAnimation() + mCentralSurfaces.notificationPanelViewController.prepareFoldToAodAnimation() // We don't need to wait for the scrim as it is already displayed // but we should wait for the initial animation preparations to be drawn // (setting initial alpha/translation) - OneShotPreDrawListener.add(statusBar.notificationPanelViewController.view, onReady) + OneShotPreDrawListener.add( + mCentralSurfaces.notificationPanelViewController.view, onReady + ) } else { // No animation, call ready callback immediately onReady.run() diff --git a/packages/SystemUI/tests/src/com/android/systemui/biometrics/AuthRippleControllerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/biometrics/AuthRippleControllerTest.kt index 5128ccc15d9d..ec2c1de49b4c 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/biometrics/AuthRippleControllerTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/biometrics/AuthRippleControllerTest.kt @@ -32,7 +32,7 @@ import com.android.systemui.statusbar.NotificationShadeWindowController import com.android.systemui.statusbar.commandline.CommandRegistry import com.android.systemui.statusbar.phone.BiometricUnlockController import com.android.systemui.statusbar.phone.KeyguardBypassController -import com.android.systemui.statusbar.phone.StatusBar +import com.android.systemui.statusbar.phone.CentralSurfaces import com.android.systemui.statusbar.policy.ConfigurationController import com.android.systemui.statusbar.policy.KeyguardStateController import com.android.systemui.util.leak.RotationUtils @@ -61,7 +61,7 @@ class AuthRippleControllerTest : SysuiTestCase() { private lateinit var staticMockSession: MockitoSession private lateinit var controller: AuthRippleController - @Mock private lateinit var statusBar: StatusBar + @Mock private lateinit var mCentralSurfaces: CentralSurfaces @Mock private lateinit var rippleView: AuthRippleView @Mock private lateinit var commandRegistry: CommandRegistry @Mock private lateinit var configurationController: ConfigurationController @@ -89,7 +89,7 @@ class AuthRippleControllerTest : SysuiTestCase() { `when`(udfpsControllerProvider.get()).thenReturn(udfpsController) controller = AuthRippleController( - statusBar, + mCentralSurfaces, context, authController, configurationController, @@ -105,7 +105,7 @@ class AuthRippleControllerTest : SysuiTestCase() { rippleView ) controller.init() - `when`(statusBar.lightRevealScrim).thenReturn(lightRevealScrim) + `when`(mCentralSurfaces.lightRevealScrim).thenReturn(lightRevealScrim) } @After diff --git a/packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsControllerTest.java index 35e838bfca9a..1856fda14e1b 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsControllerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsControllerTest.java @@ -65,7 +65,7 @@ import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.statusbar.LockscreenShadeTransitionController; import com.android.systemui.statusbar.VibratorHelper; import com.android.systemui.statusbar.phone.KeyguardBypassController; -import com.android.systemui.statusbar.phone.StatusBar; +import com.android.systemui.statusbar.phone.CentralSurfaces; import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager; import com.android.systemui.statusbar.phone.SystemUIDialogManager; import com.android.systemui.statusbar.phone.UnlockedScreenOffAnimationController; @@ -121,7 +121,7 @@ public class UdfpsControllerTest extends SysuiTestCase { @Mock private StatusBarStateController mStatusBarStateController; @Mock - private StatusBar mStatusBar; + private CentralSurfaces mCentralSurfaces; @Mock private StatusBarKeyguardViewManager mStatusBarKeyguardViewManager; @Mock diff --git a/packages/SystemUI/tests/src/com/android/systemui/dreams/touch/BouncerSwipeTouchHandlerTest.java b/packages/SystemUI/tests/src/com/android/systemui/dreams/touch/BouncerSwipeTouchHandlerTest.java index d51151627be1..6e01541c75e0 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/dreams/touch/BouncerSwipeTouchHandlerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/dreams/touch/BouncerSwipeTouchHandlerTest.java @@ -40,7 +40,7 @@ import com.android.systemui.SysuiTestCase; import com.android.systemui.shared.system.InputChannelCompat; import com.android.systemui.statusbar.NotificationShadeWindowController; import com.android.systemui.statusbar.phone.KeyguardBouncer; -import com.android.systemui.statusbar.phone.StatusBar; +import com.android.systemui.statusbar.phone.CentralSurfaces; import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager; import com.android.wm.shell.animation.FlingAnimationUtils; @@ -59,7 +59,7 @@ public class BouncerSwipeTouchHandlerTest extends SysuiTestCase { StatusBarKeyguardViewManager mStatusBarKeyguardViewManager; @Mock - StatusBar mStatusBar; + CentralSurfaces mCentralSurfaces; @Mock NotificationShadeWindowController mNotificationShadeWindowController; @@ -103,7 +103,7 @@ public class BouncerSwipeTouchHandlerTest extends SysuiTestCase { mTouchHandler = new BouncerSwipeTouchHandler( mDisplayMetrics, mStatusBarKeyguardViewManager, - mStatusBar, + mCentralSurfaces, mNotificationShadeWindowController, mValueAnimatorCreator, mVelocityTrackerFactory, @@ -111,7 +111,7 @@ public class BouncerSwipeTouchHandlerTest extends SysuiTestCase { mFlingAnimationUtilsClosing, TOUCH_REGION); - when(mStatusBar.getDisplayHeight()).thenReturn((float) SCREEN_HEIGHT_PX); + when(mCentralSurfaces.getDisplayHeight()).thenReturn((float) SCREEN_HEIGHT_PX); when(mValueAnimatorCreator.create(anyFloat(), anyFloat())).thenReturn(mValueAnimator); when(mVelocityTrackerFactory.obtain()).thenReturn(mVelocityTracker); } diff --git a/packages/SystemUI/tests/src/com/android/systemui/globalactions/GlobalActionsDialogLiteTest.java b/packages/SystemUI/tests/src/com/android/systemui/globalactions/GlobalActionsDialogLiteTest.java index 953be7d6f002..6fead9efa767 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/globalactions/GlobalActionsDialogLiteTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/globalactions/GlobalActionsDialogLiteTest.java @@ -60,7 +60,7 @@ import com.android.systemui.plugins.GlobalActions; import com.android.systemui.settings.UserContextProvider; import com.android.systemui.statusbar.NotificationShadeWindowController; import com.android.systemui.statusbar.VibratorHelper; -import com.android.systemui.statusbar.phone.StatusBar; +import com.android.systemui.statusbar.phone.CentralSurfaces; import com.android.systemui.statusbar.policy.ConfigurationController; import com.android.systemui.statusbar.policy.KeyguardStateController; import com.android.systemui.telephony.TelephonyListenerManager; @@ -113,7 +113,7 @@ public class GlobalActionsDialogLiteTest extends SysuiTestCase { @Mock private Handler mHandler; @Mock private UserContextProvider mUserContextProvider; @Mock private VibratorHelper mVibratorHelper; - @Mock private StatusBar mStatusBar; + @Mock private CentralSurfaces mCentralSurfaces; @Mock private KeyguardUpdateMonitor mKeyguardUpdateMonitor; @Mock private DialogLaunchAnimator mDialogLaunchAnimator; @@ -158,7 +158,7 @@ public class GlobalActionsDialogLiteTest extends SysuiTestCase { mRingerModeTracker, mHandler, mPackageManager, - Optional.of(mStatusBar), + Optional.of(mCentralSurfaces), mKeyguardUpdateMonitor, mDialogLaunchAnimator); mGlobalActionsDialogLite.setZeroDialogPressDelayForTesting(); @@ -227,7 +227,7 @@ public class GlobalActionsDialogLiteTest extends SysuiTestCase { doReturn(4).when(mGlobalActionsDialogLite).getMaxShownPowerItems(); doReturn(true).when(mGlobalActionsDialogLite).shouldDisplayLockdown(any()); doReturn(true).when(mGlobalActionsDialogLite).shouldShowAction(any()); - doReturn(true).when(mStatusBar).isKeyguardShowing(); + doReturn(true).when(mCentralSurfaces).isKeyguardShowing(); String[] actions = { GlobalActionsDialogLite.GLOBAL_ACTION_KEY_EMERGENCY, GlobalActionsDialogLite.GLOBAL_ACTION_KEY_LOCKDOWN, @@ -242,7 +242,7 @@ public class GlobalActionsDialogLiteTest extends SysuiTestCase { MotionEvent end = MotionEvent.obtain(0, 0, MotionEvent.ACTION_DOWN, 0, 500, 0); gestureListener.onFling(start, end, 0, 1000); verifyLogPosted(GlobalActionsDialogLite.GlobalActionsEvent.GA_CLOSE_TAP_OUTSIDE); - verify(mStatusBar).animateExpandSettingsPanel(null); + verify(mCentralSurfaces).animateExpandSettingsPanel(null); } @Test @@ -251,7 +251,7 @@ public class GlobalActionsDialogLiteTest extends SysuiTestCase { doReturn(4).when(mGlobalActionsDialogLite).getMaxShownPowerItems(); doReturn(true).when(mGlobalActionsDialogLite).shouldDisplayLockdown(any()); doReturn(true).when(mGlobalActionsDialogLite).shouldShowAction(any()); - doReturn(false).when(mStatusBar).isKeyguardShowing(); + doReturn(false).when(mCentralSurfaces).isKeyguardShowing(); String[] actions = { GlobalActionsDialogLite.GLOBAL_ACTION_KEY_EMERGENCY, GlobalActionsDialogLite.GLOBAL_ACTION_KEY_LOCKDOWN, @@ -266,7 +266,7 @@ public class GlobalActionsDialogLiteTest extends SysuiTestCase { MotionEvent end = MotionEvent.obtain(0, 0, MotionEvent.ACTION_DOWN, 0, 500, 0); gestureListener.onFling(start, end, 0, 1000); verifyLogPosted(GlobalActionsDialogLite.GlobalActionsEvent.GA_CLOSE_TAP_OUTSIDE); - verify(mStatusBar).animateExpandNotificationsPanel(); + verify(mCentralSurfaces).animateExpandNotificationsPanel(); } @Test @@ -432,7 +432,7 @@ public class GlobalActionsDialogLiteTest extends SysuiTestCase { doReturn(4).when(mGlobalActionsDialogLite).getMaxShownPowerItems(); doReturn(true).when(mGlobalActionsDialogLite).shouldDisplayLockdown(any()); doReturn(true).when(mGlobalActionsDialogLite).shouldShowAction(any()); - doReturn(false).when(mStatusBar).isKeyguardShowing(); + doReturn(false).when(mCentralSurfaces).isKeyguardShowing(); String[] actions = { GlobalActionsDialogLite.GLOBAL_ACTION_KEY_EMERGENCY, GlobalActionsDialogLite.GLOBAL_ACTION_KEY_LOCKDOWN, diff --git a/packages/SystemUI/tests/src/com/android/systemui/navigationbar/NavBarHelperTest.java b/packages/SystemUI/tests/src/com/android/systemui/navigationbar/NavBarHelperTest.java index 3a95ed3da84d..634d9e4642b3 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/navigationbar/NavBarHelperTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/navigationbar/NavBarHelperTest.java @@ -37,8 +37,7 @@ import com.android.systemui.assist.AssistManager; import com.android.systemui.dump.DumpManager; import com.android.systemui.recents.OverviewProxyService; import com.android.systemui.settings.UserTracker; -import com.android.systemui.statusbar.phone.StatusBar; -import com.android.systemui.statusbar.policy.AccessibilityManagerWrapper; +import com.android.systemui.statusbar.phone.CentralSurfaces; import org.junit.Before; import org.junit.Test; @@ -91,7 +90,7 @@ public class NavBarHelperTest extends SysuiTestCase { mNavBarHelper = new NavBarHelper(mContext, mAccessibilityManager, mAccessibilityButtonModeObserver, mAccessibilityButtonTargetObserver, mSystemActions, mOverviewProxyService, mAssistManagerLazy, - () -> Optional.of(mock(StatusBar.class)), + () -> Optional.of(mock(CentralSurfaces.class)), mNavigationModeController, mUserTracker, mDumpManager); } diff --git a/packages/SystemUI/tests/src/com/android/systemui/navigationbar/NavigationBarTest.java b/packages/SystemUI/tests/src/com/android/systemui/navigationbar/NavigationBarTest.java index 5a652fc15a48..eb1e1a2e3d04 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/navigationbar/NavigationBarTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/navigationbar/NavigationBarTest.java @@ -94,7 +94,7 @@ import com.android.systemui.statusbar.phone.AutoHideController; import com.android.systemui.statusbar.phone.LightBarController; import com.android.systemui.statusbar.phone.NotificationShadeWindowView; import com.android.systemui.statusbar.phone.ShadeController; -import com.android.systemui.statusbar.phone.StatusBar; +import com.android.systemui.statusbar.phone.CentralSurfaces; import com.android.systemui.statusbar.policy.DeviceProvisionedController; import com.android.systemui.statusbar.policy.KeyguardStateController; import com.android.systemui.utils.leaks.LeakCheckedTest; @@ -160,7 +160,7 @@ public class NavigationBarTest extends SysuiTestCase { @Mock private AssistManager mAssistManager; @Mock - private StatusBar mStatusBar; + private CentralSurfaces mCentralSurfaces; @Rule public final LeakCheckedTest.SysuiLeakCheck mLeakCheck = new LeakCheckedTest.SysuiLeakCheck(); @@ -189,7 +189,7 @@ public class NavigationBarTest extends SysuiTestCase { mock(AccessibilityButtonModeObserver.class), mock(AccessibilityButtonTargetsObserver.class), mSystemActions, mOverviewProxyService, - () -> mock(AssistManager.class), () -> Optional.of(mStatusBar), + () -> mock(AssistManager.class), () -> Optional.of(mCentralSurfaces), mock(NavigationModeController.class), mock(UserTracker.class), mock(DumpManager.class))); mNavigationBar = createNavBar(mContext); @@ -282,7 +282,7 @@ public class NavigationBarTest extends SysuiTestCase { NotificationShadeWindowView mockShadeWindowView = mock(NotificationShadeWindowView.class); WindowInsets windowInsets = new WindowInsets.Builder().setVisible(ime(), false).build(); doReturn(windowInsets).when(mockShadeWindowView).getRootWindowInsets(); - doReturn(mockShadeWindowView).when(mStatusBar).getNotificationShadeWindowView(); + doReturn(mockShadeWindowView).when(mCentralSurfaces).getNotificationShadeWindowView(); doReturn(true).when(mockShadeWindowView).isAttachedToWindow(); doNothing().when(defaultNavBar).checkNavBarModes(); doNothing().when(externalNavBar).checkNavBarModes(); @@ -318,7 +318,7 @@ public class NavigationBarTest extends SysuiTestCase { @Test public void testSetImeWindowStatusWhenKeyguardLockingAndImeInsetsChange() { NotificationShadeWindowView mockShadeWindowView = mock(NotificationShadeWindowView.class); - doReturn(mockShadeWindowView).when(mStatusBar).getNotificationShadeWindowView(); + doReturn(mockShadeWindowView).when(mCentralSurfaces).getNotificationShadeWindowView(); doReturn(true).when(mockShadeWindowView).isAttachedToWindow(); doNothing().when(mNavigationBar).checkNavBarModes(); mNavigationBar.createView(null, /* initialVisibility= */ true); @@ -335,7 +335,7 @@ public class NavigationBarTest extends SysuiTestCase { // Verify navbar didn't alter and showing back icon when the keyguard is showing without // requesting IME insets visible. - doReturn(true).when(mStatusBar).isKeyguardShowing(); + doReturn(true).when(mCentralSurfaces).isKeyguardShowing(); mNavigationBar.setImeWindowStatus(DEFAULT_DISPLAY, null, IME_VISIBLE, BACK_DISPOSITION_DEFAULT, true); assertFalse((mNavigationBar.getNavigationIconHints() & NAVIGATION_HINT_BACK_ALT) != 0); @@ -401,7 +401,7 @@ public class NavigationBarTest extends SysuiTestCase { mCommandQueue, Optional.of(mock(Pip.class)), Optional.of(mock(Recents.class)), - () -> Optional.of(mStatusBar), + () -> Optional.of(mCentralSurfaces), mock(ShadeController.class), mock(NotificationRemoteInputManager.class), mock(NotificationShadeDepthController.class), diff --git a/packages/SystemUI/tests/src/com/android/systemui/power/PowerUITest.java b/packages/SystemUI/tests/src/com/android/systemui/power/PowerUITest.java index 721809c83cd8..373770ec976b 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/power/PowerUITest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/power/PowerUITest.java @@ -48,7 +48,7 @@ import com.android.systemui.SysuiTestCase; import com.android.systemui.broadcast.BroadcastDispatcher; import com.android.systemui.power.PowerUI.WarningsUI; import com.android.systemui.statusbar.CommandQueue; -import com.android.systemui.statusbar.phone.StatusBar; +import com.android.systemui.statusbar.phone.CentralSurfaces; import org.junit.Before; import org.junit.Test; @@ -89,14 +89,14 @@ public class PowerUITest extends SysuiTestCase { private IThermalEventListener mSkinThermalEventListener; @Mock private BroadcastDispatcher mBroadcastDispatcher; @Mock private CommandQueue mCommandQueue; - @Mock private Lazy<Optional<StatusBar>> mStatusBarOptionalLazy; - @Mock private StatusBar mStatusBar; + @Mock private Lazy<Optional<CentralSurfaces>> mCentralSurfacesOptionalLazy; + @Mock private CentralSurfaces mCentralSurfaces; @Before public void setup() { MockitoAnnotations.initMocks(this); - when(mStatusBarOptionalLazy.get()).thenReturn(Optional.of(mStatusBar)); + when(mCentralSurfacesOptionalLazy.get()).thenReturn(Optional.of(mCentralSurfaces)); createPowerUi(); mSkinThermalEventListener = mPowerUI.new SkinThermalEventListener(); @@ -685,7 +685,7 @@ public class PowerUITest extends SysuiTestCase { private void createPowerUi() { mPowerUI = new PowerUI( - mContext, mBroadcastDispatcher, mCommandQueue, mStatusBarOptionalLazy, + mContext, mBroadcastDispatcher, mCommandQueue, mCentralSurfacesOptionalLazy, mMockWarnings, mEnhancedEstimates, mPowerManager); mPowerUI.mThermalService = mThermalServiceMock; } diff --git a/packages/SystemUI/tests/src/com/android/systemui/qs/QSFragmentTest.java b/packages/SystemUI/tests/src/com/android/systemui/qs/QSFragmentTest.java index 4ab39261e825..534c7e7f2029 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/qs/QSFragmentTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/qs/QSFragmentTest.java @@ -56,7 +56,7 @@ import com.android.systemui.shared.plugins.PluginManager; import com.android.systemui.statusbar.CommandQueue; import com.android.systemui.statusbar.phone.AutoTileManager; import com.android.systemui.statusbar.phone.KeyguardBypassController; -import com.android.systemui.statusbar.phone.StatusBar; +import com.android.systemui.statusbar.phone.CentralSurfaces; import com.android.systemui.statusbar.phone.StatusBarIconController; import com.android.systemui.statusbar.policy.Clock; import com.android.systemui.statusbar.policy.ConfigurationController; @@ -142,7 +142,7 @@ public class QSFragmentTest extends SysuiBaseFragmentTest { mock(QSFactoryImpl.class), new Handler(), Looper.myLooper(), mock(PluginManager.class), mock(TunerService.class), () -> mock(AutoTileManager.class), mock(DumpManager.class), - mock(BroadcastDispatcher.class), Optional.of(mock(StatusBar.class)), + mock(BroadcastDispatcher.class), Optional.of(mock(CentralSurfaces.class)), mock(QSLogger.class), mock(UiEventLogger.class), mock(UserTracker.class), mock(SecureSettings.class), mock(CustomTileStatePersister.class), mTileServiceRequestControllerBuilder, mock(TileLifecycleManager.Factory.class)); diff --git a/packages/SystemUI/tests/src/com/android/systemui/qs/QSTileHostTest.java b/packages/SystemUI/tests/src/com/android/systemui/qs/QSTileHostTest.java index 8872e28647a7..e67d37ac3c72 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/qs/QSTileHostTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/qs/QSTileHostTest.java @@ -65,7 +65,7 @@ import com.android.systemui.qs.tileimpl.QSTileImpl; import com.android.systemui.settings.UserTracker; import com.android.systemui.shared.plugins.PluginManager; import com.android.systemui.statusbar.phone.AutoTileManager; -import com.android.systemui.statusbar.phone.StatusBar; +import com.android.systemui.statusbar.phone.CentralSurfaces; import com.android.systemui.statusbar.phone.StatusBarIconController; import com.android.systemui.tuner.TunerService; import com.android.systemui.util.settings.FakeSettings; @@ -112,7 +112,7 @@ public class QSTileHostTest extends SysuiTestCase { @Mock private QSTile.State mMockState; @Mock - private StatusBar mStatusBar; + private CentralSurfaces mCentralSurfaces; @Mock private QSLogger mQSLogger; @Mock @@ -152,7 +152,7 @@ public class QSTileHostTest extends SysuiTestCase { QSTileHost.TILES_SETTING, "", "", false, mUserTracker.getUserId(), false); mQSTileHost = new TestQSTileHost(mContext, mIconController, mDefaultFactory, mHandler, mLooper.getLooper(), mPluginManager, mTunerService, mAutoTiles, mDumpManager, - mBroadcastDispatcher, mStatusBar, mQSLogger, mUiEventLogger, mUserTracker, + mBroadcastDispatcher, mCentralSurfaces, mQSLogger, mUiEventLogger, mUserTracker, mSecureSettings, mCustomTileStatePersister, mTileServiceRequestControllerBuilder, mTileLifecycleManagerFactory); setUpTileFactory(); @@ -437,15 +437,15 @@ public class QSTileHostTest extends SysuiTestCase { QSFactory defaultFactory, Handler mainHandler, Looper bgLooper, PluginManager pluginManager, TunerService tunerService, Provider<AutoTileManager> autoTiles, DumpManager dumpManager, - BroadcastDispatcher broadcastDispatcher, StatusBar statusBar, QSLogger qsLogger, - UiEventLogger uiEventLogger, UserTracker userTracker, + BroadcastDispatcher broadcastDispatcher, CentralSurfaces centralSurfaces, + QSLogger qsLogger, UiEventLogger uiEventLogger, UserTracker userTracker, SecureSettings secureSettings, CustomTileStatePersister customTileStatePersister, TileServiceRequestController.Builder tileServiceRequestControllerBuilder, TileLifecycleManager.Factory tileLifecycleManagerFactory) { super(context, iconController, defaultFactory, mainHandler, bgLooper, pluginManager, tunerService, autoTiles, dumpManager, broadcastDispatcher, - Optional.of(statusBar), qsLogger, uiEventLogger, userTracker, secureSettings, - customTileStatePersister, tileServiceRequestControllerBuilder, + Optional.of(centralSurfaces), qsLogger, uiEventLogger, userTracker, + secureSettings, customTileStatePersister, tileServiceRequestControllerBuilder, tileLifecycleManagerFactory); } diff --git a/packages/SystemUI/tests/src/com/android/systemui/qs/external/TileServicesTest.java b/packages/SystemUI/tests/src/com/android/systemui/qs/external/TileServicesTest.java index e39d6a1bfc01..19a9863f6f5e 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/qs/external/TileServicesTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/qs/external/TileServicesTest.java @@ -50,7 +50,7 @@ import com.android.systemui.qs.tileimpl.QSFactoryImpl; import com.android.systemui.settings.UserTracker; import com.android.systemui.shared.plugins.PluginManager; import com.android.systemui.statusbar.phone.AutoTileManager; -import com.android.systemui.statusbar.phone.StatusBar; +import com.android.systemui.statusbar.phone.CentralSurfaces; import com.android.systemui.statusbar.phone.StatusBarIconController; import com.android.systemui.statusbar.policy.BluetoothController; import com.android.systemui.statusbar.policy.KeyguardStateController; @@ -91,7 +91,7 @@ public class TileServicesTest extends SysuiTestCase { @Mock private DumpManager mDumpManager; @Mock - private StatusBar mStatusBar; + private CentralSurfaces mCentralSurfaces; @Mock private QSLogger mQSLogger; @Mock @@ -132,7 +132,7 @@ public class TileServicesTest extends SysuiTestCase { () -> mAutoTileManager, mDumpManager, mock(BroadcastDispatcher.class), - Optional.of(mStatusBar), + Optional.of(mCentralSurfaces), mQSLogger, mUiEventLogger, mUserTracker, diff --git a/packages/SystemUI/tests/src/com/android/systemui/screenshot/ActionProxyReceiverTest.java b/packages/SystemUI/tests/src/com/android/systemui/screenshot/ActionProxyReceiverTest.java index bfe875ccd60d..7ab49584f0e3 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/screenshot/ActionProxyReceiverTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/screenshot/ActionProxyReceiverTest.java @@ -19,7 +19,7 @@ package com.android.systemui.screenshot; import static com.android.systemui.screenshot.ScreenshotController.ACTION_TYPE_SHARE; import static com.android.systemui.screenshot.ScreenshotController.EXTRA_ID; import static com.android.systemui.screenshot.ScreenshotController.EXTRA_SMART_ACTIONS_ENABLED; -import static com.android.systemui.statusbar.phone.StatusBar.SYSTEM_DIALOG_REASON_SCREENSHOT; +import static com.android.systemui.statusbar.phone.CentralSurfaces.SYSTEM_DIALOG_REASON_SCREENSHOT; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyBoolean; @@ -41,7 +41,7 @@ import androidx.test.filters.SmallTest; import com.android.systemui.SysuiTestCase; import com.android.systemui.shared.system.ActivityManagerWrapper; -import com.android.systemui.statusbar.phone.StatusBar; +import com.android.systemui.statusbar.phone.CentralSurfaces; import org.junit.Before; import org.junit.Test; @@ -59,7 +59,7 @@ import java.util.concurrent.TimeoutException; public class ActionProxyReceiverTest extends SysuiTestCase { @Mock - private StatusBar mMockStatusBar; + private CentralSurfaces mMockCentralSurfaces; @Mock private ActivityManagerWrapper mMockActivityManagerWrapper; @Mock @@ -83,7 +83,7 @@ public class ActionProxyReceiverTest extends SysuiTestCase { actionProxyReceiver.onReceive(mContext, mIntent); verify(mMockActivityManagerWrapper).closeSystemWindows(SYSTEM_DIALOG_REASON_SCREENSHOT); - verify(mMockStatusBar, never()).executeRunnableDismissingKeyguard( + verify(mMockCentralSurfaces, never()).executeRunnableDismissingKeyguard( any(Runnable.class), any(Runnable.class), anyBoolean(), anyBoolean(), anyBoolean()); verify(mMockPendingIntent).send( eq(mContext), anyInt(), isNull(), isNull(), isNull(), isNull(), any(Bundle.class)); @@ -96,13 +96,13 @@ public class ActionProxyReceiverTest extends SysuiTestCase { doAnswer((Answer<Object>) invocation -> { ((Runnable) invocation.getArgument(0)).run(); return null; - }).when(mMockStatusBar).executeRunnableDismissingKeyguard( + }).when(mMockCentralSurfaces).executeRunnableDismissingKeyguard( any(Runnable.class), isNull(), anyBoolean(), anyBoolean(), anyBoolean()); actionProxyReceiver.onReceive(mContext, mIntent); verify(mMockActivityManagerWrapper).closeSystemWindows(SYSTEM_DIALOG_REASON_SCREENSHOT); - verify(mMockStatusBar).executeRunnableDismissingKeyguard( + verify(mMockCentralSurfaces).executeRunnableDismissingKeyguard( any(Runnable.class), isNull(), eq(true), eq(true), eq(true)); verify(mMockPendingIntent).send( eq(mContext), anyInt(), isNull(), isNull(), isNull(), isNull(), any(Bundle.class)); @@ -135,7 +135,7 @@ public class ActionProxyReceiverTest extends SysuiTestCase { private ActionProxyReceiver constructActionProxyReceiver(boolean withStatusBar) { if (withStatusBar) { return new ActionProxyReceiver( - Optional.of(mMockStatusBar), mMockActivityManagerWrapper, + Optional.of(mMockCentralSurfaces), mMockActivityManagerWrapper, mMockScreenshotSmartActions); } else { return new ActionProxyReceiver( diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/LockscreenShadeTransitionControllerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/LockscreenShadeTransitionControllerTest.kt index 75ccd8f03a01..25a5b900f15a 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/LockscreenShadeTransitionControllerTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/LockscreenShadeTransitionControllerTest.kt @@ -22,7 +22,7 @@ import com.android.systemui.statusbar.phone.KeyguardBypassController import com.android.systemui.statusbar.phone.LSShadeTransitionLogger import com.android.systemui.statusbar.phone.NotificationPanelViewController import com.android.systemui.statusbar.phone.ScrimController -import com.android.systemui.statusbar.phone.StatusBar +import com.android.systemui.statusbar.phone.CentralSurfaces import com.android.systemui.statusbar.policy.FakeConfigurationController import org.junit.After import org.junit.Assert.assertFalse @@ -72,7 +72,7 @@ class LockscreenShadeTransitionControllerTest : SysuiTestCase() { @Mock lateinit var depthController: NotificationShadeDepthController @Mock lateinit var stackscroller: NotificationStackScrollLayout @Mock lateinit var expandHelperCallback: ExpandHelper.Callback - @Mock lateinit var statusbar: StatusBar + @Mock lateinit var mCentralSurfaces: CentralSurfaces @Mock lateinit var qS: QS @JvmField @Rule val mockito = MockitoJUnit.rule() @@ -106,7 +106,7 @@ class LockscreenShadeTransitionControllerTest : SysuiTestCase() { whenever(nsslController.view).thenReturn(stackscroller) whenever(nsslController.expandHelperCallback).thenReturn(expandHelperCallback) transitionController.notificationPanelController = notificationPanelController - transitionController.statusbar = statusbar + transitionController.centralSurfaces = mCentralSurfaces transitionController.qS = qS transitionController.setStackScroller(nsslController) whenever(statusbarStateController.state).thenReturn(StatusBarState.KEYGUARD) @@ -118,7 +118,7 @@ class LockscreenShadeTransitionControllerTest : SysuiTestCase() { whenever(lockScreenUserManager.isLockscreenPublicMode(anyInt())).thenReturn(true) whenever(falsingCollector.shouldEnforceBouncer()).thenReturn(false) whenever(keyguardBypassController.bypassEnabled).thenReturn(false) - clearInvocations(statusbar) + clearInvocations(mCentralSurfaces) } @After @@ -175,7 +175,7 @@ class LockscreenShadeTransitionControllerTest : SysuiTestCase() { @Test fun testDontGoWhenShadeDisabled() { - whenever(statusbar.isShadeDisabled).thenReturn(true) + whenever(mCentralSurfaces.isShadeDisabled).thenReturn(true) transitionController.goToLockedShade(null) verify(statusbarStateController, never()).setState(anyInt()) } @@ -194,7 +194,7 @@ class LockscreenShadeTransitionControllerTest : SysuiTestCase() { transitionController.goToLockedShade(null) verify(statusbarStateController, never()).setState(anyInt()) verify(statusbarStateController).setLeaveOpenOnKeyguardHide(true) - verify(statusbar).showBouncerWithDimissAndCancelIfKeyguard(anyObject(), anyObject()) + verify(mCentralSurfaces).showBouncerWithDimissAndCancelIfKeyguard(anyObject(), anyObject()) } @Test @@ -203,7 +203,7 @@ class LockscreenShadeTransitionControllerTest : SysuiTestCase() { transitionController.goToLockedShade(null) verify(statusbarStateController, never()).setState(anyInt()) verify(statusbarStateController).setLeaveOpenOnKeyguardHide(true) - verify(statusbar).showBouncerWithDimissAndCancelIfKeyguard(anyObject(), anyObject()) + verify(mCentralSurfaces).showBouncerWithDimissAndCancelIfKeyguard(anyObject(), anyObject()) } @Test diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NonPhoneDependencyTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NonPhoneDependencyTest.java index 4213b070d0c2..a4ce9cd12f73 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NonPhoneDependencyTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NonPhoneDependencyTest.java @@ -47,8 +47,8 @@ import org.mockito.MockitoAnnotations; /** * Verifies that particular sets of dependencies don't have dependencies on others. For example, - * code managing notifications shouldn't directly depend on StatusBar, since there are platforms - * which want to manage notifications, but don't use StatusBar. + * code managing notifications shouldn't directly depend on CentralSurfaces, since there are + * platforms which want to manage notifications, but don't use CentralSurfaces. */ @SmallTest @RunWith(AndroidTestingRunner.class) diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationRemoteInputManagerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationRemoteInputManagerTest.java index bd9f91f45e25..2691ff98f4ee 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationRemoteInputManagerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationRemoteInputManagerTest.java @@ -49,7 +49,7 @@ import com.android.systemui.statusbar.notification.collection.NotificationEntry; import com.android.systemui.statusbar.notification.collection.NotificationEntryBuilder; import com.android.systemui.statusbar.notification.collection.render.NotificationVisibilityProvider; import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow; -import com.android.systemui.statusbar.phone.StatusBar; +import com.android.systemui.statusbar.phone.CentralSurfaces; import com.android.systemui.statusbar.policy.RemoteInputUriController; import com.google.android.collect.Sets; @@ -105,7 +105,7 @@ public class NotificationRemoteInputManagerTest extends SysuiTestCase { mVisibilityProvider, mEntryManager, mock(RemoteInputNotificationRebuilder.class), - () -> Optional.of(mock(StatusBar.class)), + () -> Optional.of(mock(CentralSurfaces.class)), mStateController, Handler.createAsync(Looper.myLooper()), mRemoteInputUriController, @@ -196,7 +196,7 @@ public class NotificationRemoteInputManagerTest extends SysuiTestCase { NotificationVisibilityProvider visibilityProvider, NotificationEntryManager notificationEntryManager, RemoteInputNotificationRebuilder rebuilder, - Lazy<Optional<StatusBar>> statusBarOptionalLazy, + Lazy<Optional<CentralSurfaces>> centralSurfacesOptionalLazy, StatusBarStateController statusBarStateController, Handler mainHandler, RemoteInputUriController remoteInputUriController, @@ -211,7 +211,7 @@ public class NotificationRemoteInputManagerTest extends SysuiTestCase { visibilityProvider, notificationEntryManager, rebuilder, - statusBarOptionalLazy, + centralSurfacesOptionalLazy, statusBarStateController, mainHandler, remoteInputUriController, diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/SmartReplyControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/SmartReplyControllerTest.java index e0689f3da081..3500e4d5f701 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/SmartReplyControllerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/SmartReplyControllerTest.java @@ -45,7 +45,7 @@ import com.android.systemui.statusbar.notification.NotificationEntryManager; import com.android.systemui.statusbar.notification.collection.NotificationEntry; import com.android.systemui.statusbar.notification.collection.NotificationEntryBuilder; import com.android.systemui.statusbar.notification.collection.render.NotificationVisibilityProvider; -import com.android.systemui.statusbar.phone.StatusBar; +import com.android.systemui.statusbar.phone.CentralSurfaces; import com.android.systemui.statusbar.policy.RemoteInputUriController; import org.junit.Before; @@ -103,7 +103,7 @@ public class SmartReplyControllerTest extends SysuiTestCase { mVisibilityProvider, mNotificationEntryManager, new RemoteInputNotificationRebuilder(mContext), - () -> Optional.of(mock(StatusBar.class)), + () -> Optional.of(mock(CentralSurfaces.class)), mStatusBarStateController, Handler.createAsync(Looper.myLooper()), mRemoteInputUriController, diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationGutsManagerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationGutsManagerTest.java index 7d8e0d26464c..e9d8f5830131 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationGutsManagerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationGutsManagerTest.java @@ -82,8 +82,8 @@ import com.android.systemui.statusbar.notification.collection.provider.HighPrior import com.android.systemui.statusbar.notification.people.PeopleNotificationIdentifier; import com.android.systemui.statusbar.notification.row.NotificationGutsManager.OnSettingsClickListener; import com.android.systemui.statusbar.notification.stack.NotificationListContainer; +import com.android.systemui.statusbar.phone.CentralSurfaces; import com.android.systemui.statusbar.phone.ShadeController; -import com.android.systemui.statusbar.phone.StatusBar; import com.android.systemui.statusbar.policy.DeviceProvisionedController; import com.android.systemui.wmshell.BubblesManager; @@ -124,7 +124,7 @@ public class NotificationGutsManagerTest extends SysuiTestCase { @Mock private NotificationInfo.CheckSaveListener mCheckSaveListener; @Mock private OnSettingsClickListener mOnSettingsClickListener; @Mock private DeviceProvisionedController mDeviceProvisionedController; - @Mock private StatusBar mStatusBar; + @Mock private CentralSurfaces mCentralSurfaces; @Mock private AccessibilityManager mAccessibilityManager; @Mock private HighPriorityProvider mHighPriorityProvider; @Mock private INotificationManager mINotificationManager; @@ -155,7 +155,7 @@ public class NotificationGutsManagerTest extends SysuiTestCase { when(mAccessibilityManager.isTouchExplorationEnabled()).thenReturn(false); mGutsManager = new NotificationGutsManager(mContext, - () -> Optional.of(mStatusBar), mHandler, mHandler, mAccessibilityManager, + () -> Optional.of(mCentralSurfaces), mHandler, mHandler, mAccessibilityManager, mHighPriorityProvider, mINotificationManager, mNotificationEntryManager, mPeopleSpaceWidgetManager, mLauncherApps, mShortcutManager, mChannelEditorDialogController, mContextTracker, mAssistantFeedbackController, diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutControllerTest.java index 6b93ae2f3667..1561b5a5d22e 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutControllerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutControllerTest.java @@ -73,7 +73,7 @@ import com.android.systemui.statusbar.phone.HeadsUpManagerPhone; import com.android.systemui.statusbar.phone.KeyguardBypassController; import com.android.systemui.statusbar.phone.ScrimController; import com.android.systemui.statusbar.phone.ShadeController; -import com.android.systemui.statusbar.phone.StatusBar; +import com.android.systemui.statusbar.phone.CentralSurfaces; import com.android.systemui.statusbar.policy.ConfigurationController; import com.android.systemui.statusbar.policy.DeviceProvisionedController; import com.android.systemui.statusbar.policy.ZenModeController; @@ -116,7 +116,7 @@ public class NotificationStackScrollLayoutControllerTest extends SysuiTestCase { @Mock(answer = Answers.RETURNS_SELF) private NotificationSwipeHelper.Builder mNotificationSwipeHelperBuilder; @Mock private NotificationSwipeHelper mNotificationSwipeHelper; - @Mock private StatusBar mStatusBar; + @Mock private CentralSurfaces mCentralSurfaces; @Mock private ScrimController mScrimController; @Mock private NotificationGroupManagerLegacy mLegacyGroupManager; @Mock private SectionHeaderController mSilentHeaderController; @@ -168,7 +168,7 @@ public class NotificationStackScrollLayoutControllerTest extends SysuiTestCase { new FalsingManagerFake(), mResources, mNotificationSwipeHelperBuilder, - mStatusBar, + mCentralSurfaces, mScrimController, mLegacyGroupManager, mLegacyGroupManager, diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java index 4f731ed5f72c..eafcc354fac4 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java @@ -61,9 +61,9 @@ import com.android.systemui.statusbar.notification.collection.render.GroupExpans import com.android.systemui.statusbar.notification.collection.render.GroupMembershipManager; import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow; import com.android.systemui.statusbar.notification.row.FooterView; +import com.android.systemui.statusbar.phone.CentralSurfaces; import com.android.systemui.statusbar.phone.KeyguardBypassController; import com.android.systemui.statusbar.phone.ShadeController; -import com.android.systemui.statusbar.phone.StatusBar; import com.android.systemui.statusbar.phone.UnlockedScreenOffAnimationController; import org.junit.Assert; @@ -89,7 +89,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { private AmbientState mAmbientState; @Rule public MockitoRule mockito = MockitoJUnit.rule(); - @Mock private StatusBar mBar; + @Mock private CentralSurfaces mCentralSurfaces; @Mock private SysuiStatusBarStateController mBarState; @Mock private NotificationGroupManagerLegacy mGroupMembershipManger; @Mock private NotificationGroupManagerLegacy mGroupExpansionManager; @@ -141,7 +141,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { mStackScrollerInternal.initView(getContext(), mNotificationSwipeHelper); mStackScroller = spy(mStackScrollerInternal); mStackScroller.setShelfController(notificationShelfController); - mStackScroller.setStatusBar(mBar); + mStackScroller.setCentralSurfaces(mCentralSurfaces); mStackScroller.setEmptyShadeView(mEmptyShadeView); when(mStackScrollLayoutController.isHistoryEnabled()).thenReturn(true); when(mStackScrollLayoutController.getNoticationRoundessManager()) @@ -149,7 +149,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { mStackScroller.setController(mStackScrollLayoutController); // Stub out functionality that isn't necessary to test. - doNothing().when(mBar) + doNothing().when(mCentralSurfaces) .executeRunnableDismissingKeyguard(any(Runnable.class), any(Runnable.class), anyBoolean(), diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarCommandQueueCallbacksTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesCommandQueueCallbacksTest.java index 54d9cece90fc..9bfb2c4ce00c 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarCommandQueueCallbacksTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesCommandQueueCallbacksTest.java @@ -57,8 +57,8 @@ import java.util.Optional; @SmallTest @RunWith(AndroidTestingRunner.class) -public class StatusBarCommandQueueCallbacksTest extends SysuiTestCase { - @Mock private StatusBar mStatusBar; +public class CentralSurfacesCommandQueueCallbacksTest extends SysuiTestCase { + @Mock private CentralSurfaces mCentralSurfaces; @Mock private ShadeController mShadeController; @Mock private CommandQueue mCommandQueue; @Mock private NotificationPanelViewController mNotificationPanelViewController; @@ -81,14 +81,14 @@ public class StatusBarCommandQueueCallbacksTest extends SysuiTestCase { @Mock private LightBarController mLightBarController; @Mock private StatusBarHideIconsForBouncerManager mStatusBarHideIconsForBouncerManager; - StatusBarCommandQueueCallbacks mSbcqCallbacks; + CentralSurfacesCommandQueueCallbacks mSbcqCallbacks; @Before public void setup() { MockitoAnnotations.initMocks(this); - mSbcqCallbacks = new StatusBarCommandQueueCallbacks( - mStatusBar, + mSbcqCallbacks = new CentralSurfacesCommandQueueCallbacks( + mCentralSurfaces, mContext, mContext.getResources(), mShadeController, @@ -122,13 +122,13 @@ public class StatusBarCommandQueueCallbacksTest extends SysuiTestCase { @Test public void testDisableNotificationShade() { - when(mStatusBar.getDisabled1()).thenReturn(StatusBarManager.DISABLE_NONE); - when(mStatusBar.getDisabled2()).thenReturn(StatusBarManager.DISABLE_NONE); + when(mCentralSurfaces.getDisabled1()).thenReturn(StatusBarManager.DISABLE_NONE); + when(mCentralSurfaces.getDisabled2()).thenReturn(StatusBarManager.DISABLE_NONE); when(mCommandQueue.panelsEnabled()).thenReturn(false); mSbcqCallbacks.disable(DEFAULT_DISPLAY, StatusBarManager.DISABLE_NONE, StatusBarManager.DISABLE2_NOTIFICATION_SHADE, false); - verify(mStatusBar).updateQsExpansionEnabled(); + verify(mCentralSurfaces).updateQsExpansionEnabled(); verify(mShadeController).animateCollapsePanels(); // Trying to open it does nothing. @@ -140,12 +140,13 @@ public class StatusBarCommandQueueCallbacksTest extends SysuiTestCase { @Test public void testEnableNotificationShade() { - when(mStatusBar.getDisabled1()).thenReturn(StatusBarManager.DISABLE_NONE); - when(mStatusBar.getDisabled2()).thenReturn(StatusBarManager.DISABLE2_NOTIFICATION_SHADE); + when(mCentralSurfaces.getDisabled1()).thenReturn(StatusBarManager.DISABLE_NONE); + when(mCentralSurfaces.getDisabled2()) + .thenReturn(StatusBarManager.DISABLE2_NOTIFICATION_SHADE); when(mCommandQueue.panelsEnabled()).thenReturn(true); mSbcqCallbacks.disable(DEFAULT_DISPLAY, StatusBarManager.DISABLE_NONE, StatusBarManager.DISABLE2_NONE, false); - verify(mStatusBar).updateQsExpansionEnabled(); + verify(mCentralSurfaces).updateQsExpansionEnabled(); verify(mShadeController, never()).animateCollapsePanels(); // Can now be opened. diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesTest.java index b5210b937ce1..953a330d2e65 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesTest.java @@ -139,7 +139,7 @@ import com.android.systemui.statusbar.notification.row.NotificationGutsManager; import com.android.systemui.statusbar.notification.stack.NotificationListContainer; import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout; import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayoutController; -import com.android.systemui.statusbar.phone.dagger.StatusBarComponent; +import com.android.systemui.statusbar.phone.dagger.CentralSurfacesComponent; import com.android.systemui.statusbar.phone.ongoingcall.OngoingCallController; import com.android.systemui.statusbar.phone.panelstate.PanelExpansionStateManager; import com.android.systemui.statusbar.policy.BatteryController; @@ -177,12 +177,12 @@ import dagger.Lazy; @SmallTest @RunWith(AndroidTestingRunner.class) @RunWithLooper(setAsMainLooper = true) -public class StatusBarTest extends SysuiTestCase { +public class CentralSurfacesTest extends SysuiTestCase { private static final int FOLD_STATE_FOLDED = 0; private static final int FOLD_STATE_UNFOLDED = 1; - private StatusBar mStatusBar; + private CentralSurfaces mCentralSurfaces; private FakeMetricsLogger mMetricsLogger; private PowerManager mPowerManager; private TestableNotificationInterruptStateProviderImpl mNotificationInterruptStateProvider; @@ -252,8 +252,8 @@ public class StatusBarTest extends SysuiTestCase { @Mock private ViewMediatorCallback mKeyguardVieMediatorCallback; @Mock private VolumeComponent mVolumeComponent; @Mock private CommandQueue mCommandQueue; - @Mock private StatusBarComponent.Factory mStatusBarComponentFactory; - @Mock private StatusBarComponent mStatusBarComponent; + @Mock private CentralSurfacesComponent.Factory mStatusBarComponentFactory; + @Mock private CentralSurfacesComponent mCentralSurfacesComponent; @Mock private PluginManager mPluginManager; @Mock private ViewMediatorCallback mViewMediatorCallback; @Mock private StatusBarTouchableRegionManager mStatusBarTouchableRegionManager; @@ -364,8 +364,8 @@ public class StatusBarTest extends SysuiTestCase { when(mLockscreenWallpaperLazy.get()).thenReturn(mLockscreenWallpaper); when(mBiometricUnlockControllerLazy.get()).thenReturn(mBiometricUnlockController); - when(mStatusBarComponentFactory.create()).thenReturn(mStatusBarComponent); - when(mStatusBarComponent.getNotificationShadeWindowViewController()).thenReturn( + when(mStatusBarComponentFactory.create()).thenReturn(mCentralSurfacesComponent); + when(mCentralSurfacesComponent.getNotificationShadeWindowViewController()).thenReturn( mNotificationShadeWindowViewController); doAnswer(invocation -> { ((Runnable) invocation.getArgument(0)).run(); @@ -375,12 +375,12 @@ public class StatusBarTest extends SysuiTestCase { mShadeController = new ShadeControllerImpl(mCommandQueue, mStatusBarStateController, mNotificationShadeWindowController, mStatusBarKeyguardViewManager, mContext.getSystemService(WindowManager.class), - () -> Optional.of(mStatusBar), () -> mAssistManager); + () -> Optional.of(mCentralSurfaces), () -> mAssistManager); when(mOperatorNameViewControllerFactory.create(any())) .thenReturn(mOperatorNameViewController); - mStatusBar = new StatusBar( + mCentralSurfaces = new CentralSurfaces( mContext, mNotificationsController, mock(FragmentService.class), @@ -475,8 +475,8 @@ public class StatusBarTest extends SysuiTestCase { mDeviceStateManager, mDreamOverlayStateController, mWiredChargingRippleController); - when(mKeyguardViewMediator.registerStatusBar( - any(StatusBar.class), + when(mKeyguardViewMediator.registerCentralSurfaces( + any(CentralSurfaces.class), any(NotificationPanelViewController.class), any(PanelExpansionStateManager.class), any(BiometricUnlockController.class), @@ -487,23 +487,23 @@ public class StatusBarTest extends SysuiTestCase { when(mKeyguardViewMediator.getViewMediatorCallback()).thenReturn( mKeyguardVieMediatorCallback); - // TODO: we should be able to call mStatusBar.start() and have all the below values + // TODO: we should be able to call mCentralSurfaces.start() and have all the below values // initialized automatically. - mStatusBar.mNotificationShadeWindowView = mNotificationShadeWindowView; - mStatusBar.mNotificationPanelViewController = mNotificationPanelViewController; - mStatusBar.mDozeScrimController = mDozeScrimController; - mStatusBar.mPresenter = mNotificationPresenter; - mStatusBar.mKeyguardIndicationController = mKeyguardIndicationController; - mStatusBar.mBarService = mBarService; - mStatusBar.mStackScroller = mStackScroller; - mStatusBar.startKeyguard(); + mCentralSurfaces.mNotificationShadeWindowView = mNotificationShadeWindowView; + mCentralSurfaces.mNotificationPanelViewController = mNotificationPanelViewController; + mCentralSurfaces.mDozeScrimController = mDozeScrimController; + mCentralSurfaces.mPresenter = mNotificationPresenter; + mCentralSurfaces.mKeyguardIndicationController = mKeyguardIndicationController; + mCentralSurfaces.mBarService = mBarService; + mCentralSurfaces.mStackScroller = mStackScroller; + mCentralSurfaces.startKeyguard(); mInitController.executePostInitTasks(); notificationLogger.setUpWithContainer(mNotificationListContainer); } @Test public void testSetBouncerShowing_noCrash() { - mStatusBar.setBouncerShowing(true); + mCentralSurfaces.setBouncerShowing(true); } @Test @@ -511,7 +511,7 @@ public class StatusBarTest extends SysuiTestCase { when(mStatusBarKeyguardViewManager.isShowing()).thenReturn(true); when(mStatusBarKeyguardViewManager.isOccluded()).thenReturn(true); - mStatusBar.executeRunnableDismissingKeyguard(null, null, false, false, false); + mCentralSurfaces.executeRunnableDismissingKeyguard(null, null, false, false, false); } @Test @@ -519,7 +519,7 @@ public class StatusBarTest extends SysuiTestCase { when(mStatusBarKeyguardViewManager.isShowing()).thenReturn(true); when(mStatusBarKeyguardViewManager.isOccluded()).thenReturn(false); - mStatusBar.executeRunnableDismissingKeyguard(null, null, false, false, false); + mCentralSurfaces.executeRunnableDismissingKeyguard(null, null, false, false, false); } @Test @@ -527,7 +527,7 @@ public class StatusBarTest extends SysuiTestCase { when(mStatusBarKeyguardViewManager.isShowing()).thenReturn(false); when(mStatusBarKeyguardViewManager.isOccluded()).thenReturn(false); - mStatusBar.executeRunnableDismissingKeyguard(null, null, false, false, false); + mCentralSurfaces.executeRunnableDismissingKeyguard(null, null, false, false, false); } @Test @@ -539,7 +539,7 @@ public class StatusBarTest extends SysuiTestCase { when(mStatusBarKeyguardViewManager.isShowing()).thenReturn(false); when(mStatusBarKeyguardViewManager.isBouncerShowing()).thenReturn(false); when(mKeyguardStateController.isMethodSecure()).thenReturn(false); - mStatusBar.onKeyguardViewManagerStatesUpdated(); + mCentralSurfaces.onKeyguardViewManagerStatesUpdated(); MetricsAsserts.assertHasLog("missing hidden insecure lockscreen log", mMetricsLogger.getLogs(), @@ -558,7 +558,7 @@ public class StatusBarTest extends SysuiTestCase { when(mStatusBarKeyguardViewManager.isBouncerShowing()).thenReturn(false); when(mKeyguardStateController.isMethodSecure()).thenReturn(true); - mStatusBar.onKeyguardViewManagerStatesUpdated(); + mCentralSurfaces.onKeyguardViewManagerStatesUpdated(); MetricsAsserts.assertHasLog("missing hidden secure lockscreen log", mMetricsLogger.getLogs(), @@ -577,7 +577,7 @@ public class StatusBarTest extends SysuiTestCase { when(mStatusBarKeyguardViewManager.isBouncerShowing()).thenReturn(false); when(mKeyguardStateController.isMethodSecure()).thenReturn(false); - mStatusBar.onKeyguardViewManagerStatesUpdated(); + mCentralSurfaces.onKeyguardViewManagerStatesUpdated(); MetricsAsserts.assertHasLog("missing insecure lockscreen showing", mMetricsLogger.getLogs(), @@ -596,7 +596,7 @@ public class StatusBarTest extends SysuiTestCase { when(mStatusBarKeyguardViewManager.isBouncerShowing()).thenReturn(false); when(mKeyguardStateController.isMethodSecure()).thenReturn(true); - mStatusBar.onKeyguardViewManagerStatesUpdated(); + mCentralSurfaces.onKeyguardViewManagerStatesUpdated(); MetricsAsserts.assertHasLog("missing secure lockscreen showing log", mMetricsLogger.getLogs(), @@ -615,7 +615,7 @@ public class StatusBarTest extends SysuiTestCase { when(mStatusBarKeyguardViewManager.isBouncerShowing()).thenReturn(true); when(mKeyguardStateController.isMethodSecure()).thenReturn(true); - mStatusBar.onKeyguardViewManagerStatesUpdated(); + mCentralSurfaces.onKeyguardViewManagerStatesUpdated(); MetricsAsserts.assertHasLog("missing bouncer log", mMetricsLogger.getLogs(), @@ -716,7 +716,7 @@ public class StatusBarTest extends SysuiTestCase { @Test public void testLogHidden() { try { - mStatusBar.handleVisibleToUserChanged(false); + mCentralSurfaces.handleVisibleToUserChanged(false); mUiBgExecutor.runAllReady(); verify(mBarService, times(1)).onPanelHidden(); verify(mBarService, never()).onPanelRevealed(anyBoolean(), anyInt()); @@ -731,10 +731,10 @@ public class StatusBarTest extends SysuiTestCase { when(mHeadsUpManager.hasPinnedHeadsUp()).thenReturn(true); when(mNotificationsController.getActiveNotificationsCount()).thenReturn(5); when(mNotificationPresenter.isPresenterFullyCollapsed()).thenReturn(true); - mStatusBar.setBarStateForTest(StatusBarState.SHADE); + mCentralSurfaces.setBarStateForTest(StatusBarState.SHADE); try { - mStatusBar.handleVisibleToUserChanged(true); + mCentralSurfaces.handleVisibleToUserChanged(true); mUiBgExecutor.runAllReady(); verify(mBarService, never()).onPanelHidden(); verify(mBarService, times(1)).onPanelRevealed(false, 1); @@ -750,10 +750,10 @@ public class StatusBarTest extends SysuiTestCase { when(mNotificationsController.getActiveNotificationsCount()).thenReturn(5); when(mNotificationPresenter.isPresenterFullyCollapsed()).thenReturn(false); - mStatusBar.setBarStateForTest(StatusBarState.SHADE); + mCentralSurfaces.setBarStateForTest(StatusBarState.SHADE); try { - mStatusBar.handleVisibleToUserChanged(true); + mCentralSurfaces.handleVisibleToUserChanged(true); mUiBgExecutor.runAllReady(); verify(mBarService, never()).onPanelHidden(); verify(mBarService, times(1)).onPanelRevealed(true, 5); @@ -768,10 +768,10 @@ public class StatusBarTest extends SysuiTestCase { when(mHeadsUpManager.hasPinnedHeadsUp()).thenReturn(false); when(mNotificationsController.getActiveNotificationsCount()).thenReturn(5); when(mNotificationPresenter.isPresenterFullyCollapsed()).thenReturn(false); - mStatusBar.setBarStateForTest(StatusBarState.KEYGUARD); + mCentralSurfaces.setBarStateForTest(StatusBarState.KEYGUARD); try { - mStatusBar.handleVisibleToUserChanged(true); + mCentralSurfaces.handleVisibleToUserChanged(true); mUiBgExecutor.runAllReady(); verify(mBarService, never()).onPanelHidden(); verify(mBarService, times(1)).onPanelRevealed(false, 5); @@ -783,18 +783,18 @@ public class StatusBarTest extends SysuiTestCase { @Test public void testDump_DoesNotCrash() { - mStatusBar.dump(null, new PrintWriter(new ByteArrayOutputStream()), null); + mCentralSurfaces.dump(null, new PrintWriter(new ByteArrayOutputStream()), null); } @Test public void testDumpBarTransitions_DoesNotCrash() { - StatusBar.dumpBarTransitions( + CentralSurfaces.dumpBarTransitions( new PrintWriter(new ByteArrayOutputStream()), "var", /* transitions= */ null); } @Test public void testFingerprintNotification_UpdatesScrims() { - mStatusBar.notifyBiometricAuthModeChanged(); + mCentralSurfaces.notifyBiometricAuthModeChanged(); verify(mScrimController).transitionTo(any(), any()); } @@ -803,81 +803,81 @@ public class StatusBarTest extends SysuiTestCase { // Simulate unlocking from AoD with fingerprint. when(mBiometricUnlockController.getMode()) .thenReturn(BiometricUnlockController.MODE_WAKE_AND_UNLOCK); - mStatusBar.updateScrimController(); + mCentralSurfaces.updateScrimController(); verify(mScrimController).transitionTo(eq(ScrimState.UNLOCKED), any()); } @Test public void testTransitionLaunch_goesToUnlocked() { - mStatusBar.setBarStateForTest(StatusBarState.KEYGUARD); - mStatusBar.showKeyguardImpl(); + mCentralSurfaces.setBarStateForTest(StatusBarState.KEYGUARD); + mCentralSurfaces.showKeyguardImpl(); // Starting a pulse should change the scrim controller to the pulsing state when(mNotificationPanelViewController.isLaunchTransitionRunning()).thenReturn(true); when(mNotificationPanelViewController.isLaunchingAffordanceWithPreview()).thenReturn(true); - mStatusBar.updateScrimController(); + mCentralSurfaces.updateScrimController(); verify(mScrimController).transitionTo(eq(ScrimState.UNLOCKED), any()); } @Test public void testSetExpansionAffectsAlpha_whenKeyguardShowingButGoingAwayForAnyReason() { - mStatusBar.updateScrimController(); + mCentralSurfaces.updateScrimController(); verify(mScrimController).setExpansionAffectsAlpha(eq(true)); clearInvocations(mScrimController); when(mKeyguardStateController.isShowing()).thenReturn(true); when(mKeyguardStateController.isKeyguardGoingAway()).thenReturn(false); - mStatusBar.updateScrimController(); + mCentralSurfaces.updateScrimController(); verify(mScrimController).setExpansionAffectsAlpha(eq(true)); clearInvocations(mScrimController); when(mKeyguardStateController.isShowing()).thenReturn(true); when(mKeyguardStateController.isKeyguardGoingAway()).thenReturn(true); - mStatusBar.updateScrimController(); + mCentralSurfaces.updateScrimController(); verify(mScrimController).setExpansionAffectsAlpha(eq(false)); clearInvocations(mScrimController); when(mKeyguardStateController.isShowing()).thenReturn(true); when(mKeyguardStateController.isKeyguardFadingAway()).thenReturn(true); - mStatusBar.updateScrimController(); + mCentralSurfaces.updateScrimController(); verify(mScrimController).setExpansionAffectsAlpha(eq(false)); } @Test public void testTransitionLaunch_noPreview_doesntGoUnlocked() { - mStatusBar.setBarStateForTest(StatusBarState.KEYGUARD); - mStatusBar.showKeyguardImpl(); + mCentralSurfaces.setBarStateForTest(StatusBarState.KEYGUARD); + mCentralSurfaces.showKeyguardImpl(); // Starting a pulse should change the scrim controller to the pulsing state when(mNotificationPanelViewController.isLaunchTransitionRunning()).thenReturn(true); when(mNotificationPanelViewController.isLaunchingAffordanceWithPreview()).thenReturn(false); - mStatusBar.updateScrimController(); + mCentralSurfaces.updateScrimController(); verify(mScrimController).transitionTo(eq(ScrimState.KEYGUARD)); } @Test public void testSetOccluded_propagatesToScrimController() { - mStatusBar.setOccluded(true); + mCentralSurfaces.setOccluded(true); verify(mScrimController).setKeyguardOccluded(eq(true)); reset(mScrimController); - mStatusBar.setOccluded(false); + mCentralSurfaces.setOccluded(false); verify(mScrimController).setKeyguardOccluded(eq(false)); } @Test public void testPulseWhileDozing_updatesScrimController() { - mStatusBar.setBarStateForTest(StatusBarState.KEYGUARD); - mStatusBar.showKeyguardImpl(); + mCentralSurfaces.setBarStateForTest(StatusBarState.KEYGUARD); + mCentralSurfaces.showKeyguardImpl(); // Starting a pulse should change the scrim controller to the pulsing state when(mDozeServiceHost.isPulsing()).thenReturn(true); - mStatusBar.updateScrimController(); + mCentralSurfaces.updateScrimController(); verify(mScrimController).transitionTo(eq(ScrimState.PULSING), any()); // Ending a pulse should take it back to keyguard state when(mDozeServiceHost.isPulsing()).thenReturn(false); - mStatusBar.updateScrimController(); + mCentralSurfaces.updateScrimController(); verify(mScrimController).transitionTo(eq(ScrimState.KEYGUARD)); } @@ -885,45 +885,45 @@ public class StatusBarTest extends SysuiTestCase { public void testShowKeyguardImplementation_setsState() { when(mLockscreenUserManager.getCurrentProfiles()).thenReturn(new SparseArray<>()); - mStatusBar.setBarStateForTest(StatusBarState.SHADE); + mCentralSurfaces.setBarStateForTest(StatusBarState.SHADE); // By default, showKeyguardImpl sets state to KEYGUARD. - mStatusBar.showKeyguardImpl(); + mCentralSurfaces.showKeyguardImpl(); verify(mStatusBarStateController).setState( eq(StatusBarState.KEYGUARD), eq(false) /* force */); } @Test public void testOnStartedWakingUp_isNotDozing() { - mStatusBar.setBarStateForTest(StatusBarState.KEYGUARD); + mCentralSurfaces.setBarStateForTest(StatusBarState.KEYGUARD); when(mStatusBarStateController.isKeyguardRequested()).thenReturn(true); when(mDozeServiceHost.getDozingRequested()).thenReturn(true); - mStatusBar.updateIsKeyguard(); + mCentralSurfaces.updateIsKeyguard(); // TODO: mNotificationPanelView.expand(false) gets called twice. Should be once. verify(mNotificationPanelViewController, times(2)).expand(eq(false)); clearInvocations(mNotificationPanelViewController); - mStatusBar.mWakefulnessObserver.onStartedWakingUp(); + mCentralSurfaces.mWakefulnessObserver.onStartedWakingUp(); verify(mDozeServiceHost).stopDozing(); verify(mNotificationPanelViewController).expand(eq(false)); } @Test public void testOnStartedWakingUp_doesNotDismissBouncer_whenPulsing() { - mStatusBar.setBarStateForTest(StatusBarState.KEYGUARD); + mCentralSurfaces.setBarStateForTest(StatusBarState.KEYGUARD); when(mStatusBarStateController.isKeyguardRequested()).thenReturn(true); when(mDozeServiceHost.getDozingRequested()).thenReturn(true); - mStatusBar.updateIsKeyguard(); + mCentralSurfaces.updateIsKeyguard(); clearInvocations(mNotificationPanelViewController); - mStatusBar.setBouncerShowing(true); - mStatusBar.mWakefulnessObserver.onStartedWakingUp(); + mCentralSurfaces.setBouncerShowing(true); + mCentralSurfaces.mWakefulnessObserver.onStartedWakingUp(); verify(mNotificationPanelViewController, never()).expand(anyBoolean()); } @Test public void testRegisterBroadcastsonDispatcher() { - mStatusBar.registerBroadcastReceiver(); + mCentralSurfaces.registerBroadcastReceiver(); verify(mBroadcastDispatcher).registerReceiver( any(BroadcastReceiver.class), any(IntentFilter.class), @@ -933,7 +933,7 @@ public class StatusBarTest extends SysuiTestCase { @Test public void testUpdateResources_updatesBouncer() { - mStatusBar.updateResources(); + mCentralSurfaces.updateResources(); verify(mStatusBarKeyguardViewManager).updateResources(); } diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/DozeServiceHostTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/DozeServiceHostTest.java index 6ce3b4b7b6f9..26ac70c70e7f 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/DozeServiceHostTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/DozeServiceHostTest.java @@ -82,7 +82,7 @@ public class DozeServiceHostTest extends SysuiTestCase { @Mock private NotificationShadeWindowController mNotificationShadeWindowController; @Mock private PowerManager mPowerManager; @Mock private WakefulnessLifecycle mWakefullnessLifecycle; - @Mock private StatusBar mStatusBar; + @Mock private CentralSurfaces mCentralSurfaces; @Mock private NotificationIconAreaController mNotificationIconAreaController; @Mock private NotificationShadeWindowViewController mNotificationShadeWindowViewController; @Mock private StatusBarKeyguardViewManager mStatusBarKeyguardViewManager; @@ -103,7 +103,7 @@ public class DozeServiceHostTest extends SysuiTestCase { mAuthController, mNotificationIconAreaController); mDozeServiceHost.initialize( - mStatusBar, + mCentralSurfaces, mStatusBarKeyguardViewManager, mNotificationShadeWindowViewController, mNotificationPanel, @@ -119,7 +119,7 @@ public class DozeServiceHostTest extends SysuiTestCase { mDozeServiceHost.startDozing(); verify(mStatusBarStateController).setIsDozing(eq(true)); - verify(mStatusBar).updateIsKeyguard(); + verify(mCentralSurfaces).updateIsKeyguard(); mDozeServiceHost.stopDozing(); verify(mStatusBarStateController).setIsDozing(eq(false)); @@ -128,8 +128,8 @@ public class DozeServiceHostTest extends SysuiTestCase { @Test public void testPulseWhileDozing_updatesScrimController() { - mStatusBar.setBarStateForTest(StatusBarState.KEYGUARD); - mStatusBar.showKeyguardImpl(); + mCentralSurfaces.setBarStateForTest(StatusBarState.KEYGUARD); + mCentralSurfaces.showKeyguardImpl(); // Keep track of callback to be able to stop the pulse // DozeHost.PulseCallback[] pulseCallback = new DozeHost.PulseCallback[1]; @@ -154,12 +154,12 @@ public class DozeServiceHostTest extends SysuiTestCase { verify(mDozeScrimController).pulse( pulseCallbackArgumentCaptor.capture(), eq(DozeLog.PULSE_REASON_NOTIFICATION)); - verify(mStatusBar).updateScrimController(); - reset(mStatusBar); + verify(mCentralSurfaces).updateScrimController(); + reset(mCentralSurfaces); pulseCallbackArgumentCaptor.getValue().onPulseFinished(); assertFalse(mDozeScrimController.isPulsing()); - verify(mStatusBar).updateScrimController(); + verify(mCentralSurfaces).updateScrimController(); } @Test diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/HeadsUpManagerPhoneTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/HeadsUpManagerPhoneTest.java index 421d8f6a1889..db5741c90ebc 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/HeadsUpManagerPhoneTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/HeadsUpManagerPhoneTest.java @@ -63,7 +63,6 @@ public class HeadsUpManagerPhoneTest extends AlertingNotificationManagerTest { @Mock private NotificationGroupManagerLegacy mGroupManager; @Mock private View mNotificationShadeWindowView; @Mock private VisualStabilityProvider mVSProvider; - @Mock private StatusBar mBar; @Mock private StatusBarStateController mStatusBarStateController; @Mock private KeyguardBypassController mBypassController; @Mock private ConfigurationControllerImpl mConfigurationController; diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaTest.kt index 3257a84f14d6..31465f45af42 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaTest.kt @@ -25,7 +25,7 @@ import java.util.concurrent.Executor class KeyguardBottomAreaTest : SysuiTestCase() { @Mock - private lateinit var mStatusBar: StatusBar + private lateinit var mCentralSurfaces: CentralSurfaces private lateinit var mKeyguardBottomArea: KeyguardBottomAreaView @Before @@ -42,7 +42,7 @@ class KeyguardBottomAreaTest : SysuiTestCase() { mKeyguardBottomArea = LayoutInflater.from(mContext).inflate( R.layout.keyguard_bottom_area, null, false) as KeyguardBottomAreaView - mKeyguardBottomArea.setStatusBar(mStatusBar) + mKeyguardBottomArea.setCentralSurfaces(mCentralSurfaces) } @Test diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationPanelViewControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationPanelViewControllerTest.java index b44eb65ca83c..38412fd1fa9b 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationPanelViewControllerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationPanelViewControllerTest.java @@ -169,7 +169,7 @@ public class NotificationPanelViewControllerTest extends SysuiTestCase { private static final int NOTIFICATION_SCRIM_TOP_PADDING_IN_SPLIT_SHADE = 50; @Mock - private StatusBar mStatusBar; + private CentralSurfaces mCentralSurfaces; @Mock private NotificationStackScrollLayout mNotificationStackScrollLayout; @Mock @@ -548,7 +548,7 @@ public class NotificationPanelViewControllerTest extends SysuiTestCase { mKeyguardUnlockAnimationController, mNotificationListContainer); mNotificationPanelViewController.initDependencies( - mStatusBar, + mCentralSurfaces, () -> {}, mNotificationShelfController); mNotificationPanelViewController.setHeadsUpManager(mHeadsUpManager); diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationShadeWindowViewControllerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationShadeWindowViewControllerTest.kt index 26fafdf3982a..093f92646115 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationShadeWindowViewControllerTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationShadeWindowViewControllerTest.kt @@ -61,7 +61,7 @@ class NotificationShadeWindowViewControllerTest : SysuiTestCase() { @Mock private lateinit var mStatusBarStateController: SysuiStatusBarStateController @Mock - private lateinit var mStatusBar: StatusBar + private lateinit var mCentralSurfaces: CentralSurfaces @Mock private lateinit var mDockManager: DockManager @Mock @@ -108,7 +108,7 @@ class NotificationShadeWindowViewControllerTest : SysuiTestCase() { mStatusBarWindowStateController, mLockIconViewController, Optional.of(mLowLightClockController), - mStatusBar, + mCentralSurfaces, mNotificationShadeWindowController ) mController.setupExpandedStatusBar() diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationShadeWindowViewTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationShadeWindowViewTest.java index f9a1bdd09f7b..62a1bcdc0184 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationShadeWindowViewTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationShadeWindowViewTest.java @@ -71,7 +71,7 @@ public class NotificationShadeWindowViewTest extends SysuiTestCase { @Mock private DragDownHelper mDragDownHelper; @Mock private SysuiStatusBarStateController mStatusBarStateController; @Mock private ShadeController mShadeController; - @Mock private StatusBar mStatusBar; + @Mock private CentralSurfaces mCentralSurfaces; @Mock private DockManager mDockManager; @Mock private NotificationPanelViewController mNotificationPanelViewController; @Mock private NotificationStackScrollLayout mNotificationStackScrollLayout; @@ -116,7 +116,7 @@ public class NotificationShadeWindowViewTest extends SysuiTestCase { mStatusBarWindowStateController, mLockIconViewController, Optional.of(mLowLightClockController), - mStatusBar, + mCentralSurfaces, mNotificationShadeWindowController); mController.setupExpandedStatusBar(); mController.setDragDownHelper(mDragDownHelper); diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManagerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManagerTest.java index 8b93de571cc9..f4f55ccefd09 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManagerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManagerTest.java @@ -75,7 +75,7 @@ public class StatusBarKeyguardViewManagerTest extends SysuiTestCase { @Mock private KeyguardStateController mKeyguardStateController; @Mock - private StatusBar mStatusBar; + private CentralSurfaces mCentralSurfaces; @Mock private ViewGroup mContainer; @Mock @@ -118,7 +118,7 @@ public class StatusBarKeyguardViewManagerTest extends SysuiTestCase { any(ViewGroup.class), any(KeyguardBouncer.BouncerExpansionCallback.class))) .thenReturn(mBouncer); - when(mStatusBar.getBouncerContainer()).thenReturn(mContainer); + when(mCentralSurfaces.getBouncerContainer()).thenReturn(mContainer); when(mContainer.findViewById(anyInt())).thenReturn(mKeyguardMessageArea); mStatusBarKeyguardViewManager = new StatusBarKeyguardViewManager( getContext(), @@ -138,8 +138,8 @@ public class StatusBarKeyguardViewManagerTest extends SysuiTestCase { Optional.of(mSysUiUnfoldComponent), () -> mShadeController, mLatencyTracker); - mStatusBarKeyguardViewManager.registerStatusBar( - mStatusBar, + mStatusBarKeyguardViewManager.registerCentralSurfaces( + mCentralSurfaces, mNotificationPanelView, new PanelExpansionStateManager(), mBiometricUnlockController, @@ -261,7 +261,7 @@ public class StatusBarKeyguardViewManagerTest extends SysuiTestCase { @Test public void onPanelExpansionChanged_neverTranslatesBouncerWhenLaunchingApp() { - when(mStatusBar.isInLaunchTransition()).thenReturn(true); + when(mCentralSurfaces.isInLaunchTransition()).thenReturn(true); mStatusBarKeyguardViewManager.onPanelExpansionChanged( /* fraction= */ KeyguardBouncer.EXPANSION_VISIBLE, /* expanded= */ true, @@ -272,12 +272,12 @@ public class StatusBarKeyguardViewManagerTest extends SysuiTestCase { @Test public void setOccluded_animatesPanelExpansion_onlyIfBouncerHidden() { mStatusBarKeyguardViewManager.setOccluded(false /* occluded */, true /* animated */); - verify(mStatusBar).animateKeyguardUnoccluding(); + verify(mCentralSurfaces).animateKeyguardUnoccluding(); when(mBouncer.isShowing()).thenReturn(true); - clearInvocations(mStatusBar); + clearInvocations(mCentralSurfaces); mStatusBarKeyguardViewManager.setOccluded(false /* occluded */, true /* animated */); - verify(mStatusBar, never()).animateKeyguardUnoccluding(); + verify(mCentralSurfaces, never()).animateKeyguardUnoccluding(); } @Test @@ -303,7 +303,7 @@ public class StatusBarKeyguardViewManagerTest extends SysuiTestCase { @Test public void setOccluded_isInLaunchTransition_onKeyguardOccludedChangedCalled() { - when(mStatusBar.isInLaunchTransition()).thenReturn(true); + when(mCentralSurfaces.isInLaunchTransition()).thenReturn(true); mStatusBarKeyguardViewManager.show(null); mStatusBarKeyguardViewManager.setOccluded(true /* occluded */, false /* animated */); @@ -312,7 +312,7 @@ public class StatusBarKeyguardViewManagerTest extends SysuiTestCase { @Test public void setOccluded_isLaunchingActivityOverLockscreen_onKeyguardOccludedChangedCalled() { - when(mStatusBar.isLaunchingActivityOverLockscreen()).thenReturn(true); + when(mCentralSurfaces.isLaunchingActivityOverLockscreen()).thenReturn(true); mStatusBarKeyguardViewManager.show(null); mStatusBarKeyguardViewManager.setOccluded(true /* occluded */, false /* animated */); diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarNotificationActivityStarterTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarNotificationActivityStarterTest.java index 107c46f09fac..ace7415f2c17 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarNotificationActivityStarterTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarNotificationActivityStarterTest.java @@ -113,7 +113,7 @@ public class StatusBarNotificationActivityStarterTest extends SysuiTestCase { @Mock private NotificationRemoteInputManager mRemoteInputManager; @Mock - private StatusBar mStatusBar; + private CentralSurfaces mCentralSurfaces; @Mock private KeyguardStateController mKeyguardStateController; @Mock @@ -233,7 +233,7 @@ public class StatusBarNotificationActivityStarterTest extends SysuiTestCase { mock(MetricsLogger.class), mock(StatusBarNotificationActivityStarterLogger.class), mOnUserInteractionCallback, - mStatusBar, + mCentralSurfaces, mock(NotificationPresenter.class), mock(NotificationPanelViewController.class), mActivityLaunchAnimator, @@ -267,7 +267,7 @@ public class StatusBarNotificationActivityStarterTest extends SysuiTestCase { sbn.getNotification().flags |= Notification.FLAG_AUTO_CANCEL; when(mKeyguardStateController.isShowing()).thenReturn(true); - when(mStatusBar.isOccluded()).thenReturn(true); + when(mCentralSurfaces.isOccluded()).thenReturn(true); // When mNotificationActivityStarter.onNotificationClicked(sbn, mNotificationRow); @@ -326,7 +326,7 @@ public class StatusBarNotificationActivityStarterTest extends SysuiTestCase { // Given sbn.getNotification().contentIntent = null; when(mKeyguardStateController.isShowing()).thenReturn(true); - when(mStatusBar.isOccluded()).thenReturn(true); + when(mCentralSurfaces.isOccluded()).thenReturn(true); // When mNotificationActivityStarter.onNotificationClicked(sbn, mBubbleNotificationRow); @@ -356,7 +356,7 @@ public class StatusBarNotificationActivityStarterTest extends SysuiTestCase { // Given sbn.getNotification().contentIntent = mContentIntent; when(mKeyguardStateController.isShowing()).thenReturn(true); - when(mStatusBar.isOccluded()).thenReturn(true); + when(mCentralSurfaces.isOccluded()).thenReturn(true); // When mNotificationActivityStarter.onNotificationClicked(sbn, mBubbleNotificationRow); @@ -400,6 +400,6 @@ public class StatusBarNotificationActivityStarterTest extends SysuiTestCase { mNotificationActivityStarter.handleFullScreenIntent(entry); // THEN display should try wake up for the full screen intent - verify(mStatusBar).wakeUpForFullScreenIntent(); + verify(mCentralSurfaces).wakeUpForFullScreenIntent(); } } diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarNotificationPresenterTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarNotificationPresenterTest.java index b7a5490527f9..1a3dd3a7a2a5 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarNotificationPresenterTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarNotificationPresenterTest.java @@ -80,7 +80,7 @@ public class StatusBarNotificationPresenterTest extends SysuiTestCase { private CommandQueue mCommandQueue; private FakeMetricsLogger mMetricsLogger; private ShadeController mShadeController = mock(ShadeController.class); - private StatusBar mStatusBar = mock(StatusBar.class); + private CentralSurfaces mCentralSurfaces = mock(CentralSurfaces.class); private InitController mInitController = new InitController(); @Before @@ -117,7 +117,7 @@ public class StatusBarNotificationPresenterTest extends SysuiTestCase { mock(DynamicPrivacyController.class), mock(KeyguardStateController.class), mock(KeyguardIndicationController.class), - mStatusBar, + mCentralSurfaces, mock(ShadeControllerImpl.class), mock(LockscreenShadeTransitionController.class), mCommandQueue, @@ -203,9 +203,9 @@ public class StatusBarNotificationPresenterTest extends SysuiTestCase { .setTag("a") .setNotification(n) .build(); - when(mStatusBar.areNotificationAlertsDisabled()).thenReturn(true); + when(mCentralSurfaces.areNotificationAlertsDisabled()).thenReturn(true); - assertTrue("StatusBar alerts disabled shouldn't allow interruptions", + assertTrue("CentralSurfaces alerts disabled shouldn't allow interruptions", mInterruptSuppressor.suppressInterruptions(entry)); } diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/UnlockedScreenOffAnimationControllerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/UnlockedScreenOffAnimationControllerTest.kt index 71b32c0bd106..050563a5707c 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/UnlockedScreenOffAnimationControllerTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/UnlockedScreenOffAnimationControllerTest.kt @@ -61,7 +61,7 @@ class UnlockedScreenOffAnimationControllerTest : SysuiTestCase() { @Mock private lateinit var globalSettings: GlobalSettings @Mock - private lateinit var statusBar: StatusBar + private lateinit var mCentralSurfaces: CentralSurfaces @Mock private lateinit var notificationPanelViewController: NotificationPanelViewController @Mock @@ -93,8 +93,8 @@ class UnlockedScreenOffAnimationControllerTest : SysuiTestCase() { powerManager, handler = handler ) - controller.initialize(statusBar, lightRevealScrim) - `when`(statusBar.notificationPanelViewController).thenReturn( + controller.initialize(mCentralSurfaces, lightRevealScrim) + `when`(mCentralSurfaces.notificationPanelViewController).thenReturn( notificationPanelViewController) // Screen off does not run if the panel is expanded, so we should say it's collapsed to test diff --git a/packages/SystemUI/tests/src/com/android/systemui/wmshell/BubblesTest.java b/packages/SystemUI/tests/src/com/android/systemui/wmshell/BubblesTest.java index 593b97e55739..82880febc7f0 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/wmshell/BubblesTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/wmshell/BubblesTest.java @@ -1221,7 +1221,7 @@ public class BubblesTest extends SysuiTestCase { final Context userContext = setUpContextWithPackageManager(workPkg, mock(ApplicationInfo.class)); - // If things are working correctly, StatusBar.getPackageManagerForUser will call this + // If things are working correctly, CentralSurfaces.getPackageManagerForUser will call this when(context.createPackageContextAsUser(eq(workPkg), anyInt(), eq(workUser))) .thenReturn(userContext); |