diff options
| author | 2023-04-14 21:41:35 +0000 | |
|---|---|---|
| committer | 2023-04-14 21:41:35 +0000 | |
| commit | 8f67ef96fc0348b23e18baa3be2803a14dd9e77c (patch) | |
| tree | 5b1a6b8849865bac711c5799cf0262fea1b4a54a | |
| parent | 9bf704091b787c3b1879003eca6b46d859c50c26 (diff) | |
| parent | 80515f0cb9b29c4863c2443f5441a93ae140d5a7 (diff) | |
Merge "Replace many references to NPVC with an interface" into udc-dev
51 files changed, 369 insertions, 343 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardViewController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardViewController.java index 7661b8d0c144..281067da6757 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardViewController.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardViewController.java @@ -23,8 +23,8 @@ import android.view.ViewRootImpl; import androidx.annotation.Nullable; import com.android.systemui.keyguard.KeyguardViewMediator; -import com.android.systemui.shade.NotificationPanelViewController; import com.android.systemui.shade.ShadeExpansionStateManager; +import com.android.systemui.shade.ShadeViewController; import com.android.systemui.statusbar.phone.BiometricUnlockController; import com.android.systemui.statusbar.phone.CentralSurfaces; import com.android.systemui.statusbar.phone.KeyguardBypassController; @@ -178,7 +178,7 @@ public interface KeyguardViewController { * Registers the CentralSurfaces to which this Keyguard View is mounted. */ void registerCentralSurfaces(CentralSurfaces centralSurfaces, - NotificationPanelViewController notificationPanelViewController, + ShadeViewController shadeViewController, @Nullable ShadeExpansionStateManager shadeExpansionStateManager, BiometricUnlockController biometricUnlockController, View notificationContainer, diff --git a/packages/SystemUI/src/com/android/keyguard/dagger/KeyguardStatusBarViewComponent.java b/packages/SystemUI/src/com/android/keyguard/dagger/KeyguardStatusBarViewComponent.java index d01c98a934ff..91dd1d643c96 100644 --- a/packages/SystemUI/src/com/android/keyguard/dagger/KeyguardStatusBarViewComponent.java +++ b/packages/SystemUI/src/com/android/keyguard/dagger/KeyguardStatusBarViewComponent.java @@ -17,7 +17,7 @@ package com.android.keyguard.dagger; import com.android.keyguard.KeyguardStatusViewController; -import com.android.systemui.shade.NotificationPanelViewController; +import com.android.systemui.shade.ShadeViewStateProvider; import com.android.systemui.statusbar.phone.KeyguardStatusBarView; import com.android.systemui.statusbar.phone.KeyguardStatusBarViewController; @@ -37,8 +37,8 @@ public interface KeyguardStatusBarViewComponent { interface Factory { KeyguardStatusBarViewComponent build( @BindsInstance KeyguardStatusBarView view, - @BindsInstance NotificationPanelViewController.NotificationPanelViewStateProvider - notificationPanelViewStateProvider); + @BindsInstance ShadeViewStateProvider + shadeViewStateProvider); } /** Builds a {@link KeyguardStatusViewController}. */ diff --git a/packages/SystemUI/src/com/android/systemui/dreams/touch/ShadeTouchHandler.java b/packages/SystemUI/src/com/android/systemui/dreams/touch/ShadeTouchHandler.java index 58b70b02e84f..99451f2ee1b9 100644 --- a/packages/SystemUI/src/com/android/systemui/dreams/touch/ShadeTouchHandler.java +++ b/packages/SystemUI/src/com/android/systemui/dreams/touch/ShadeTouchHandler.java @@ -23,7 +23,7 @@ import android.graphics.Region; import android.view.GestureDetector; import android.view.MotionEvent; -import com.android.systemui.shade.NotificationPanelViewController; +import com.android.systemui.shade.ShadeViewController; import com.android.systemui.statusbar.phone.CentralSurfaces; import java.util.Optional; @@ -54,8 +54,8 @@ public class ShadeTouchHandler implements DreamTouchHandler { } session.registerInputListener(ev -> { - final NotificationPanelViewController viewController = - mSurfaces.map(CentralSurfaces::getNotificationPanelViewController).orElse(null); + final ShadeViewController viewController = + mSurfaces.map(CentralSurfaces::getShadeViewController).orElse(null); if (viewController != null) { viewController.handleExternalTouch((MotionEvent) ev); diff --git a/packages/SystemUI/src/com/android/systemui/dreams/touch/dagger/BouncerSwipeModule.java b/packages/SystemUI/src/com/android/systemui/dreams/touch/dagger/BouncerSwipeModule.java index 081bab085843..5f03743f48b8 100644 --- a/packages/SystemUI/src/com/android/systemui/dreams/touch/dagger/BouncerSwipeModule.java +++ b/packages/SystemUI/src/com/android/systemui/dreams/touch/dagger/BouncerSwipeModule.java @@ -25,16 +25,16 @@ import com.android.systemui.R; import com.android.systemui.dagger.qualifiers.Main; import com.android.systemui.dreams.touch.BouncerSwipeTouchHandler; import com.android.systemui.dreams.touch.DreamTouchHandler; -import com.android.systemui.shade.NotificationPanelViewController; +import com.android.systemui.shade.ShadeViewController; import com.android.wm.shell.animation.FlingAnimationUtils; -import javax.inject.Named; -import javax.inject.Provider; - import dagger.Module; import dagger.Provides; import dagger.multibindings.IntoSet; +import javax.inject.Named; +import javax.inject.Provider; + /** * This module captures the components associated with {@link BouncerSwipeTouchHandler}. */ @@ -78,8 +78,8 @@ public class BouncerSwipeModule { return flingAnimationUtilsBuilderProvider.get() .reset() .setMaxLengthSeconds( - NotificationPanelViewController.FLING_CLOSING_MAX_LENGTH_SECONDS) - .setSpeedUpFactor(NotificationPanelViewController.FLING_SPEED_UP_FACTOR) + ShadeViewController.FLING_CLOSING_MAX_LENGTH_SECONDS) + .setSpeedUpFactor(ShadeViewController.FLING_SPEED_UP_FACTOR) .build(); } @@ -92,8 +92,8 @@ public class BouncerSwipeModule { Provider<FlingAnimationUtils.Builder> flingAnimationUtilsBuilderProvider) { return flingAnimationUtilsBuilderProvider.get() .reset() - .setMaxLengthSeconds(NotificationPanelViewController.FLING_MAX_LENGTH_SECONDS) - .setSpeedUpFactor(NotificationPanelViewController.FLING_SPEED_UP_FACTOR) + .setMaxLengthSeconds(ShadeViewController.FLING_MAX_LENGTH_SECONDS) + .setSpeedUpFactor(ShadeViewController.FLING_SPEED_UP_FACTOR) .build(); } diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java index 0fd479afcf48..e0af5ceedb2f 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java @@ -134,9 +134,9 @@ import com.android.systemui.keyguard.dagger.KeyguardModule; import com.android.systemui.navigationbar.NavigationModeController; import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.settings.UserTracker; -import com.android.systemui.shade.NotificationPanelViewController; import com.android.systemui.shade.ShadeController; import com.android.systemui.shade.ShadeExpansionStateManager; +import com.android.systemui.shade.ShadeViewController; import com.android.systemui.shared.system.QuickStepContract; import com.android.systemui.statusbar.CommandQueue; import com.android.systemui.statusbar.NotificationShadeDepthController; @@ -3098,7 +3098,7 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable, * @return the View Controller for the Keyguard View this class is mediating. */ public KeyguardViewController registerCentralSurfaces(CentralSurfaces centralSurfaces, - NotificationPanelViewController panelView, + ShadeViewController panelView, @Nullable ShadeExpansionStateManager shadeExpansionStateManager, BiometricUnlockController biometricUnlockController, View notificationContainer, KeyguardBypassController bypassController) { diff --git a/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBar.java b/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBar.java index c2d73f39b7e8..b0fb349083e6 100644 --- a/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBar.java +++ b/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBar.java @@ -741,7 +741,7 @@ public class NavigationBar extends ViewController<NavigationBarView> implements mView.setComponents(mRecentsOptional); if (mCentralSurfacesOptionalLazy.get().isPresent()) { mView.setComponents( - mCentralSurfacesOptionalLazy.get().get().getNotificationPanelViewController()); + mCentralSurfacesOptionalLazy.get().get().getShadeViewController()); } mView.setDisabledFlags(mDisabledFlags1, mSysUiFlagsContainer); mView.setOnVerticalChangedListener(this::onVerticalChanged); @@ -1343,8 +1343,8 @@ public class NavigationBar extends ViewController<NavigationBarView> implements private void onVerticalChanged(boolean isVertical) { Optional<CentralSurfaces> cs = mCentralSurfacesOptionalLazy.get(); - if (cs.isPresent() && cs.get().getNotificationPanelViewController() != null) { - cs.get().getNotificationPanelViewController().setQsScrimEnabled(!isVertical); + if (cs.isPresent() && cs.get().getShadeViewController() != null) { + cs.get().getShadeViewController().setQsScrimEnabled(!isVertical); } } diff --git a/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarView.java b/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarView.java index 5d598e8dc765..94f01b87f936 100644 --- a/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarView.java +++ b/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarView.java @@ -74,7 +74,7 @@ import com.android.systemui.navigationbar.buttons.RotationContextButton; import com.android.systemui.navigationbar.gestural.EdgeBackGestureHandler; import com.android.systemui.recents.Recents; import com.android.systemui.settings.DisplayTracker; -import com.android.systemui.shade.NotificationPanelViewController; +import com.android.systemui.shade.ShadeViewController; import com.android.systemui.shared.rotation.FloatingRotationButton; import com.android.systemui.shared.rotation.RotationButton.RotationButtonUpdatesCallback; import com.android.systemui.shared.rotation.RotationButtonController; @@ -149,7 +149,7 @@ public class NavigationBarView extends FrameLayout { private NavigationBarInflaterView mNavigationInflaterView; private Optional<Recents> mRecentsOptional = Optional.empty(); @Nullable - private NotificationPanelViewController mPanelView; + private ShadeViewController mPanelView; private RotationContextButton mRotationContextButton; private FloatingRotationButton mFloatingRotationButton; private RotationButtonController mRotationButtonController; @@ -346,7 +346,8 @@ public class NavigationBarView extends FrameLayout { mRecentsOptional = recentsOptional; } - public void setComponents(NotificationPanelViewController panel) { + /** */ + public void setComponents(ShadeViewController panel) { mPanelView = panel; updatePanelSystemUiStateFlags(); } diff --git a/packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java b/packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java index 0a188e0e7d0b..a43f52019219 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java +++ b/packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java @@ -99,7 +99,7 @@ import com.android.systemui.navigationbar.buttons.KeyButtonView; import com.android.systemui.recents.OverviewProxyService.OverviewProxyListener; import com.android.systemui.settings.DisplayTracker; import com.android.systemui.settings.UserTracker; -import com.android.systemui.shade.NotificationPanelViewController; +import com.android.systemui.shade.ShadeViewController; import com.android.systemui.shared.recents.IOverviewProxy; import com.android.systemui.shared.recents.ISystemUiProxy; import com.android.systemui.shared.system.QuickStepContract; @@ -205,7 +205,7 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis // TODO move this logic to message queue mCentralSurfacesOptionalLazy.get().ifPresent(centralSurfaces -> { if (event.getActionMasked() == ACTION_DOWN) { - centralSurfaces.getNotificationPanelViewController() + centralSurfaces.getShadeViewController() .startExpandLatencyTracking(); } mHandler.post(() -> { @@ -676,9 +676,9 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis mNavBarControllerLazy.get().getDefaultNavigationBar(); final NavigationBarView navBarView = mNavBarControllerLazy.get().getNavigationBarView(mContext.getDisplayId()); - final NotificationPanelViewController panelController = + final ShadeViewController panelController = mCentralSurfacesOptionalLazy.get() - .map(CentralSurfaces::getNotificationPanelViewController) + .map(CentralSurfaces::getShadeViewController) .orElse(null); if (SysUiState.DEBUG) { Log.d(TAG_OPS, "Updating sysui state flags: navBarFragment=" + navBarFragment diff --git a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java index f77be3a13a04..9e204e48da8e 100644 --- a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java +++ b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java @@ -224,6 +224,8 @@ import com.android.systemui.util.Utils; import com.android.systemui.util.time.SystemClock; import com.android.wm.shell.animation.FlingAnimationUtils; +import kotlin.Unit; + import java.io.PrintWriter; import java.util.ArrayList; import java.util.Collections; @@ -234,18 +236,12 @@ import java.util.function.Consumer; import javax.inject.Inject; import javax.inject.Provider; -import kotlin.Unit; import kotlinx.coroutines.CoroutineDispatcher; @CentralSurfacesComponent.CentralSurfacesScope public final class NotificationPanelViewController implements ShadeSurface, Dumpable { public static final String TAG = NotificationPanelView.class.getSimpleName(); - public static final float FLING_MAX_LENGTH_SECONDS = 0.6f; - public static final float FLING_SPEED_UP_FACTOR = 0.6f; - public static final float FLING_CLOSING_MAX_LENGTH_SECONDS = 0.6f; - public static final float FLING_CLOSING_SPEED_UP_FACTOR = 0.6f; - public static final int WAKEUP_ANIMATION_DELAY_MS = 250; private static final boolean DEBUG_LOGCAT = Compile.IS_DEBUG && Log.isLoggable(TAG, Log.DEBUG); private static final boolean SPEW_LOGCAT = Compile.IS_DEBUG && Log.isLoggable(TAG, Log.VERBOSE); private static final boolean DEBUG_DRAWABLE = false; @@ -253,12 +249,6 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump VibrationEffect.get(VibrationEffect.EFFECT_STRENGTH_MEDIUM, false); /** The parallax amount of the quick settings translation when dragging down the panel. */ public static final float QS_PARALLAX_AMOUNT = 0.175f; - /** Fling expanding QS. */ - public static final int FLING_EXPAND = 0; - /** Fling collapsing QS, potentially stopping when QS becomes QQS. */ - public static final int FLING_COLLAPSE = 1; - /** Fling until QS is completely hidden. */ - public static final int FLING_HIDE = 2; /** The delay to reset the hint text when the hint animation is finished running. */ private static final int HINT_RESET_DELAY_MS = 1200; private static final long ANIMATION_DELAY_ICON_FADE_IN = @@ -868,8 +858,8 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump mKeyguardBypassController = bypassController; mUpdateMonitor = keyguardUpdateMonitor; mLockscreenShadeTransitionController = lockscreenShadeTransitionController; - lockscreenShadeTransitionController.setNotificationPanelController(this); - shadeTransitionController.setNotificationPanelViewController(this); + lockscreenShadeTransitionController.setShadeViewController(this); + shadeTransitionController.setShadeViewController(this); dynamicPrivacyController.addListener(this::onDynamicPrivacyChanged); quickSettingsController.setExpansionHeightListener(this::onQsSetExpansionHeightCalled); quickSettingsController.setQsStateUpdateListener(this::onQsStateUpdated); @@ -1021,7 +1011,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump mKeyguardStatusBarViewController = mKeyguardStatusBarViewComponentFactory.build( mKeyguardStatusBar, - mNotificationPanelViewStateProvider) + mShadeViewStateProvider) .getKeyguardStatusBarViewController(); mKeyguardStatusBarViewController.init(); @@ -1616,10 +1606,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump return isOnAod(); } - /** - * Notify us that {@link NotificationWakeUpCoordinator} is going to play the doze wakeup - * animation after a delay. If so, we'll keep the clock centered until that animation starts. - */ + @Override public void setWillPlayDelayedDozeAmountAnimation(boolean willPlay) { if (mWillPlayDelayedDozeAmountAnimation == willPlay) return; @@ -4379,29 +4366,8 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump } } - /** - * An interface that provides the current state of the notification panel and related views, - * which is needed to calculate {@link KeyguardStatusBarView}'s state in - * {@link KeyguardStatusBarViewController}. - */ - public interface NotificationPanelViewStateProvider { - /** Returns the expanded height of the panel view. */ - float getPanelViewExpandedHeight(); - - /** - * Returns true if heads up should be visible. - * - * TODO(b/138786270): If HeadsUpAppearanceController was injectable, we could inject it into - * {@link KeyguardStatusBarViewController} and remove this method. - */ - boolean shouldHeadsUpBeVisible(); - - /** Return the fraction of the shade that's expanded, when in lockscreen. */ - float getLockscreenShadeDragProgress(); - } - - private final NotificationPanelViewStateProvider mNotificationPanelViewStateProvider = - new NotificationPanelViewStateProvider() { + private final ShadeViewStateProvider mShadeViewStateProvider = + new ShadeViewStateProvider() { @Override public float getPanelViewExpandedHeight() { return getExpandedHeight(); @@ -4418,13 +4384,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump } }; - /** - * Reconfigures the shade to show the AOD UI (clock, smartspace, etc). This is called by the - * screen off animation controller in order to animate in AOD without "actually" fully switching - * to the KEYGUARD state, which is a heavy transition that causes jank as 10+ files react to the - * change. - */ - @VisibleForTesting + @Override public void showAodUi() { setDozing(true /* dozing */, false /* animate */); mStatusBarStateController.setUpcomingState(KEYGUARD); diff --git a/packages/SystemUI/src/com/android/systemui/shade/ShadeLogger.kt b/packages/SystemUI/src/com/android/systemui/shade/ShadeLogger.kt index a93183865a3f..1839e13dcdec 100644 --- a/packages/SystemUI/src/com/android/systemui/shade/ShadeLogger.kt +++ b/packages/SystemUI/src/com/android/systemui/shade/ShadeLogger.kt @@ -20,9 +20,9 @@ import android.view.MotionEvent import com.android.systemui.log.dagger.ShadeLog import com.android.systemui.plugins.log.LogBuffer import com.android.systemui.plugins.log.LogLevel -import com.android.systemui.shade.NotificationPanelViewController.FLING_COLLAPSE -import com.android.systemui.shade.NotificationPanelViewController.FLING_EXPAND -import com.android.systemui.shade.NotificationPanelViewController.FLING_HIDE +import com.android.systemui.shade.ShadeViewController.Companion.FLING_COLLAPSE +import com.android.systemui.shade.ShadeViewController.Companion.FLING_EXPAND +import com.android.systemui.shade.ShadeViewController.Companion.FLING_HIDE import com.google.errorprone.annotations.CompileTimeConstant import javax.inject.Inject diff --git a/packages/SystemUI/src/com/android/systemui/shade/ShadeSurface.kt b/packages/SystemUI/src/com/android/systemui/shade/ShadeSurface.kt index b698bd3e6468..5ac36bfc374f 100644 --- a/packages/SystemUI/src/com/android/systemui/shade/ShadeSurface.kt +++ b/packages/SystemUI/src/com/android/systemui/shade/ShadeSurface.kt @@ -94,6 +94,12 @@ interface ShadeSurface : ShadeViewController { fun setTouchAndAnimationDisabled(disabled: Boolean) /** + * Notify us that {@link NotificationWakeUpCoordinator} is going to play the doze wakeup + * animation after a delay. If so, we'll keep the clock centered until that animation starts. + */ + fun setWillPlayDelayedDozeAmountAnimation(willPlay: Boolean) + + /** * Sets the dozing state. * * @param dozing `true` when dozing. @@ -104,18 +110,12 @@ interface ShadeSurface : ShadeViewController { /** @see view.setImportantForAccessibility */ fun setImportantForAccessibility(mode: Int) - /** Sets Qs ScrimEnabled and updates QS state. */ - fun setQsScrimEnabled(qsScrimEnabled: Boolean) - /** Sets the view's X translation to zero. */ fun resetTranslation() /** Sets the view's alpha to max. */ fun resetAlpha() - /** @see ViewGroupFadeHelper.reset */ - fun resetViewGroupFade() - /** Called when Back gesture has been committed (i.e. a back event has definitely occurred) */ fun onBackPressed() diff --git a/packages/SystemUI/src/com/android/systemui/shade/ShadeViewController.kt b/packages/SystemUI/src/com/android/systemui/shade/ShadeViewController.kt index b6a2a8a45d68..d5a9e953c914 100644 --- a/packages/SystemUI/src/com/android/systemui/shade/ShadeViewController.kt +++ b/packages/SystemUI/src/com/android/systemui/shade/ShadeViewController.kt @@ -22,6 +22,8 @@ import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayoutController import com.android.systemui.statusbar.phone.HeadsUpAppearanceController import com.android.systemui.statusbar.phone.KeyguardBottomAreaView +import com.android.systemui.statusbar.phone.KeyguardStatusBarView +import com.android.systemui.statusbar.phone.KeyguardStatusBarViewController import java.util.function.Consumer /** @@ -147,6 +149,9 @@ interface ShadeViewController { /** Sets whether the screen has temporarily woken up to display notifications. */ fun setPulsing(pulsing: Boolean) + /** Sets Qs ScrimEnabled and updates QS state. */ + fun setQsScrimEnabled(qsScrimEnabled: Boolean) + /** Sets the top spacing for the ambient indicator. */ fun setAmbientIndicationTop(ambientIndicationTop: Int, ambientTextVisible: Boolean) @@ -166,6 +171,9 @@ interface ShadeViewController { */ val isUnlockHintRunning: Boolean + /** @see ViewGroupFadeHelper.reset */ + fun resetViewGroupFade() + /** * Set the alpha and translationY of the keyguard elements which only show on the lockscreen, * but not in shade locked / shade. This is used when dragging down to the full shade. @@ -183,6 +191,14 @@ interface ShadeViewController { fun setKeyguardStatusBarAlpha(alpha: Float) /** + * Reconfigures the shade to show the AOD UI (clock, smartspace, etc). This is called by the + * screen off animation controller in order to animate in AOD without "actually" fully switching + * to the KEYGUARD state, which is a heavy transition that causes jank as 10+ files react to the + * change. + */ + fun showAodUi() + + /** * This method should not be used anymore, you should probably use [.isShadeFullyOpen] instead. * It was overused as indicating if shade is open or we're on keyguard/AOD. Moving forward we * should be explicit about the what state we're checking. @@ -208,6 +224,23 @@ interface ShadeViewController { /** Returns the ShadeNotificationPresenter. */ val shadeNotificationPresenter: ShadeNotificationPresenter + + companion object { + const val WAKEUP_ANIMATION_DELAY_MS = 250 + const val FLING_MAX_LENGTH_SECONDS = 0.6f + const val FLING_SPEED_UP_FACTOR = 0.6f + const val FLING_CLOSING_MAX_LENGTH_SECONDS = 0.6f + const val FLING_CLOSING_SPEED_UP_FACTOR = 0.6f + + /** Fling expanding QS. */ + const val FLING_EXPAND = 0 + + /** Fling collapsing QS, potentially stopping when QS becomes QQS. */ + const val FLING_COLLAPSE = 1 + + /** Fling until QS is completely hidden. */ + const val FLING_HIDE = 2 + } } /** Manages listeners for when users begin expanding the shade from a HUN. */ @@ -254,3 +287,23 @@ interface ShadeNotificationPresenter { /** Returns whether the screen has temporarily woken up to display notifications. */ fun hasPulsingNotifications(): Boolean } + +/** + * An interface that provides the current state of the notification panel and related views, which + * is needed to calculate [KeyguardStatusBarView]'s state in [KeyguardStatusBarViewController]. + */ +interface ShadeViewStateProvider { + /** Returns the expanded height of the panel view. */ + val panelViewExpandedHeight: Float + + /** + * Returns true if heads up should be visible. + * + * TODO(b/138786270): If HeadsUpAppearanceController was injectable, we could inject it into + * [KeyguardStatusBarViewController] and remove this method. + */ + fun shouldHeadsUpBeVisible(): Boolean + + /** Return the fraction of the shade that's expanded, when in lockscreen. */ + val lockscreenShadeDragProgress: Float +} diff --git a/packages/SystemUI/src/com/android/systemui/shade/transition/ShadeTransitionController.kt b/packages/SystemUI/src/com/android/systemui/shade/transition/ShadeTransitionController.kt index 129d09ec3c14..41be526ec13e 100644 --- a/packages/SystemUI/src/com/android/systemui/shade/transition/ShadeTransitionController.kt +++ b/packages/SystemUI/src/com/android/systemui/shade/transition/ShadeTransitionController.kt @@ -22,10 +22,10 @@ import com.android.systemui.R import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dump.DumpManager import com.android.systemui.plugins.qs.QS -import com.android.systemui.shade.NotificationPanelViewController import com.android.systemui.shade.PanelState import com.android.systemui.shade.ShadeExpansionChangeEvent import com.android.systemui.shade.ShadeExpansionStateManager +import com.android.systemui.shade.ShadeViewController import com.android.systemui.shade.panelStateToString import com.android.systemui.statusbar.StatusBarState import com.android.systemui.statusbar.SysuiStatusBarStateController @@ -47,7 +47,7 @@ constructor( private val statusBarStateController: SysuiStatusBarStateController, ) { - lateinit var notificationPanelViewController: NotificationPanelViewController + lateinit var shadeViewController: ShadeViewController lateinit var notificationStackScrollLayoutController: NotificationStackScrollLayoutController lateinit var qs: QS @@ -93,7 +93,7 @@ constructor( currentPanelState: ${currentPanelState?.panelStateToString()} lastPanelExpansionChangeEvent: $lastShadeExpansionChangeEvent qs.isInitialized: ${this::qs.isInitialized} - npvc.isInitialized: ${this::notificationPanelViewController.isInitialized} + npvc.isInitialized: ${this::shadeViewController.isInitialized} nssl.isInitialized: ${this::notificationStackScrollLayoutController.isInitialized} """.trimIndent()) } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/LockscreenShadeKeyguardTransitionController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/LockscreenShadeKeyguardTransitionController.kt index 5fb500247697..fec61124bc86 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/LockscreenShadeKeyguardTransitionController.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/LockscreenShadeKeyguardTransitionController.kt @@ -6,7 +6,7 @@ import android.util.MathUtils import com.android.systemui.R import com.android.systemui.dump.DumpManager import com.android.systemui.media.controls.ui.MediaHierarchyManager -import com.android.systemui.shade.NotificationPanelViewController +import com.android.systemui.shade.ShadeViewController import com.android.systemui.statusbar.policy.ConfigurationController import dagger.assisted.Assisted import dagger.assisted.AssistedFactory @@ -17,7 +17,7 @@ class LockscreenShadeKeyguardTransitionController @AssistedInject constructor( private val mediaHierarchyManager: MediaHierarchyManager, - @Assisted private val notificationPanelController: NotificationPanelViewController, + @Assisted private val notificationPanelController: ShadeViewController, context: Context, configurationController: ConfigurationController, dumpManager: DumpManager @@ -114,7 +114,7 @@ constructor( @AssistedFactory fun interface Factory { fun create( - notificationPanelController: NotificationPanelViewController + notificationPanelController: ShadeViewController ): LockscreenShadeKeyguardTransitionController } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/LockscreenShadeTransitionController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/LockscreenShadeTransitionController.kt index 792939b7649b..faf592e47eb4 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/LockscreenShadeTransitionController.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/LockscreenShadeTransitionController.kt @@ -30,7 +30,7 @@ import com.android.systemui.plugins.ActivityStarter.OnDismissAction import com.android.systemui.plugins.FalsingManager import com.android.systemui.plugins.qs.QS import com.android.systemui.plugins.statusbar.StatusBarStateController -import com.android.systemui.shade.NotificationPanelViewController +import com.android.systemui.shade.ShadeViewController import com.android.systemui.statusbar.notification.collection.NotificationEntry import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow import com.android.systemui.statusbar.notification.row.ExpandableView @@ -79,7 +79,7 @@ class LockscreenShadeTransitionController @Inject constructor( private set private var useSplitShade: Boolean = false private lateinit var nsslController: NotificationStackScrollLayoutController - lateinit var notificationPanelController: NotificationPanelViewController + lateinit var shadeViewController: ShadeViewController lateinit var centralSurfaces: CentralSurfaces lateinit var qS: QS @@ -182,7 +182,7 @@ class LockscreenShadeTransitionController @Inject constructor( } private val keyguardTransitionController by lazy { - keyguardTransitionControllerFactory.create(notificationPanelController) + keyguardTransitionControllerFactory.create(shadeViewController) } private val qsTransitionController = qsTransitionControllerFactory.create { qS } @@ -319,7 +319,7 @@ class LockscreenShadeTransitionController @Inject constructor( startingChild.onExpandedByGesture( true /* drag down is always an open */) } - notificationPanelController.transitionToExpandedShade(delay) + shadeViewController.transitionToExpandedShade(delay) callbacks.forEach { it.setTransitionToFullShadeAmount(0f, true /* animated */, delay) } @@ -530,7 +530,7 @@ class LockscreenShadeTransitionController @Inject constructor( } else { // Let's only animate notifications animationHandler = { delay: Long -> - notificationPanelController.transitionToExpandedShade(delay) + shadeViewController.transitionToExpandedShade(delay) } } goToLockedShadeInternal(expandedView, animationHandler, @@ -648,7 +648,7 @@ class LockscreenShadeTransitionController @Inject constructor( */ private fun performDefaultGoToFullShadeAnimation(delay: Long) { logger.logDefaultGoToFullShadeAnimation(delay) - notificationPanelController.transitionToExpandedShade(delay) + shadeViewController.transitionToExpandedShade(delay) animateAppear(delay) } @@ -673,7 +673,7 @@ class LockscreenShadeTransitionController @Inject constructor( } else { pulseHeight = height val overflow = nsslController.setPulseHeight(height) - notificationPanelController.setOverStretchAmount(overflow) + shadeViewController.setOverStretchAmount(overflow) val transitionHeight = if (keyguardBypassController.bypassEnabled) height else 0.0f transitionToShadeAmountCommon(transitionHeight) } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationWakeUpCoordinator.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationWakeUpCoordinator.kt index 20af6cadeed5..fe0b28d16239 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationWakeUpCoordinator.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationWakeUpCoordinator.kt @@ -26,9 +26,9 @@ import com.android.systemui.animation.InterpolatorsAndroidX import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dump.DumpManager import com.android.systemui.plugins.statusbar.StatusBarStateController -import com.android.systemui.shade.NotificationPanelViewController.WAKEUP_ANIMATION_DELAY_MS import com.android.systemui.shade.ShadeExpansionChangeEvent import com.android.systemui.shade.ShadeExpansionListener +import com.android.systemui.shade.ShadeViewController import com.android.systemui.statusbar.StatusBarState import com.android.systemui.statusbar.notification.collection.NotificationEntry import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayoutController @@ -383,7 +383,7 @@ constructor( ObjectAnimator.ofFloat(this, delayedDozeAmount, 0.0f).apply { interpolator = InterpolatorsAndroidX.LINEAR duration = StackStateAnimator.ANIMATION_DURATION_WAKEUP.toLong() - startDelay = WAKEUP_ANIMATION_DELAY_MS.toLong() + startDelay = ShadeViewController.WAKEUP_ANIMATION_DELAY_MS.toLong() doOnStart { wakeUpListeners.forEach { it.onDelayedDozeAmountAnimationRunning(true) } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfaces.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfaces.java index 00928b206916..f579d304b268 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfaces.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfaces.java @@ -48,9 +48,9 @@ import com.android.systemui.navigationbar.NavigationBarView; import com.android.systemui.plugins.ActivityStarter; import com.android.systemui.plugins.statusbar.NotificationSwipeActionHelper; import com.android.systemui.qs.QSPanelController; -import com.android.systemui.shade.NotificationPanelViewController; import com.android.systemui.shade.NotificationShadeWindowView; import com.android.systemui.shade.NotificationShadeWindowViewController; +import com.android.systemui.shade.ShadeViewController; import com.android.systemui.statusbar.LightRevealScrim; import com.android.systemui.statusbar.NotificationPresenter; import com.android.systemui.util.Compile; @@ -218,7 +218,8 @@ public interface CentralSurfaces extends Dumpable, ActivityStarter, LifecycleOwn NotificationShadeWindowViewController getNotificationShadeWindowViewController(); - NotificationPanelViewController getNotificationPanelViewController(); + /** */ + ShadeViewController getShadeViewController(); /** Get the Keyguard Message Area that displays auth messages. */ AuthKeyguardMessageArea getKeyguardMessageArea(); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesCommandQueueCallbacks.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesCommandQueueCallbacks.java index 8b6617b8f2e1..c0a7a34a3a1e 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesCommandQueueCallbacks.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesCommandQueueCallbacks.java @@ -54,9 +54,9 @@ import com.android.systemui.qs.QSHost; import com.android.systemui.qs.QSPanelController; import com.android.systemui.settings.UserTracker; import com.android.systemui.shade.CameraLauncher; -import com.android.systemui.shade.NotificationPanelViewController; import com.android.systemui.shade.QuickSettingsController; import com.android.systemui.shade.ShadeController; +import com.android.systemui.shade.ShadeViewController; import com.android.systemui.statusbar.CommandQueue; import com.android.systemui.statusbar.VibratorHelper; import com.android.systemui.statusbar.disableflags.DisableFlagsLogger; @@ -80,7 +80,7 @@ public class CentralSurfacesCommandQueueCallbacks implements CommandQueue.Callba private final Context mContext; private final com.android.systemui.shade.ShadeController mShadeController; private final CommandQueue mCommandQueue; - private final NotificationPanelViewController mNotificationPanelViewController; + private final ShadeViewController mShadeViewController; private final RemoteInputQuickSettingsDisabler mRemoteInputQuickSettingsDisabler; private final MetricsLogger mMetricsLogger; private final KeyguardUpdateMonitor mKeyguardUpdateMonitor; @@ -117,7 +117,7 @@ public class CentralSurfacesCommandQueueCallbacks implements CommandQueue.Callba @Main Resources resources, ShadeController shadeController, CommandQueue commandQueue, - NotificationPanelViewController notificationPanelViewController, + ShadeViewController shadeViewController, RemoteInputQuickSettingsDisabler remoteInputQuickSettingsDisabler, MetricsLogger metricsLogger, KeyguardUpdateMonitor keyguardUpdateMonitor, @@ -144,7 +144,7 @@ public class CentralSurfacesCommandQueueCallbacks implements CommandQueue.Callba mContext = context; mShadeController = shadeController; mCommandQueue = commandQueue; - mNotificationPanelViewController = notificationPanelViewController; + mShadeViewController = shadeViewController; mRemoteInputQuickSettingsDisabler = remoteInputQuickSettingsDisabler; mMetricsLogger = metricsLogger; mKeyguardUpdateMonitor = keyguardUpdateMonitor; @@ -218,7 +218,7 @@ public class CentralSurfacesCommandQueueCallbacks implements CommandQueue.Callba return; } - mNotificationPanelViewController.expandToNotifications(); + mShadeViewController.expandToNotifications(); } @Override @@ -234,7 +234,7 @@ public class CentralSurfacesCommandQueueCallbacks implements CommandQueue.Callba // Settings are not available in setup if (!mDeviceProvisionedController.isCurrentUserSetup()) return; - mNotificationPanelViewController.expandToQs(); + mShadeViewController.expandToQs(); } @Override @@ -300,7 +300,7 @@ public class CentralSurfacesCommandQueueCallbacks implements CommandQueue.Callba } } - mNotificationPanelViewController.disableHeader(state1, state2, animate); + mShadeViewController.disableHeader(state1, state2, animate); } /** @@ -322,22 +322,22 @@ public class CentralSurfacesCommandQueueCallbacks implements CommandQueue.Callba if (KeyEvent.KEYCODE_SYSTEM_NAVIGATION_UP == key.getKeyCode()) { mMetricsLogger.action(MetricsEvent.ACTION_SYSTEM_NAVIGATION_KEY_UP); - mNotificationPanelViewController.collapse( + mShadeViewController.collapse( false /* delayed */, 1.0f /* speedUpFactor */); } else if (KeyEvent.KEYCODE_SYSTEM_NAVIGATION_DOWN == key.getKeyCode()) { mMetricsLogger.action(MetricsEvent.ACTION_SYSTEM_NAVIGATION_KEY_DOWN); - if (mNotificationPanelViewController.isFullyCollapsed()) { + if (mShadeViewController.isFullyCollapsed()) { if (mVibrateOnOpening) { mVibratorHelper.vibrate(VibrationEffect.EFFECT_TICK); } - mNotificationPanelViewController.expand(true /* animate */); + mShadeViewController.expand(true /* animate */); mNotificationStackScrollLayoutController.setWillExpand(true); mHeadsUpManager.unpinAll(true /* userUnpinned */); mMetricsLogger.count("panel_open", 1); } else if (!mQsController.getExpanded() - && !mNotificationPanelViewController.isExpanding()) { + && !mShadeViewController.isExpanding()) { mQsController.flingQs(0 /* velocity */, - NotificationPanelViewController.FLING_EXPAND); + ShadeViewController.FLING_EXPAND); mMetricsLogger.count("panel_open_qs", 1); } } @@ -355,7 +355,7 @@ public class CentralSurfacesCommandQueueCallbacks implements CommandQueue.Callba return; } if (!mCameraLauncherLazy.get().canCameraGestureBeLaunched( - mNotificationPanelViewController.getBarState())) { + mShadeViewController.getBarState())) { if (CentralSurfaces.DEBUG_CAMERA_LIFT) { Slog.d(CentralSurfaces.TAG, "Can't launch camera right now"); } @@ -394,7 +394,7 @@ public class CentralSurfacesCommandQueueCallbacks implements CommandQueue.Callba mStatusBarKeyguardViewManager.reset(true /* hide */); } mCameraLauncherLazy.get().launchCamera(source, - mNotificationPanelViewController.isFullyCollapsed()); + mShadeViewController.isFullyCollapsed()); mCentralSurfaces.updateScrimController(); } else { // We need to defer the camera launch until the screen comes on, since otherwise diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java index b36a1b21961f..fab334c5ebc4 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java @@ -193,6 +193,8 @@ import com.android.systemui.shade.ShadeExpansionChangeEvent; import com.android.systemui.shade.ShadeExpansionStateManager; import com.android.systemui.shared.recents.utilities.Utilities; import com.android.systemui.shade.ShadeLogger; +import com.android.systemui.shade.ShadeSurface; +import com.android.systemui.shade.ShadeViewController; import com.android.systemui.statusbar.AutoHideUiElement; import com.android.systemui.statusbar.BackDropView; import com.android.systemui.statusbar.CircleReveal; @@ -505,7 +507,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { /** Controller for the Shade. */ @VisibleForTesting - NotificationPanelViewController mNotificationPanelViewController; + ShadeSurface mShadeSurface; private final ShadeLogger mShadeLogger; // settings @@ -698,9 +700,9 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { @Override public void onBackProgressed(BackEvent event) { if (shouldBackBeHandled()) { - if (mNotificationPanelViewController.canBeCollapsed()) { + if (mShadeSurface.canBeCollapsed()) { float fraction = event.getProgress(); - mNotificationPanelViewController.onBackProgressed(fraction); + mShadeSurface.onBackProgressed(fraction); } } } @@ -1085,7 +1087,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { this, mStatusBarKeyguardViewManager, mNotificationShadeWindowViewController, - mNotificationPanelViewController, + mShadeSurface, mAmbientIndicationContainer); updateLightRevealScrimVisibility(); @@ -1271,7 +1273,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { // re-display the notification panel if necessary (for example, if // a heads-up notification was being displayed and should continue being // displayed). - mNotificationPanelViewController.updateExpansionAndVisibility(); + mShadeSurface.updateExpansionAndVisibility(); setBouncerShowingForStatusBarComponents(mBouncerShowing); checkBarModes(); }); @@ -1346,7 +1348,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { mScreenOffAnimationController.initialize(this, mLightRevealScrim); updateLightRevealScrimVisibility(); - mNotificationPanelViewController.initDependencies( + mShadeSurface.initDependencies( this, mGestureRec, mShadeController::makeExpandedInvisible, @@ -1388,7 +1390,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { .build()); mBrightnessMirrorController = new BrightnessMirrorController( mNotificationShadeWindowView, - mNotificationPanelViewController, + mShadeSurface, mNotificationShadeDepthControllerLazy.get(), mBrightnessSliderFactory, (visible) -> { @@ -1488,7 +1490,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { || !mKeyguardStateController.canDismissLockScreen() || mKeyguardViewMediator.isAnySimPinSecure() || (mQsController.getExpanded() && trackingTouch) - || mNotificationPanelViewController.getBarState() == StatusBarState.SHADE_LOCKED) { + || mShadeSurface.getBarState() == StatusBarState.SHADE_LOCKED) { return; } @@ -1508,8 +1510,8 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { boolean tracking = event.getTracking(); dispatchPanelExpansionForKeyguardDismiss(fraction, tracking); - if (getNotificationPanelViewController() != null) { - getNotificationPanelViewController().updateSystemUiStateFlags(); + if (getShadeViewController() != null) { + getShadeViewController().updateSystemUiStateFlags(); } if (fraction == 0 || fraction == 1) { @@ -1637,9 +1639,10 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { .getNotificationShadeWindowViewController(); mNotificationShadeWindowController.setNotificationShadeView(mNotificationShadeWindowView); mNotificationShadeWindowViewController.setupExpandedStatusBar(); - mNotificationPanelViewController = + NotificationPanelViewController npvc = mCentralSurfacesComponent.getNotificationPanelViewController(); - mShadeController.setNotificationPanelViewController(mNotificationPanelViewController); + mShadeSurface = npvc; + mShadeController.setNotificationPanelViewController(npvc); mShadeController.setNotificationShadeWindowViewController( mNotificationShadeWindowViewController); mCentralSurfacesComponent.getLockIconViewController().init(); @@ -1705,7 +1708,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { }); mKeyguardViewMediator.registerCentralSurfaces( /* statusBar= */ this, - mNotificationPanelViewController, + mShadeSurface, mShadeExpansionStateManager, mBiometricUnlockController, mStackScroller, @@ -1733,8 +1736,8 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { } @Override - public NotificationPanelViewController getNotificationPanelViewController() { - return mNotificationPanelViewController; + public ShadeViewController getShadeViewController() { + return mShadeSurface; } @Override @@ -2091,16 +2094,16 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { } if (start) { - mNotificationPanelViewController.startWaitingForExpandGesture(); + mShadeSurface.startWaitingForExpandGesture(); } else { - mNotificationPanelViewController.stopWaitingForExpandGesture(cancel, velocity); + mShadeSurface.stopWaitingForExpandGesture(cancel, velocity); } } @Override public void animateCollapseQuickSettings() { if (mState == StatusBarState.SHADE) { - mNotificationPanelViewController.collapse( + mShadeSurface.collapse( true, false /* delayed */, 1.0f /* speedUpFactor */); } } @@ -2751,8 +2754,8 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { mStatusBarWindowController.refreshStatusBarHeight(); } - if (mNotificationPanelViewController != null) { - mNotificationPanelViewController.updateResources(); + if (mShadeSurface != null) { + mShadeSurface.updateResources(); } if (mBrightnessMirrorController != null) { mBrightnessMirrorController.updateResources(); @@ -3010,7 +3013,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { public void showKeyguardImpl() { Trace.beginSection("CentralSurfaces#showKeyguard"); if (mKeyguardStateController.isLaunchTransitionFadingAway()) { - mNotificationPanelViewController.cancelAnimation(); + mShadeSurface.cancelAnimation(); onLaunchTransitionFadingEnded(); } mMessageRouter.cancelMessages(MSG_LAUNCH_TRANSITION_TIMEOUT); @@ -3029,7 +3032,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { } private void onLaunchTransitionFadingEnded() { - mNotificationPanelViewController.resetAlpha(); + mShadeSurface.resetAlpha(); mCameraLauncherLazy.get().setLaunchingAffordance(false); releaseGestureWakeLock(); runLaunchTransitionEndRunnable(); @@ -3059,8 +3062,8 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { } updateScrimController(); mPresenter.updateMediaMetaData(false, true); - mNotificationPanelViewController.resetAlpha(); - mNotificationPanelViewController.fadeOut( + mShadeSurface.resetAlpha(); + mShadeSurface.fadeOut( FADE_KEYGUARD_START_DELAY, FADE_KEYGUARD_DURATION, this::onLaunchTransitionFadingEnded); mCommandQueue.appTransitionStarting(mDisplayId, SystemClock.uptimeMillis(), @@ -3092,7 +3095,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { Log.w(TAG, "Launch transition: Timeout!"); mCameraLauncherLazy.get().setLaunchingAffordance(false); releaseGestureWakeLock(); - mNotificationPanelViewController.resetViews(false /* animate */); + mShadeSurface.resetViews(false /* animate */); } private void runLaunchTransitionEndRunnable() { @@ -3132,7 +3135,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { // Disable layout transitions in navbar for this transition because the load is just // too heavy for the CPU and GPU on any device. mNavigationBarController.disableAnimationsDuringHide(mDisplayId, delay); - } else if (!mNotificationPanelViewController.isCollapsing()) { + } else if (!mShadeSurface.isCollapsing()) { mShadeController.instantCollapseShade(); } @@ -3144,9 +3147,9 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { mMessageRouter.cancelMessages(MSG_LAUNCH_TRANSITION_TIMEOUT); releaseGestureWakeLock(); mCameraLauncherLazy.get().setLaunchingAffordance(false); - mNotificationPanelViewController.resetAlpha(); - mNotificationPanelViewController.resetTranslation(); - mNotificationPanelViewController.resetViewGroupFade(); + mShadeSurface.resetAlpha(); + mShadeSurface.resetTranslation(); + mShadeSurface.resetViewGroupFade(); updateDozingState(); updateScrimController(); Trace.endSection(); @@ -3248,7 +3251,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { boolean animate = (!mDozing && shouldAnimateDozeWakeup()) || (mDozing && mDozeParameters.shouldControlScreenOff() && keyguardVisibleOrWillBe); - mNotificationPanelViewController.setDozing(mDozing, animate); + mShadeSurface.setDozing(mDozing, animate); updateQsExpansionEnabled(); Trace.endSection(); } @@ -3328,16 +3331,16 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { return true; } if (mQsController.getExpanded()) { - mNotificationPanelViewController.animateCollapseQs(false); + mShadeSurface.animateCollapseQs(false); return true; } - if (mNotificationPanelViewController.closeUserSwitcherIfOpen()) { + if (mShadeSurface.closeUserSwitcherIfOpen()) { return true; } if (shouldBackBeHandled()) { - if (mNotificationPanelViewController.canBeCollapsed()) { + if (mShadeSurface.canBeCollapsed()) { // this is the Shade dismiss animation, so make sure QQS closes when it ends. - mNotificationPanelViewController.onBackPressed(); + mShadeSurface.onBackPressed(); mShadeController.animateCollapseShade(); } return true; @@ -3513,8 +3516,8 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { if (mPhoneStatusBarViewController != null) { mPhoneStatusBarViewController.setImportantForAccessibility(importance); } - mNotificationPanelViewController.setImportantForAccessibility(importance); - mNotificationPanelViewController.setBouncerShowing(bouncerShowing); + mShadeSurface.setImportantForAccessibility(importance); + mShadeSurface.setBouncerShowing(bouncerShowing); } /** @@ -3522,7 +3525,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { */ @Override public void collapseShade() { - if (mNotificationPanelViewController.isTracking()) { + if (mShadeSurface.isTracking()) { mNotificationShadeWindowViewController.cancelCurrentTouch(); } if (mPanelExpanded && mState == StatusBarState.SHADE) { @@ -3626,7 +3629,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { } } - mNotificationPanelViewController.setWillPlayDelayedDozeAmountAnimation( + mShadeSurface.setWillPlayDelayedDozeAmountAnimation( mShouldDelayWakeUpAnimation); mWakeUpCoordinator.setWakingUp( /* wakingUp= */ true, @@ -3668,12 +3671,12 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { // So if AOD is off or unsupported we need to trigger these updates at screen on // when the keyguard is occluded. mLockscreenUserManager.updatePublicMode(); - mNotificationPanelViewController.getNotificationStackScrollLayoutController() + mShadeSurface.getNotificationStackScrollLayoutController() .updateSensitivenessForOccludedWakeup(); } if (mLaunchCameraWhenFinishedWaking) { mCameraLauncherLazy.get().launchCamera(mLastCameraLaunchSource, - mNotificationPanelViewController.isFullyCollapsed()); + mShadeSurface.isFullyCollapsed()); mLaunchCameraWhenFinishedWaking = false; } if (mLaunchEmergencyActionWhenFinishedWaking) { @@ -3704,7 +3707,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { !mDozeParameters.shouldControlScreenOff(), !mDeviceInteractive, !mDozeServiceHost.isPulsing(), mDeviceProvisionedController.isFrpActive()); - mNotificationPanelViewController.setTouchAndAnimationDisabled(disabled); + mShadeSurface.setTouchAndAnimationDisabled(disabled); mNotificationIconAreaController.setAnimationsEnabled(!disabled); } @@ -3712,7 +3715,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { @Override public void onScreenTurningOn() { mFalsingCollector.onScreenTurningOn(); - mNotificationPanelViewController.onScreenTurningOn(); + mShadeSurface.onScreenTurningOn(); } @Override @@ -4356,7 +4359,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { } // We need the new R.id.keyguard_indication_area before recreating // mKeyguardIndicationController - mNotificationPanelViewController.onThemeChanged(); + mShadeSurface.onThemeChanged(); if (mStatusBarKeyguardViewManager != null) { mStatusBarKeyguardViewManager.onThemeChanged(); @@ -4402,7 +4405,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { mNavigationBarController.touchAutoDim(mDisplayId); Trace.beginSection("CentralSurfaces#updateKeyguardState"); if (mState == StatusBarState.KEYGUARD) { - mNotificationPanelViewController.cancelPendingCollapse(); + mShadeSurface.cancelPendingCollapse(); } updateDozingState(); checkBarModes(); @@ -4428,7 +4431,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { && mDozeParameters.shouldControlScreenOff(); // resetting views is already done when going into doze, there's no need to // reset them again when we're waking up - mNotificationPanelViewController.resetViews(dozingAnimated && isDozing); + mShadeSurface.resetViews(dozingAnimated && isDozing); updateQsExpansionEnabled(); mKeyguardViewMediator.setDozing(mDozing); 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 5196e10df450..89c3946939a2 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/DozeServiceHost.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/DozeServiceHost.java @@ -37,8 +37,8 @@ import com.android.systemui.doze.DozeHost; import com.android.systemui.doze.DozeLog; import com.android.systemui.doze.DozeReceiver; import com.android.systemui.keyguard.WakefulnessLifecycle; -import com.android.systemui.shade.NotificationPanelViewController; import com.android.systemui.shade.NotificationShadeWindowViewController; +import com.android.systemui.shade.ShadeViewController; import com.android.systemui.statusbar.NotificationShadeWindowController; import com.android.systemui.statusbar.PulseExpansionHandler; import com.android.systemui.statusbar.StatusBarState; @@ -50,12 +50,12 @@ import com.android.systemui.statusbar.policy.DeviceProvisionedController; import com.android.systemui.statusbar.policy.OnHeadsUpChangedListener; import com.android.systemui.util.Assert; +import dagger.Lazy; + import java.util.ArrayList; import javax.inject.Inject; -import dagger.Lazy; - /** * Implementation of DozeHost for SystemUI. */ @@ -90,7 +90,7 @@ public final class DozeServiceHost implements DozeHost { private final AuthController mAuthController; private final NotificationIconAreaController mNotificationIconAreaController; private StatusBarKeyguardViewManager mStatusBarKeyguardViewManager; - private NotificationPanelViewController mNotificationPanel; + private ShadeViewController mNotificationPanel; private View mAmbientIndicationContainer; private CentralSurfaces mCentralSurfaces; private boolean mAlwaysOnSuppressed; @@ -141,7 +141,7 @@ public final class DozeServiceHost implements DozeHost { CentralSurfaces centralSurfaces, StatusBarKeyguardViewManager statusBarKeyguardViewManager, NotificationShadeWindowViewController notificationShadeWindowViewController, - NotificationPanelViewController notificationPanel, + ShadeViewController notificationPanel, View ambientIndicationContainer) { mCentralSurfaces = centralSurfaces; mStatusBarKeyguardViewManager = statusBarKeyguardViewManager; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpAppearanceController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpAppearanceController.java index 171e3d0a864e..e705afc21c40 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpAppearanceController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpAppearanceController.java @@ -31,8 +31,8 @@ import com.android.systemui.flags.FeatureFlags; import com.android.systemui.flags.Flags; import com.android.systemui.plugins.DarkIconDispatcher; import com.android.systemui.plugins.statusbar.StatusBarStateController; -import com.android.systemui.shade.NotificationPanelViewController; import com.android.systemui.shade.ShadeHeadsUpTracker; +import com.android.systemui.shade.ShadeViewController; import com.android.systemui.statusbar.CommandQueue; import com.android.systemui.statusbar.CrossFadeHelper; import com.android.systemui.statusbar.HeadsUpStatusBarView; @@ -76,7 +76,7 @@ public class HeadsUpAppearanceController extends ViewController<HeadsUpStatusBar private final NotificationStackScrollLayoutController mStackScrollerController; private final DarkIconDispatcher mDarkIconDispatcher; - private final NotificationPanelViewController mNotificationPanelViewController; + private final ShadeViewController mShadeViewController; private final NotificationRoundnessManager mNotificationRoundnessManager; private final boolean mUseRoundnessSourceTypes; private final Consumer<ExpandableNotificationRow> @@ -118,7 +118,7 @@ public class HeadsUpAppearanceController extends ViewController<HeadsUpStatusBar KeyguardStateController keyguardStateController, CommandQueue commandQueue, NotificationStackScrollLayoutController stackScrollerController, - NotificationPanelViewController notificationPanelViewController, + ShadeViewController shadeViewController, NotificationRoundnessManager notificationRoundnessManager, FeatureFlags featureFlags, HeadsUpStatusBarView headsUpStatusBarView, @@ -134,13 +134,13 @@ public class HeadsUpAppearanceController extends ViewController<HeadsUpStatusBar // has started pulling down the notification shade from the HUN and then the font size // changes). We need to re-fetch these values since they're used to correctly display the // HUN during this shade expansion. - mTrackedChild = notificationPanelViewController.getShadeHeadsUpTracker() + mTrackedChild = shadeViewController.getShadeHeadsUpTracker() .getTrackedHeadsUpNotification(); mAppearFraction = stackScrollerController.getAppearFraction(); mExpandedHeight = stackScrollerController.getExpandedHeight(); mStackScrollerController = stackScrollerController; - mNotificationPanelViewController = notificationPanelViewController; + mShadeViewController = shadeViewController; mStackScrollerController.setHeadsUpAppearanceController(this); mClockView = clockView; mOperatorNameViewOptional = operatorNameViewOptional; @@ -179,7 +179,7 @@ public class HeadsUpAppearanceController extends ViewController<HeadsUpStatusBar } private ShadeHeadsUpTracker getShadeHeadsUpTracker() { - return mNotificationPanelViewController.getShadeHeadsUpTracker(); + return mShadeViewController.getShadeHeadsUpTracker(); } @Override diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithm.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithm.java index c163a8940baa..90a6d0fac7ca 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithm.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithm.java @@ -27,7 +27,7 @@ import com.android.keyguard.BouncerPanelExpansionCalculator; import com.android.keyguard.KeyguardStatusView; import com.android.systemui.R; import com.android.systemui.animation.Interpolators; -import com.android.systemui.shade.NotificationPanelViewController; +import com.android.systemui.shade.ShadeViewController; import com.android.systemui.statusbar.policy.KeyguardUserSwitcherListView; /** @@ -84,7 +84,7 @@ public class KeyguardClockPositionAlgorithm { private int mSplitShadeTargetTopMargin; /** - * @see NotificationPanelViewController#getExpandedFraction() + * @see ShadeViewController#getExpandedFraction() */ private float mPanelExpansion; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarViewController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarViewController.java index 2814e8d8f97b..e835c5cebbc3 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarViewController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarViewController.java @@ -47,7 +47,7 @@ import com.android.systemui.battery.BatteryMeterViewController; import com.android.systemui.dagger.qualifiers.Main; import com.android.systemui.plugins.log.LogLevel; import com.android.systemui.plugins.statusbar.StatusBarStateController; -import com.android.systemui.shade.NotificationPanelViewController; +import com.android.systemui.shade.ShadeViewStateProvider; import com.android.systemui.statusbar.CommandQueue; import com.android.systemui.statusbar.NotificationMediaManager; import com.android.systemui.statusbar.StatusBarState; @@ -69,6 +69,8 @@ import com.android.systemui.user.ui.viewmodel.StatusBarUserChipViewModel; import com.android.systemui.util.ViewController; import com.android.systemui.util.settings.SecureSettings; +import kotlin.Unit; + import java.io.PrintWriter; import java.util.ArrayList; import java.util.List; @@ -76,8 +78,6 @@ import java.util.concurrent.Executor; import javax.inject.Inject; -import kotlin.Unit; - /** View Controller for {@link com.android.systemui.statusbar.phone.KeyguardStatusBarView}. */ public class KeyguardStatusBarViewController extends ViewController<KeyguardStatusBarView> { private static final String TAG = "KeyguardStatusBarViewController"; @@ -104,8 +104,7 @@ public class KeyguardStatusBarViewController extends ViewController<KeyguardStat private final StatusBarIconController mStatusBarIconController; private final StatusBarIconController.TintedIconManager.Factory mTintedIconManagerFactory; private final BatteryMeterViewController mBatteryMeterViewController; - private final NotificationPanelViewController.NotificationPanelViewStateProvider - mNotificationPanelViewStateProvider; + private final ShadeViewStateProvider mShadeViewStateProvider; private final KeyguardStateController mKeyguardStateController; private final KeyguardBypassController mKeyguardBypassController; private final KeyguardUpdateMonitor mKeyguardUpdateMonitor; @@ -274,8 +273,7 @@ public class KeyguardStatusBarViewController extends ViewController<KeyguardStat StatusBarIconController statusBarIconController, StatusBarIconController.TintedIconManager.Factory tintedIconManagerFactory, BatteryMeterViewController batteryMeterViewController, - NotificationPanelViewController.NotificationPanelViewStateProvider - notificationPanelViewStateProvider, + ShadeViewStateProvider shadeViewStateProvider, KeyguardStateController keyguardStateController, KeyguardBypassController bypassController, KeyguardUpdateMonitor keyguardUpdateMonitor, @@ -299,7 +297,7 @@ public class KeyguardStatusBarViewController extends ViewController<KeyguardStat mStatusBarIconController = statusBarIconController; mTintedIconManagerFactory = tintedIconManagerFactory; mBatteryMeterViewController = batteryMeterViewController; - mNotificationPanelViewStateProvider = notificationPanelViewStateProvider; + mShadeViewStateProvider = shadeViewStateProvider; mKeyguardStateController = keyguardStateController; mKeyguardBypassController = bypassController; mKeyguardUpdateMonitor = keyguardUpdateMonitor; @@ -470,7 +468,7 @@ public class KeyguardStatusBarViewController extends ViewController<KeyguardStat /** * Updates the {@link KeyguardStatusBarView} state based on what the - * {@link NotificationPanelViewController.NotificationPanelViewStateProvider} and other + * {@link ShadeViewController.NotificationPanelViewStateProvider} and other * controllers provide. */ public void updateViewState() { @@ -479,7 +477,7 @@ public class KeyguardStatusBarViewController extends ViewController<KeyguardStat } float alphaQsExpansion = 1 - Math.min( - 1, mNotificationPanelViewStateProvider.getLockscreenShadeDragProgress() * 2); + 1, mShadeViewStateProvider.getLockscreenShadeDragProgress() * 2); float newAlpha; if (mExplicitAlpha != -1) { @@ -530,12 +528,12 @@ public class KeyguardStatusBarViewController extends ViewController<KeyguardStat if (isKeyguardShowing()) { // When on Keyguard, we hide the header as soon as we expanded close enough to the // header - alpha = mNotificationPanelViewStateProvider.getPanelViewExpandedHeight() + alpha = mShadeViewStateProvider.getPanelViewExpandedHeight() / (mView.getHeight() + mNotificationsHeaderCollideDistance); } else { // In SHADE_LOCKED, the top card is already really close to the header. Hide it as // soon as we start translating the stack. - alpha = mNotificationPanelViewStateProvider.getPanelViewExpandedHeight() + alpha = mShadeViewStateProvider.getPanelViewExpandedHeight() / mView.getHeight(); } alpha = MathUtils.saturate(alpha); @@ -585,7 +583,7 @@ public class KeyguardStatusBarViewController extends ViewController<KeyguardStat void updateForHeadsUp(boolean animate) { boolean showingKeyguardHeadsUp = - isKeyguardShowing() && mNotificationPanelViewStateProvider.shouldHeadsUpBeVisible(); + isKeyguardShowing() && mShadeViewStateProvider.shouldHeadsUpBeVisible(); if (mShowingKeyguardHeadsUp != showingKeyguardHeadsUp) { mShowingKeyguardHeadsUp = showingKeyguardHeadsUp; if (isKeyguardShowing()) { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarViewController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarViewController.kt index 62d302f2a592..e6cb68ff17a9 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarViewController.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarViewController.kt @@ -165,19 +165,19 @@ class PhoneStatusBarViewController private constructor( if (event.action == MotionEvent.ACTION_DOWN) { // If the view that would receive the touch is disabled, just have status // bar eat the gesture. - if (!centralSurfaces.notificationPanelViewController.isViewEnabled) { + if (!centralSurfaces.shadeViewController.isViewEnabled) { shadeLogger.logMotionEvent(event, "onTouchForwardedFromStatusBar: panel view disabled") return true } - if (centralSurfaces.notificationPanelViewController.isFullyCollapsed && + if (centralSurfaces.shadeViewController.isFullyCollapsed && event.y < 1f) { // b/235889526 Eat events on the top edge of the phone when collapsed shadeLogger.logMotionEvent(event, "top edge touch ignored") return true } } - return centralSurfaces.notificationPanelViewController.handleExternalTouch(event) + return centralSurfaces.shadeViewController.handleExternalTouch(event) } } 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 d3aa4bf33d04..51c56a021825 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java @@ -64,7 +64,7 @@ import com.android.systemui.keyguard.shared.model.TransitionState; import com.android.systemui.keyguard.shared.model.TransitionStep; import com.android.systemui.keyguard.ui.viewmodel.PrimaryBouncerToGoneTransitionViewModel; import com.android.systemui.scrim.ScrimView; -import com.android.systemui.shade.NotificationPanelViewController; +import com.android.systemui.shade.ShadeViewController; import com.android.systemui.shade.transition.LargeScreenShadeInterpolator; import com.android.systemui.statusbar.notification.stack.ViewState; import com.android.systemui.statusbar.policy.ConfigurationController; @@ -649,7 +649,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump calculateAndUpdatePanelExpansion(); } - /** See {@link NotificationPanelViewController#setPanelScrimMinFraction(float)}. */ + /** See {@link ShadeViewController#setPanelScrimMinFraction(float)}. */ public void setPanelScrimMinFraction(float minFraction) { if (isNaN(minFraction)) { throw new IllegalArgumentException("minFraction should not be NaN"); 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 a7413d58a6cb..481cf3ceb197 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeadsUpChangeListener.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeadsUpChangeListener.java @@ -17,7 +17,7 @@ package com.android.systemui.statusbar.phone; import com.android.systemui.plugins.statusbar.StatusBarStateController; -import com.android.systemui.shade.NotificationPanelViewController; +import com.android.systemui.shade.ShadeViewController; import com.android.systemui.statusbar.NotificationRemoteInputManager; import com.android.systemui.statusbar.NotificationShadeWindowController; import com.android.systemui.statusbar.StatusBarState; @@ -34,7 +34,7 @@ import javax.inject.Inject; public class StatusBarHeadsUpChangeListener implements OnHeadsUpChangedListener { private final NotificationShadeWindowController mNotificationShadeWindowController; private final StatusBarWindowController mStatusBarWindowController; - private final NotificationPanelViewController mNotificationPanelViewController; + private final ShadeViewController mShadeViewController; private final KeyguardBypassController mKeyguardBypassController; private final HeadsUpManagerPhone mHeadsUpManager; private final StatusBarStateController mStatusBarStateController; @@ -44,7 +44,7 @@ public class StatusBarHeadsUpChangeListener implements OnHeadsUpChangedListener StatusBarHeadsUpChangeListener( NotificationShadeWindowController notificationShadeWindowController, StatusBarWindowController statusBarWindowController, - NotificationPanelViewController notificationPanelViewController, + ShadeViewController shadeViewController, KeyguardBypassController keyguardBypassController, HeadsUpManagerPhone headsUpManager, StatusBarStateController statusBarStateController, @@ -52,7 +52,7 @@ public class StatusBarHeadsUpChangeListener implements OnHeadsUpChangedListener mNotificationShadeWindowController = notificationShadeWindowController; mStatusBarWindowController = statusBarWindowController; - mNotificationPanelViewController = notificationPanelViewController; + mShadeViewController = shadeViewController; mKeyguardBypassController = keyguardBypassController; mHeadsUpManager = headsUpManager; mStatusBarStateController = statusBarStateController; @@ -64,14 +64,14 @@ public class StatusBarHeadsUpChangeListener implements OnHeadsUpChangedListener if (inPinnedMode) { mNotificationShadeWindowController.setHeadsUpShowing(true); mStatusBarWindowController.setForceStatusBarVisible(true); - if (mNotificationPanelViewController.isFullyCollapsed()) { - mNotificationPanelViewController.updateTouchableRegion(); + if (mShadeViewController.isFullyCollapsed()) { + mShadeViewController.updateTouchableRegion(); } } else { boolean bypassKeyguard = mKeyguardBypassController.getBypassEnabled() && mStatusBarStateController.getState() == StatusBarState.KEYGUARD; - if (!mNotificationPanelViewController.isFullyCollapsed() - || mNotificationPanelViewController.isTracking() + if (!mShadeViewController.isFullyCollapsed() + || mShadeViewController.isTracking() || bypassKeyguard) { // We are currently tracking or is open and the shade doesn't need to //be kept @@ -85,7 +85,7 @@ public class StatusBarHeadsUpChangeListener implements OnHeadsUpChangedListener //animation // is finished. mHeadsUpManager.setHeadsUpGoingAway(true); - mNotificationPanelViewController.getNotificationStackScrollLayoutController() + mShadeViewController.getNotificationStackScrollLayoutController() .runAfterAnimationFinished(() -> { if (!mHeadsUpManager.hasPinnedHeadsUp()) { mNotificationShadeWindowController.setHeadsUpShowing(false); 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 70aab61ffed0..f7646d718dc6 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java @@ -69,11 +69,11 @@ import com.android.systemui.navigationbar.NavigationBarView; import com.android.systemui.navigationbar.NavigationModeController; import com.android.systemui.navigationbar.TaskbarDelegate; import com.android.systemui.plugins.statusbar.StatusBarStateController; -import com.android.systemui.shade.NotificationPanelViewController; import com.android.systemui.shade.ShadeController; import com.android.systemui.shade.ShadeExpansionChangeEvent; import com.android.systemui.shade.ShadeExpansionListener; import com.android.systemui.shade.ShadeExpansionStateManager; +import com.android.systemui.shade.ShadeViewController; import com.android.systemui.shared.system.QuickStepContract; import com.android.systemui.shared.system.SysUiStatsLog; import com.android.systemui.statusbar.NotificationMediaManager; @@ -251,7 +251,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb protected LockPatternUtils mLockPatternUtils; protected ViewMediatorCallback mViewMediatorCallback; @Nullable protected CentralSurfaces mCentralSurfaces; - private NotificationPanelViewController mNotificationPanelViewController; + private ShadeViewController mShadeViewController; private BiometricUnlockController mBiometricUnlockController; private boolean mCentralSurfacesRegistered; @@ -371,7 +371,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb @Override public void registerCentralSurfaces(CentralSurfaces centralSurfaces, - NotificationPanelViewController notificationPanelViewController, + ShadeViewController shadeViewController, ShadeExpansionStateManager shadeExpansionStateManager, BiometricUnlockController biometricUnlockController, View notificationContainer, @@ -380,7 +380,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb mBiometricUnlockController = biometricUnlockController; mPrimaryBouncerCallbackInteractor.addBouncerExpansionCallback(mExpansionCallback); - mNotificationPanelViewController = notificationPanelViewController; + mShadeViewController = shadeViewController; if (shadeExpansionStateManager != null) { shadeExpansionStateManager.addExpansionListener(this); } @@ -482,8 +482,8 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb // Avoid having the shade and the bouncer open at the same time over a dream. final boolean hideBouncerOverDream = mDreamOverlayStateController.isOverlayActive() - && (mNotificationPanelViewController.isExpanded() - || mNotificationPanelViewController.isExpanding()); + && (mShadeViewController.isExpanded() + || mShadeViewController.isExpanding()); final boolean isUserTrackingStarted = event.getFraction() != EXPANSION_HIDDEN && event.getTracking(); @@ -495,7 +495,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb && !mKeyguardStateController.isOccluded() && !mKeyguardStateController.canDismissLockScreen() && !bouncerIsAnimatingAway() - && !mNotificationPanelViewController.isUnlockHintRunning() + && !mShadeViewController.isUnlockHintRunning() && !(mStatusBarStateController.getState() == StatusBarState.SHADE_LOCKED); } @@ -699,7 +699,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb if (mKeyguardStateController.isShowing()) { final boolean isOccluded = mKeyguardStateController.isOccluded(); // Hide quick settings. - mNotificationPanelViewController.resetViews(/* animate= */ !isOccluded); + mShadeViewController.resetViews(/* animate= */ !isOccluded); // Hide bouncer and quick-quick settings. if (isOccluded && !mDozing) { mCentralSurfaces.hideKeyguard(); @@ -862,7 +862,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb public void startPreHideAnimation(Runnable finishRunnable) { if (primaryBouncerIsShowing()) { mPrimaryBouncerInteractor.startDisappearAnimation(finishRunnable); - mNotificationPanelViewController.startBouncerPreHideAnimation(); + mShadeViewController.startBouncerPreHideAnimation(); // 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 @@ -873,12 +873,12 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb } else if (finishRunnable != null) { finishRunnable.run(); } - mNotificationPanelViewController.blockExpansionForCurrentTouch(); + mShadeViewController.blockExpansionForCurrentTouch(); } @Override public void blockPanelExpansionFromCurrentTouch() { - mNotificationPanelViewController.blockExpansionForCurrentTouch(); + mShadeViewController.blockExpansionForCurrentTouch(); } @Override @@ -975,7 +975,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb public void onKeyguardFadedAway() { mNotificationContainer.postDelayed(() -> mNotificationShadeWindowController .setKeyguardFadingAway(false), 100); - mNotificationPanelViewController.resetViewGroupFade(); + mShadeViewController.resetViewGroupFade(); mCentralSurfaces.finishKeyguardFadingAway(); mBiometricUnlockController.finishKeyguardFadingAway(); WindowManagerGlobal.getInstance().trimMemory( @@ -1050,7 +1050,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb if (hideImmediately) { mStatusBarStateController.setLeaveOpenOnKeyguardHide(false); } else { - mNotificationPanelViewController.expandToNotifications(); + mShadeViewController.expandToNotifications(); } } return; 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 b1642d6addb6..9f69db93e64a 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarLaunchAnimatorController.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarLaunchAnimatorController.kt @@ -21,7 +21,7 @@ class StatusBarLaunchAnimatorController( override fun onIntentStarted(willAnimate: Boolean) { delegate.onIntentStarted(willAnimate) if (willAnimate) { - centralSurfaces.notificationPanelViewController.setIsLaunchAnimationRunning(true) + centralSurfaces.shadeViewController.setIsLaunchAnimationRunning(true) } else { centralSurfaces.collapsePanelOnMainThread() } @@ -29,16 +29,16 @@ class StatusBarLaunchAnimatorController( override fun onLaunchAnimationStart(isExpandingFullyAbove: Boolean) { delegate.onLaunchAnimationStart(isExpandingFullyAbove) - centralSurfaces.notificationPanelViewController.setIsLaunchAnimationRunning(true) + centralSurfaces.shadeViewController.setIsLaunchAnimationRunning(true) if (!isExpandingFullyAbove) { - centralSurfaces.notificationPanelViewController.collapseWithDuration( + centralSurfaces.shadeViewController.collapseWithDuration( ActivityLaunchAnimator.TIMINGS.totalDuration.toInt()) } } override fun onLaunchAnimationEnd(isExpandingFullyAbove: Boolean) { delegate.onLaunchAnimationEnd(isExpandingFullyAbove) - centralSurfaces.notificationPanelViewController.setIsLaunchAnimationRunning(false) + centralSurfaces.shadeViewController.setIsLaunchAnimationRunning(false) centralSurfaces.onLaunchAnimationEnd(isExpandingFullyAbove) } @@ -48,12 +48,12 @@ class StatusBarLaunchAnimatorController( linearProgress: Float ) { delegate.onLaunchAnimationProgress(state, progress, linearProgress) - centralSurfaces.notificationPanelViewController.applyLaunchAnimationProgress(linearProgress) + centralSurfaces.shadeViewController.applyLaunchAnimationProgress(linearProgress) } override fun onLaunchAnimationCancelled(newKeyguardOccludedState: Boolean?) { delegate.onLaunchAnimationCancelled() - centralSurfaces.notificationPanelViewController.setIsLaunchAnimationRunning(false) + centralSurfaces.shadeViewController.setIsLaunchAnimationRunning(false) 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 c623201b2a6b..bd5815aa240f 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarNotificationActivityStarter.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarNotificationActivityStarter.java @@ -55,11 +55,10 @@ import com.android.systemui.EventLogTags; import com.android.systemui.animation.ActivityLaunchAnimator; import com.android.systemui.assist.AssistManager; import com.android.systemui.flags.FeatureFlags; -import com.android.systemui.flags.Flags; import com.android.systemui.plugins.ActivityStarter; import com.android.systemui.settings.UserTracker; -import com.android.systemui.shade.NotificationPanelViewController; import com.android.systemui.shade.ShadeController; +import com.android.systemui.shade.ShadeViewController; import com.android.systemui.statusbar.NotificationClickNotifier; import com.android.systemui.statusbar.NotificationLockscreenUserManager; import com.android.systemui.statusbar.NotificationPresenter; @@ -122,7 +121,7 @@ class StatusBarNotificationActivityStarter implements NotificationActivityStarte private final CentralSurfaces mCentralSurfaces; private final NotificationPresenter mPresenter; - private final NotificationPanelViewController mNotificationPanel; + private final ShadeViewController mNotificationPanel; private final ActivityLaunchAnimator mActivityLaunchAnimator; private final NotificationLaunchAnimatorControllerProvider mNotificationAnimationProvider; private final UserTracker mUserTracker; @@ -157,7 +156,7 @@ class StatusBarNotificationActivityStarter implements NotificationActivityStarte OnUserInteractionCallback onUserInteractionCallback, CentralSurfaces centralSurfaces, NotificationPresenter presenter, - NotificationPanelViewController panel, + ShadeViewController panel, ActivityLaunchAnimator activityLaunchAnimator, NotificationLaunchAnimatorControllerProvider notificationAnimationProvider, LaunchFullScreenIntentProvider launchFullScreenIntentProvider, 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 7fc09961c6c6..dfaee4c674ad 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarNotificationPresenter.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarNotificationPresenter.java @@ -36,9 +36,9 @@ import com.android.systemui.InitController; import com.android.systemui.R; import com.android.systemui.plugins.ActivityStarter; import com.android.systemui.plugins.ActivityStarter.OnDismissAction; -import com.android.systemui.shade.NotificationPanelViewController; import com.android.systemui.shade.NotificationShadeWindowView; import com.android.systemui.shade.QuickSettingsController; +import com.android.systemui.shade.ShadeViewController; import com.android.systemui.statusbar.CommandQueue; import com.android.systemui.statusbar.KeyguardIndicationController; import com.android.systemui.statusbar.LockscreenShadeTransitionController; @@ -82,7 +82,7 @@ class StatusBarNotificationPresenter implements NotificationPresenter, private final NotificationMediaManager mMediaManager; private final NotificationGutsManager mGutsManager; - private final NotificationPanelViewController mNotificationPanel; + private final ShadeViewController mNotificationPanel; private final HeadsUpManagerPhone mHeadsUpManager; private final AboveShelfObserver mAboveShelfObserver; private final DozeScrimController mDozeScrimController; @@ -105,7 +105,7 @@ class StatusBarNotificationPresenter implements NotificationPresenter, @Inject StatusBarNotificationPresenter( Context context, - NotificationPanelViewController panel, + ShadeViewController panel, QuickSettingsController quickSettingsController, HeadsUpManagerPhone headsUp, NotificationShadeWindowView statusBarWindow, 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 0cd3401ae541..8fa803ea3a8f 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/UnlockedScreenOffAnimationController.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/UnlockedScreenOffAnimationController.kt @@ -277,7 +277,7 @@ class UnlockedScreenOffAnimationController @Inject constructor( // Show AOD. That'll cause the KeyguardVisibilityHelper to call // #animateInKeyguard. - mCentralSurfaces.notificationPanelViewController.showAodUi() + mCentralSurfaces.shadeViewController.showAodUi() } }, (ANIMATE_IN_KEYGUARD_DELAY * animatorDurationScale).toLong()) @@ -326,7 +326,7 @@ class UnlockedScreenOffAnimationController @Inject constructor( // already expanded and showing notifications/QS, the animation looks really messy. For now, // disable it if the notification panel is expanded. if ((!this::mCentralSurfaces.isInitialized || - mCentralSurfaces.notificationPanelViewController.isPanelExpanded) && + mCentralSurfaces.shadeViewController.isPanelExpanded) && // 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/StatusBarViewModule.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/dagger/StatusBarViewModule.java index b96001ffd74d..015ee7b5682a 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 @@ -21,7 +21,9 @@ import android.content.ContentResolver; import android.os.Handler; import android.view.LayoutInflater; import android.view.ViewStub; + import androidx.constraintlayout.motion.widget.MotionLayout; + import com.android.keyguard.KeyguardUpdateMonitor; import com.android.keyguard.LockIconView; import com.android.systemui.R; @@ -42,6 +44,7 @@ import com.android.systemui.shade.NotificationPanelViewController; import com.android.systemui.shade.NotificationShadeWindowView; import com.android.systemui.shade.NotificationsQuickSettingsContainer; import com.android.systemui.shade.ShadeExpansionStateManager; +import com.android.systemui.shade.ShadeViewController; import com.android.systemui.statusbar.CommandQueue; import com.android.systemui.statusbar.LegacyNotificationShelfControllerImpl; import com.android.systemui.statusbar.NotificationShelf; @@ -74,11 +77,14 @@ import com.android.systemui.statusbar.window.StatusBarWindowStateController; import com.android.systemui.tuner.TunerService; import com.android.systemui.util.CarrierConfigTracker; import com.android.systemui.util.settings.SecureSettings; + import dagger.Binds; import dagger.Module; import dagger.Provides; import dagger.multibindings.IntoSet; + import java.util.concurrent.Executor; + import javax.inject.Named; import javax.inject.Provider; @@ -160,6 +166,12 @@ public abstract class StatusBarViewModule { } /** */ + @Binds + @CentralSurfacesComponent.CentralSurfacesScope + abstract ShadeViewController bindsShadeViewController( + NotificationPanelViewController notificationPanelViewController); + + /** */ @Provides @CentralSurfacesComponent.CentralSurfacesScope public static LockIconView getLockIconView( @@ -298,7 +310,7 @@ public abstract class StatusBarViewModule { StatusBarIconController.DarkIconManager.Factory darkIconManagerFactory, StatusBarHideIconsForBouncerManager statusBarHideIconsForBouncerManager, KeyguardStateController keyguardStateController, - NotificationPanelViewController notificationPanelViewController, + ShadeViewController shadeViewController, StatusBarStateController statusBarStateController, CommandQueue commandQueue, CarrierConfigTracker carrierConfigTracker, @@ -321,7 +333,7 @@ public abstract class StatusBarViewModule { darkIconManagerFactory, statusBarHideIconsForBouncerManager, keyguardStateController, - notificationPanelViewController, + shadeViewController, statusBarStateController, commandQueue, carrierConfigTracker, diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragment.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragment.java index fe639943e191..453dd1bb6f81 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragment.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragment.java @@ -52,8 +52,8 @@ import com.android.systemui.dagger.qualifiers.Main; import com.android.systemui.dump.DumpManager; import com.android.systemui.flags.FeatureFlags; import com.android.systemui.plugins.statusbar.StatusBarStateController; -import com.android.systemui.shade.NotificationPanelViewController; import com.android.systemui.shade.ShadeExpansionStateManager; +import com.android.systemui.shade.ShadeViewController; import com.android.systemui.statusbar.CommandQueue; import com.android.systemui.statusbar.OperatorNameView; import com.android.systemui.statusbar.OperatorNameViewController; @@ -107,7 +107,7 @@ public class CollapsedStatusBarFragment extends Fragment implements CommandQueue private PhoneStatusBarView mStatusBar; private final StatusBarStateController mStatusBarStateController; private final KeyguardStateController mKeyguardStateController; - private final NotificationPanelViewController mNotificationPanelViewController; + private final ShadeViewController mShadeViewController; private LinearLayout mEndSideContent; private View mClockView; private View mOngoingCallChip; @@ -198,7 +198,7 @@ public class CollapsedStatusBarFragment extends Fragment implements CommandQueue StatusBarIconController.DarkIconManager.Factory darkIconManagerFactory, StatusBarHideIconsForBouncerManager statusBarHideIconsForBouncerManager, KeyguardStateController keyguardStateController, - NotificationPanelViewController notificationPanelViewController, + ShadeViewController shadeViewController, StatusBarStateController statusBarStateController, CommandQueue commandQueue, CarrierConfigTracker carrierConfigTracker, @@ -221,7 +221,7 @@ public class CollapsedStatusBarFragment extends Fragment implements CommandQueue mStatusBarHideIconsForBouncerManager = statusBarHideIconsForBouncerManager; mDarkIconManagerFactory = darkIconManagerFactory; mKeyguardStateController = keyguardStateController; - mNotificationPanelViewController = notificationPanelViewController; + mShadeViewController = shadeViewController; mStatusBarStateController = statusBarStateController; mCommandQueue = commandQueue; mCarrierConfigTracker = carrierConfigTracker; @@ -509,7 +509,7 @@ public class CollapsedStatusBarFragment extends Fragment implements CommandQueue private boolean shouldHideNotificationIcons() { if (!mShadeExpansionStateManager.isClosed() - && mNotificationPanelViewController.shouldHideStatusBarIconsWhenExpanded()) { + && mShadeViewController.shouldHideStatusBarIconsWhenExpanded()) { return true; } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/BrightnessMirrorController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/BrightnessMirrorController.java index a4cb99b1b94b..6186c43017b3 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/BrightnessMirrorController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/BrightnessMirrorController.java @@ -28,8 +28,8 @@ import android.widget.FrameLayout; import com.android.systemui.R; import com.android.systemui.settings.brightness.BrightnessSliderController; import com.android.systemui.settings.brightness.ToggleSlider; -import com.android.systemui.shade.NotificationPanelViewController; import com.android.systemui.shade.NotificationShadeWindowView; +import com.android.systemui.shade.ShadeViewController; import com.android.systemui.statusbar.NotificationShadeDepthController; import java.util.Objects; @@ -43,7 +43,7 @@ public class BrightnessMirrorController private final NotificationShadeWindowView mStatusBarWindow; private final Consumer<Boolean> mVisibilityCallback; - private final NotificationPanelViewController mNotificationPanel; + private final ShadeViewController mNotificationPanel; private final NotificationShadeDepthController mDepthController; private final ArraySet<BrightnessMirrorListener> mBrightnessMirrorListeners = new ArraySet<>(); private final BrightnessSliderController.Factory mToggleSliderFactory; @@ -54,7 +54,7 @@ public class BrightnessMirrorController private int mLastBrightnessSliderWidth = -1; public BrightnessMirrorController(NotificationShadeWindowView statusBarWindow, - NotificationPanelViewController notificationPanelViewController, + ShadeViewController shadeViewController, NotificationShadeDepthController notificationShadeDepthController, BrightnessSliderController.Factory factory, @NonNull Consumer<Boolean> visibilityCallback) { @@ -62,7 +62,7 @@ public class BrightnessMirrorController mToggleSliderFactory = factory; mBrightnessMirror = statusBarWindow.findViewById(R.id.brightness_mirror_container); mToggleSliderController = setMirrorLayout(); - mNotificationPanel = notificationPanelViewController; + mNotificationPanel = shadeViewController; mDepthController = notificationShadeDepthController; mNotificationPanel.setAlphaChangeAnimationEndAction(() -> { mBrightnessMirror.setVisibility(View.INVISIBLE); diff --git a/packages/SystemUI/src/com/android/systemui/unfold/FoldAodAnimationController.kt b/packages/SystemUI/src/com/android/systemui/unfold/FoldAodAnimationController.kt index d1bd73a4fa5a..d74906af38da 100644 --- a/packages/SystemUI/src/com/android/systemui/unfold/FoldAodAnimationController.kt +++ b/packages/SystemUI/src/com/android/systemui/unfold/FoldAodAnimationController.kt @@ -39,11 +39,11 @@ import com.android.systemui.unfold.FoldAodAnimationController.FoldAodAnimationSt import com.android.systemui.util.concurrency.DelayableExecutor import com.android.systemui.util.settings.GlobalSettings import dagger.Lazy -import java.util.function.Consumer -import javax.inject.Inject import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Job import kotlinx.coroutines.launch +import java.util.function.Consumer +import javax.inject.Inject /** * Controls folding to AOD animation: when AOD is enabled and foldable device is folded we play a @@ -128,7 +128,7 @@ constructor( } private fun getShadeFoldAnimator(): ShadeFoldAnimator = - centralSurfaces.notificationPanelViewController.shadeFoldAnimator + centralSurfaces.shadeViewController.shadeFoldAnimator private fun setAnimationState(playing: Boolean) { shouldPlayAnimation = playing diff --git a/packages/SystemUI/tests/src/com/android/systemui/dreams/touch/ShadeTouchHandlerTest.java b/packages/SystemUI/tests/src/com/android/systemui/dreams/touch/ShadeTouchHandlerTest.java index 5704ef3f37db..872c0794ce64 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/dreams/touch/ShadeTouchHandlerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/dreams/touch/ShadeTouchHandlerTest.java @@ -28,7 +28,7 @@ import android.view.MotionEvent; import androidx.test.filters.SmallTest; import com.android.systemui.SysuiTestCase; -import com.android.systemui.shade.NotificationPanelViewController; +import com.android.systemui.shade.ShadeViewController; import com.android.systemui.shared.system.InputChannelCompat; import com.android.systemui.statusbar.phone.CentralSurfaces; @@ -49,7 +49,7 @@ public class ShadeTouchHandlerTest extends SysuiTestCase { CentralSurfaces mCentralSurfaces; @Mock - NotificationPanelViewController mNotificationPanelViewController; + ShadeViewController mShadeViewController; @Mock DreamTouchHandler.TouchSession mTouchSession; @@ -63,8 +63,8 @@ public class ShadeTouchHandlerTest extends SysuiTestCase { MockitoAnnotations.initMocks(this); mTouchHandler = new ShadeTouchHandler(Optional.of(mCentralSurfaces), TOUCH_HEIGHT); - when(mCentralSurfaces.getNotificationPanelViewController()) - .thenReturn(mNotificationPanelViewController); + when(mCentralSurfaces.getShadeViewController()) + .thenReturn(mShadeViewController); } /** @@ -97,7 +97,7 @@ public class ShadeTouchHandlerTest extends SysuiTestCase { } /** - * Ensure touches are propagated to the {@link NotificationPanelViewController}. + * Ensure touches are propagated to the {@link ShadeViewController}. */ @Test public void testEventPropagation() { @@ -110,7 +110,7 @@ public class ShadeTouchHandlerTest extends SysuiTestCase { mTouchHandler.onSessionStart(mTouchSession); verify(mTouchSession).registerInputListener(inputEventListenerArgumentCaptor.capture()); inputEventListenerArgumentCaptor.getValue().onInputEvent(motionEvent); - verify(mNotificationPanelViewController).handleExternalTouch(motionEvent); + verify(mShadeViewController).handleExternalTouch(motionEvent); } } 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 932a1f9ca587..d017ffd08a4b 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/LockscreenShadeTransitionControllerTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/LockscreenShadeTransitionControllerTest.kt @@ -13,7 +13,7 @@ import com.android.systemui.keyguard.WakefulnessLifecycle import com.android.systemui.media.controls.ui.MediaHierarchyManager import com.android.systemui.plugins.FalsingManager import com.android.systemui.plugins.qs.QS -import com.android.systemui.shade.NotificationPanelViewController +import com.android.systemui.shade.ShadeViewController import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow import com.android.systemui.statusbar.notification.row.NotificationTestHelper import com.android.systemui.statusbar.notification.stack.AmbientState @@ -44,8 +44,8 @@ import org.mockito.Mockito.clearInvocations import org.mockito.Mockito.never import org.mockito.Mockito.verify import org.mockito.Mockito.verifyZeroInteractions -import org.mockito.Mockito.`when` as whenever import org.mockito.junit.MockitoJUnit +import org.mockito.Mockito.`when` as whenever private fun <T> anyObject(): T { return Mockito.anyObject<T>() @@ -69,7 +69,7 @@ class LockscreenShadeTransitionControllerTest : SysuiTestCase() { @Mock lateinit var mediaHierarchyManager: MediaHierarchyManager @Mock lateinit var scrimController: ScrimController @Mock lateinit var falsingManager: FalsingManager - @Mock lateinit var notificationPanelController: NotificationPanelViewController + @Mock lateinit var shadeViewController: ShadeViewController @Mock lateinit var nsslController: NotificationStackScrollLayoutController @Mock lateinit var depthController: NotificationShadeDepthController @Mock lateinit var stackscroller: NotificationStackScrollLayout @@ -128,7 +128,7 @@ class LockscreenShadeTransitionControllerTest : SysuiTestCase() { transitionController.addCallback(transitionControllerCallback) whenever(nsslController.view).thenReturn(stackscroller) whenever(nsslController.expandHelperCallback).thenReturn(expandHelperCallback) - transitionController.notificationPanelController = notificationPanelController + transitionController.shadeViewController = shadeViewController transitionController.centralSurfaces = mCentralSurfaces transitionController.qS = qS transitionController.setStackScroller(nsslController) @@ -223,7 +223,7 @@ class LockscreenShadeTransitionControllerTest : SysuiTestCase() { fun testGoToLockedShadeCreatesQSAnimation() { transitionController.goToLockedShade(null) verify(statusbarStateController).setState(StatusBarState.SHADE_LOCKED) - verify(notificationPanelController).transitionToExpandedShade(anyLong()) + verify(shadeViewController).transitionToExpandedShade(anyLong()) assertNotNull(transitionController.dragDownAnimator) } @@ -231,7 +231,7 @@ class LockscreenShadeTransitionControllerTest : SysuiTestCase() { fun testGoToLockedShadeDoesntCreateQSAnimation() { transitionController.goToLockedShade(null, needsQSAnimation = false) verify(statusbarStateController).setState(StatusBarState.SHADE_LOCKED) - verify(notificationPanelController).transitionToExpandedShade(anyLong()) + verify(shadeViewController).transitionToExpandedShade(anyLong()) assertNull(transitionController.dragDownAnimator) } @@ -239,7 +239,7 @@ class LockscreenShadeTransitionControllerTest : SysuiTestCase() { fun testGoToLockedShadeAlwaysCreatesQSAnimationInSplitShade() { enableSplitShade() transitionController.goToLockedShade(null, needsQSAnimation = true) - verify(notificationPanelController).transitionToExpandedShade(anyLong()) + verify(shadeViewController).transitionToExpandedShade(anyLong()) assertNotNull(transitionController.dragDownAnimator) } @@ -293,7 +293,7 @@ class LockscreenShadeTransitionControllerTest : SysuiTestCase() { fun setDragAmount_setsKeyguardTransitionProgress() { transitionController.dragDownAmount = 10f - verify(notificationPanelController).setKeyguardTransitionProgress(anyFloat(), anyInt()) + verify(shadeViewController).setKeyguardTransitionProgress(anyFloat(), anyInt()) } @Test @@ -303,7 +303,7 @@ class LockscreenShadeTransitionControllerTest : SysuiTestCase() { transitionController.dragDownAmount = 10f val expectedAlpha = 1 - 10f / alphaDistance - verify(notificationPanelController) + verify(shadeViewController) .setKeyguardTransitionProgress(eq(expectedAlpha), anyInt()) } @@ -317,7 +317,7 @@ class LockscreenShadeTransitionControllerTest : SysuiTestCase() { transitionController.dragDownAmount = 10f - verify(notificationPanelController).setKeyguardTransitionProgress(anyFloat(), eq(0)) + verify(shadeViewController).setKeyguardTransitionProgress(anyFloat(), eq(0)) } @Test @@ -330,7 +330,7 @@ class LockscreenShadeTransitionControllerTest : SysuiTestCase() { transitionController.dragDownAmount = 10f - verify(notificationPanelController) + verify(shadeViewController) .setKeyguardTransitionProgress(anyFloat(), eq(mediaTranslationY)) } @@ -349,7 +349,7 @@ class LockscreenShadeTransitionControllerTest : SysuiTestCase() { context.resources.getDimensionPixelSize( R.dimen.lockscreen_shade_keyguard_transition_vertical_offset) val expectedTranslation = 10f / distance * offset - verify(notificationPanelController) + verify(shadeViewController) .setKeyguardTransitionProgress(anyFloat(), eq(expectedTranslation.toInt())) } @@ -468,7 +468,7 @@ class LockscreenShadeTransitionControllerTest : SysuiTestCase() { transitionController.dragDownAmount = dragDownAmount val expectedAlpha = 1 - dragDownAmount / alphaDistance - verify(notificationPanelController).setKeyguardStatusBarAlpha(expectedAlpha) + verify(shadeViewController).setKeyguardStatusBarAlpha(expectedAlpha) } @Test @@ -477,7 +477,7 @@ class LockscreenShadeTransitionControllerTest : SysuiTestCase() { transitionController.dragDownAmount = 10f - verify(notificationPanelController).setKeyguardStatusBarAlpha(-1f) + verify(shadeViewController).setKeyguardStatusBarAlpha(-1f) } private fun enableSplitShade() { diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationWakeUpCoordinatorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationWakeUpCoordinatorTest.kt index aff705f1f3bf..da3a9f696d62 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationWakeUpCoordinatorTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationWakeUpCoordinatorTest.kt @@ -23,7 +23,7 @@ import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.android.systemui.dump.DumpManager import com.android.systemui.plugins.statusbar.StatusBarStateController -import com.android.systemui.shade.NotificationPanelViewController.WAKEUP_ANIMATION_DELAY_MS +import com.android.systemui.shade.ShadeViewController.Companion.WAKEUP_ANIMATION_DELAY_MS import com.android.systemui.statusbar.StatusBarState import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayoutController import com.android.systemui.statusbar.notification.stack.StackStateAnimator.ANIMATION_DURATION_WAKEUP diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesCommandQueueCallbacksTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesCommandQueueCallbacksTest.java index 775d2673ab18..872c5603b7a5 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesCommandQueueCallbacksTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesCommandQueueCallbacksTest.java @@ -46,9 +46,9 @@ import com.android.systemui.keyguard.WakefulnessLifecycle; import com.android.systemui.qs.QSHost; import com.android.systemui.settings.UserTracker; import com.android.systemui.shade.CameraLauncher; -import com.android.systemui.shade.NotificationPanelViewController; import com.android.systemui.shade.QuickSettingsController; import com.android.systemui.shade.ShadeController; +import com.android.systemui.shade.ShadeViewController; import com.android.systemui.statusbar.CommandQueue; import com.android.systemui.statusbar.VibratorHelper; import com.android.systemui.statusbar.disableflags.DisableFlagsLogger; @@ -76,7 +76,7 @@ public class CentralSurfacesCommandQueueCallbacksTest extends SysuiTestCase { @Mock private ShadeController mShadeController; @Mock private CommandQueue mCommandQueue; @Mock private QuickSettingsController mQuickSettingsController; - @Mock private NotificationPanelViewController mNotificationPanelViewController; + @Mock private ShadeViewController mShadeViewController; @Mock private RemoteInputQuickSettingsDisabler mRemoteInputQuickSettingsDisabler; private final MetricsLogger mMetricsLogger = new FakeMetricsLogger(); @Mock private KeyguardUpdateMonitor mKeyguardUpdateMonitor; @@ -110,7 +110,7 @@ public class CentralSurfacesCommandQueueCallbacksTest extends SysuiTestCase { mContext.getResources(), mShadeController, mCommandQueue, - mNotificationPanelViewController, + mShadeViewController, mRemoteInputQuickSettingsDisabler, mMetricsLogger, mKeyguardUpdateMonitor, @@ -153,9 +153,9 @@ public class CentralSurfacesCommandQueueCallbacksTest extends SysuiTestCase { // Trying to open it does nothing. mSbcqCallbacks.animateExpandNotificationsPanel(); - verify(mNotificationPanelViewController, never()).expandToNotifications(); + verify(mShadeViewController, never()).expandToNotifications(); mSbcqCallbacks.animateExpandSettingsPanel(null); - verify(mNotificationPanelViewController, never()).expand(anyBoolean()); + verify(mShadeViewController, never()).expand(anyBoolean()); } @Test @@ -171,9 +171,9 @@ public class CentralSurfacesCommandQueueCallbacksTest extends SysuiTestCase { // Can now be opened. mSbcqCallbacks.animateExpandNotificationsPanel(); - verify(mNotificationPanelViewController).expandToNotifications(); + verify(mShadeViewController).expandToNotifications(); mSbcqCallbacks.animateExpandSettingsPanel(null); - verify(mNotificationPanelViewController).expandToQs(); + verify(mShadeViewController).expandToQs(); } @Test diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesImplTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesImplTest.java index 589c8bc93f3b..ff3cea53f4ad 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesImplTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesImplTest.java @@ -561,7 +561,7 @@ public class CentralSurfacesImplTest extends SysuiTestCase { // TODO: we should be able to call mCentralSurfaces.start() and have all the below values // initialized automatically and make NPVC private. mCentralSurfaces.mNotificationShadeWindowView = mNotificationShadeWindowView; - mCentralSurfaces.mNotificationPanelViewController = mNotificationPanelViewController; + mCentralSurfaces.mShadeSurface = mNotificationPanelViewController; mCentralSurfaces.mQsController = mQuickSettingsController; mCentralSurfaces.mDozeScrimController = mDozeScrimController; mCentralSurfaces.mPresenter = mNotificationPresenter; 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 996851e218f1..2831d2fad02a 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 @@ -41,8 +41,8 @@ import com.android.systemui.biometrics.AuthController; import com.android.systemui.doze.DozeHost; import com.android.systemui.doze.DozeLog; import com.android.systemui.keyguard.WakefulnessLifecycle; -import com.android.systemui.shade.NotificationPanelViewController; import com.android.systemui.shade.NotificationShadeWindowViewController; +import com.android.systemui.shade.ShadeViewController; import com.android.systemui.statusbar.NotificationShadeWindowController; import com.android.systemui.statusbar.PulseExpansionHandler; import com.android.systemui.statusbar.StatusBarState; @@ -87,7 +87,7 @@ public class DozeServiceHostTest extends SysuiTestCase { @Mock private NotificationIconAreaController mNotificationIconAreaController; @Mock private NotificationShadeWindowViewController mNotificationShadeWindowViewController; @Mock private StatusBarKeyguardViewManager mStatusBarKeyguardViewManager; - @Mock private NotificationPanelViewController mNotificationPanel; + @Mock private ShadeViewController mShadeViewController; @Mock private View mAmbientIndicationContainer; @Mock private BiometricUnlockController mBiometricUnlockController; @Mock private AuthController mAuthController; @@ -108,7 +108,7 @@ public class DozeServiceHostTest extends SysuiTestCase { mCentralSurfaces, mStatusBarKeyguardViewManager, mNotificationShadeWindowViewController, - mNotificationPanel, + mShadeViewController, mAmbientIndicationContainer); } diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/HeadsUpAppearanceControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/HeadsUpAppearanceControllerTest.java index 3372dc3e7959..205cebdefa49 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/HeadsUpAppearanceControllerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/HeadsUpAppearanceControllerTest.java @@ -38,8 +38,8 @@ import com.android.systemui.flags.FeatureFlags; import com.android.systemui.flags.Flags; import com.android.systemui.plugins.DarkIconDispatcher; import com.android.systemui.plugins.statusbar.StatusBarStateController; -import com.android.systemui.shade.NotificationPanelViewController; import com.android.systemui.shade.ShadeHeadsUpTracker; +import com.android.systemui.shade.ShadeViewController; import com.android.systemui.statusbar.CommandQueue; import com.android.systemui.statusbar.HeadsUpStatusBarView; import com.android.systemui.statusbar.notification.NotificationWakeUpCoordinator; @@ -65,8 +65,8 @@ public class HeadsUpAppearanceControllerTest extends SysuiTestCase { private final NotificationStackScrollLayoutController mStackScrollerController = mock(NotificationStackScrollLayoutController.class); - private final NotificationPanelViewController mPanelView = - mock(NotificationPanelViewController.class); + private final ShadeViewController mShadeViewController = + mock(ShadeViewController.class); private final ShadeHeadsUpTracker mShadeHeadsUpTracker = mock(ShadeHeadsUpTracker.class); private final DarkIconDispatcher mDarkIconDispatcher = mock(DarkIconDispatcher.class); private HeadsUpAppearanceController mHeadsUpAppearanceController; @@ -104,7 +104,7 @@ public class HeadsUpAppearanceControllerTest extends SysuiTestCase { mCommandQueue = mock(CommandQueue.class); mNotificationRoundnessManager = mock(NotificationRoundnessManager.class); mFeatureFlag = mock(FeatureFlags.class); - when(mPanelView.getShadeHeadsUpTracker()).thenReturn(mShadeHeadsUpTracker); + when(mShadeViewController.getShadeHeadsUpTracker()).thenReturn(mShadeHeadsUpTracker); when(mFeatureFlag.isEnabled(Flags.USE_ROUNDNESS_SOURCETYPES)).thenReturn(true); mHeadsUpAppearanceController = new HeadsUpAppearanceController( mock(NotificationIconAreaController.class), @@ -116,7 +116,7 @@ public class HeadsUpAppearanceControllerTest extends SysuiTestCase { mKeyguardStateController, mCommandQueue, mStackScrollerController, - mPanelView, + mShadeViewController, mNotificationRoundnessManager, mFeatureFlag, mHeadsUpStatusBarView, @@ -200,7 +200,7 @@ public class HeadsUpAppearanceControllerTest extends SysuiTestCase { mKeyguardStateController, mCommandQueue, mStackScrollerController, - mPanelView, + mShadeViewController, mNotificationRoundnessManager, mFeatureFlag, mHeadsUpStatusBarView, diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardStatusBarViewControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardStatusBarViewControllerTest.java index 760a90b4d59a..e838a480f3cc 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardStatusBarViewControllerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardStatusBarViewControllerTest.java @@ -52,7 +52,7 @@ import com.android.systemui.R; import com.android.systemui.SysuiTestCase; import com.android.systemui.battery.BatteryMeterViewController; import com.android.systemui.plugins.statusbar.StatusBarStateController; -import com.android.systemui.shade.NotificationPanelViewController; +import com.android.systemui.shade.ShadeViewStateProvider; import com.android.systemui.statusbar.CommandQueue; import com.android.systemui.statusbar.NotificationMediaManager; import com.android.systemui.statusbar.SysuiStatusBarStateController; @@ -123,14 +123,14 @@ public class KeyguardStatusBarViewControllerTest extends SysuiTestCase { @Mock private NotificationMediaManager mNotificationMediaManager; - private TestNotificationPanelViewStateProvider mNotificationPanelViewStateProvider; + private TestShadeViewStateProvider mShadeViewStateProvider; private KeyguardStatusBarView mKeyguardStatusBarView; private KeyguardStatusBarViewController mController; private FakeExecutor mFakeExecutor = new FakeExecutor(new FakeSystemClock()); @Before public void setup() throws Exception { - mNotificationPanelViewStateProvider = new TestNotificationPanelViewStateProvider(); + mShadeViewStateProvider = new TestShadeViewStateProvider(); MockitoAnnotations.initMocks(this); @@ -158,7 +158,7 @@ public class KeyguardStatusBarViewControllerTest extends SysuiTestCase { mStatusBarIconController, mIconManagerFactory, mBatteryMeterViewController, - mNotificationPanelViewStateProvider, + mShadeViewStateProvider, mKeyguardStateController, mKeyguardBypassController, mKeyguardUpdateMonitor, @@ -358,7 +358,7 @@ public class KeyguardStatusBarViewControllerTest extends SysuiTestCase { mController.onViewAttached(); updateStateToKeyguard(); - mNotificationPanelViewStateProvider.setPanelViewExpandedHeight(0); + mShadeViewStateProvider.setPanelViewExpandedHeight(0); mController.updateViewState(); @@ -370,7 +370,7 @@ public class KeyguardStatusBarViewControllerTest extends SysuiTestCase { mController.onViewAttached(); updateStateToKeyguard(); - mNotificationPanelViewStateProvider.setLockscreenShadeDragProgress(1f); + mShadeViewStateProvider.setLockscreenShadeDragProgress(1f); mController.updateViewState(); @@ -451,7 +451,7 @@ public class KeyguardStatusBarViewControllerTest extends SysuiTestCase { updateStateToKeyguard(); mKeyguardStatusBarView.setVisibility(View.VISIBLE); - mNotificationPanelViewStateProvider.setShouldHeadsUpBeVisible(true); + mShadeViewStateProvider.setShouldHeadsUpBeVisible(true); mController.updateForHeadsUp(/* animate= */ false); assertThat(mKeyguardStatusBarView.getVisibility()).isEqualTo(View.INVISIBLE); @@ -463,10 +463,10 @@ public class KeyguardStatusBarViewControllerTest extends SysuiTestCase { updateStateToKeyguard(); // Start with the opposite state. - mNotificationPanelViewStateProvider.setShouldHeadsUpBeVisible(true); + mShadeViewStateProvider.setShouldHeadsUpBeVisible(true); mController.updateForHeadsUp(/* animate= */ false); - mNotificationPanelViewStateProvider.setShouldHeadsUpBeVisible(false); + mShadeViewStateProvider.setShouldHeadsUpBeVisible(false); mController.updateForHeadsUp(/* animate= */ false); assertThat(mKeyguardStatusBarView.getVisibility()).isEqualTo(View.VISIBLE); @@ -591,10 +591,10 @@ public class KeyguardStatusBarViewControllerTest extends SysuiTestCase { return captor.getValue(); } - private static class TestNotificationPanelViewStateProvider - implements NotificationPanelViewController.NotificationPanelViewStateProvider { + private static class TestShadeViewStateProvider + implements ShadeViewStateProvider { - TestNotificationPanelViewStateProvider() {} + TestShadeViewStateProvider() {} private float mPanelViewExpandedHeight = 100f; private boolean mShouldHeadsUpBeVisible = false; diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/PhoneStatusBarViewControllerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/PhoneStatusBarViewControllerTest.kt index 3edf33b9d3a9..2d96e594592c 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/PhoneStatusBarViewControllerTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/PhoneStatusBarViewControllerTest.kt @@ -27,9 +27,9 @@ import com.android.systemui.R import com.android.systemui.SysuiTestCase import com.android.systemui.flags.FeatureFlags import com.android.systemui.flags.Flags -import com.android.systemui.shade.NotificationPanelViewController import com.android.systemui.shade.ShadeControllerImpl import com.android.systemui.shade.ShadeLogger +import com.android.systemui.shade.ShadeViewController import com.android.systemui.statusbar.policy.ConfigurationController import com.android.systemui.unfold.SysUIUnfoldComponent import com.android.systemui.unfold.config.UnfoldTransitionConfig @@ -43,11 +43,11 @@ import org.junit.Before import org.junit.Test import org.mockito.ArgumentCaptor import org.mockito.Mock -import org.mockito.Mockito.`when` import org.mockito.Mockito.mock import org.mockito.Mockito.never import org.mockito.Mockito.spy import org.mockito.Mockito.verify +import org.mockito.Mockito.`when` import org.mockito.MockitoAnnotations import java.util.Optional @@ -55,7 +55,7 @@ import java.util.Optional class PhoneStatusBarViewControllerTest : SysuiTestCase() { @Mock - private lateinit var notificationPanelViewController: NotificationPanelViewController + private lateinit var shadeViewController: ShadeViewController @Mock private lateinit var featureFlags: FeatureFlags @Mock @@ -134,58 +134,58 @@ class PhoneStatusBarViewControllerTest : SysuiTestCase() { val returnVal = view.onTouchEvent( MotionEvent.obtain(0L, 0L, MotionEvent.ACTION_DOWN, 0f, 0f, 0)) assertThat(returnVal).isFalse() - verify(notificationPanelViewController, never()).handleExternalTouch(any()) + verify(shadeViewController, never()).handleExternalTouch(any()) } @Test fun handleTouchEventFromStatusBar_viewNotEnabled_returnsTrueAndNoViewEvent() { `when`(centralSurfacesImpl.commandQueuePanelsEnabled).thenReturn(true) - `when`(centralSurfacesImpl.notificationPanelViewController) - .thenReturn(notificationPanelViewController) - `when`(notificationPanelViewController.isViewEnabled).thenReturn(false) + `when`(centralSurfacesImpl.shadeViewController) + .thenReturn(shadeViewController) + `when`(shadeViewController.isViewEnabled).thenReturn(false) val returnVal = view.onTouchEvent( MotionEvent.obtain(0L, 0L, MotionEvent.ACTION_DOWN, 0f, 0f, 0)) assertThat(returnVal).isTrue() - verify(notificationPanelViewController, never()).handleExternalTouch(any()) + verify(shadeViewController, never()).handleExternalTouch(any()) } @Test fun handleTouchEventFromStatusBar_viewNotEnabledButIsMoveEvent_viewReceivesEvent() { `when`(centralSurfacesImpl.commandQueuePanelsEnabled).thenReturn(true) - `when`(centralSurfacesImpl.notificationPanelViewController) - .thenReturn(notificationPanelViewController) - `when`(notificationPanelViewController.isViewEnabled).thenReturn(false) + `when`(centralSurfacesImpl.shadeViewController) + .thenReturn(shadeViewController) + `when`(shadeViewController.isViewEnabled).thenReturn(false) val event = MotionEvent.obtain(0L, 0L, MotionEvent.ACTION_MOVE, 0f, 0f, 0) view.onTouchEvent(event) - verify(notificationPanelViewController).handleExternalTouch(event) + verify(shadeViewController).handleExternalTouch(event) } @Test fun handleTouchEventFromStatusBar_panelAndViewEnabled_viewReceivesEvent() { `when`(centralSurfacesImpl.commandQueuePanelsEnabled).thenReturn(true) - `when`(centralSurfacesImpl.notificationPanelViewController) - .thenReturn(notificationPanelViewController) - `when`(notificationPanelViewController.isViewEnabled).thenReturn(true) + `when`(centralSurfacesImpl.shadeViewController) + .thenReturn(shadeViewController) + `when`(shadeViewController.isViewEnabled).thenReturn(true) val event = MotionEvent.obtain(0L, 0L, MotionEvent.ACTION_DOWN, 0f, 2f, 0) view.onTouchEvent(event) - verify(notificationPanelViewController).handleExternalTouch(event) + verify(shadeViewController).handleExternalTouch(event) } @Test fun handleTouchEventFromStatusBar_topEdgeTouch_viewNeverReceivesEvent() { `when`(centralSurfacesImpl.commandQueuePanelsEnabled).thenReturn(true) - `when`(centralSurfacesImpl.notificationPanelViewController) - .thenReturn(notificationPanelViewController) - `when`(notificationPanelViewController.isFullyCollapsed).thenReturn(true) + `when`(centralSurfacesImpl.shadeViewController) + .thenReturn(shadeViewController) + `when`(shadeViewController.isFullyCollapsed).thenReturn(true) val event = MotionEvent.obtain(0L, 0L, MotionEvent.ACTION_DOWN, 0f, 0f, 0) view.onTouchEvent(event) - verify(notificationPanelViewController, never()).handleExternalTouch(any()) + verify(shadeViewController, never()).handleExternalTouch(any()) } private fun createViewMock(): PhoneStatusBarView { diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/PhoneStatusBarViewTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/PhoneStatusBarViewTest.kt index 3ed454fff584..9c10131acae2 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/PhoneStatusBarViewTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/PhoneStatusBarViewTest.kt @@ -21,7 +21,7 @@ import android.view.ViewGroup import androidx.test.filters.SmallTest import com.android.systemui.Gefingerpoken import com.android.systemui.SysuiTestCase -import com.android.systemui.shade.NotificationPanelViewController +import com.android.systemui.shade.ShadeViewController import com.google.common.truth.Truth.assertThat import org.junit.Before import org.junit.Test @@ -32,7 +32,7 @@ import org.mockito.MockitoAnnotations class PhoneStatusBarViewTest : SysuiTestCase() { @Mock - private lateinit var notificationPanelViewController: NotificationPanelViewController + private lateinit var shadeViewController: ShadeViewController @Mock private lateinit var panelView: ViewGroup 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 14aee4e13a8f..4ff225cc7f3f 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 @@ -73,11 +73,11 @@ import com.android.systemui.keyguard.domain.interactor.PrimaryBouncerInteractor; import com.android.systemui.navigationbar.NavigationModeController; import com.android.systemui.navigationbar.TaskbarDelegate; import com.android.systemui.plugins.ActivityStarter.OnDismissAction; -import com.android.systemui.shade.NotificationPanelViewController; import com.android.systemui.shade.NotificationShadeWindowView; import com.android.systemui.shade.ShadeController; import com.android.systemui.shade.ShadeExpansionChangeEvent; import com.android.systemui.shade.ShadeExpansionStateManager; +import com.android.systemui.shade.ShadeViewController; import com.android.systemui.statusbar.NotificationMediaManager; import com.android.systemui.statusbar.NotificationShadeWindowController; import com.android.systemui.statusbar.StatusBarState; @@ -110,7 +110,7 @@ public class StatusBarKeyguardViewManagerTest extends SysuiTestCase { @Mock private LockPatternUtils mLockPatternUtils; @Mock private CentralSurfaces mCentralSurfaces; @Mock private ViewGroup mContainer; - @Mock private NotificationPanelViewController mNotificationPanelView; + @Mock private ShadeViewController mShadeViewController; @Mock private BiometricUnlockController mBiometricUnlockController; @Mock private SysuiStatusBarStateController mStatusBarStateController; @Mock private KeyguardUpdateMonitor mKeyguardUpdateMonitor; @@ -202,7 +202,7 @@ public class StatusBarKeyguardViewManagerTest extends SysuiTestCase { .thenReturn(mOnBackInvokedDispatcher); mStatusBarKeyguardViewManager.registerCentralSurfaces( mCentralSurfaces, - mNotificationPanelView, + mShadeViewController, new ShadeExpansionStateManager(), mBiometricUnlockController, mNotificationContainer, @@ -250,7 +250,7 @@ public class StatusBarKeyguardViewManagerTest extends SysuiTestCase { @Test public void onPanelExpansionChanged_neverShowsDuringHintAnimation() { - when(mNotificationPanelView.isUnlockHintRunning()).thenReturn(true); + when(mShadeViewController.isUnlockHintRunning()).thenReturn(true); mStatusBarKeyguardViewManager.onPanelExpansionChanged(EXPANSION_EVENT); verify(mPrimaryBouncerInteractor, never()).setPanelExpansion(anyFloat()); } 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 ee7e082c839f..d6ae2b711583 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 @@ -66,9 +66,9 @@ import com.android.systemui.plugins.ActivityStarter; import com.android.systemui.plugins.ActivityStarter.OnDismissAction; import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.settings.UserTracker; -import com.android.systemui.shade.NotificationPanelViewController; import com.android.systemui.shade.NotificationShadeWindowViewController; import com.android.systemui.shade.ShadeControllerImpl; +import com.android.systemui.shade.ShadeViewController; import com.android.systemui.statusbar.NotificationClickNotifier; import com.android.systemui.statusbar.NotificationLockscreenUserManager; import com.android.systemui.statusbar.NotificationPresenter; @@ -232,7 +232,7 @@ public class StatusBarNotificationActivityStarterTest extends SysuiTestCase { mOnUserInteractionCallback, mCentralSurfaces, mock(NotificationPresenter.class), - mock(NotificationPanelViewController.class), + mock(ShadeViewController.class), mActivityLaunchAnimator, notificationAnimationProvider, mock(LaunchFullScreenIntentProvider.class), 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 c16d14088bbe..fdfe028765ef 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 @@ -38,11 +38,11 @@ import com.android.systemui.SysuiTestCase; import com.android.systemui.plugins.ActivityStarter; import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.settings.FakeDisplayTracker; -import com.android.systemui.shade.NotificationPanelViewController; import com.android.systemui.shade.NotificationShadeWindowView; import com.android.systemui.shade.QuickSettingsController; import com.android.systemui.shade.ShadeController; import com.android.systemui.shade.ShadeNotificationPresenter; +import com.android.systemui.shade.ShadeViewController; import com.android.systemui.statusbar.CommandQueue; import com.android.systemui.statusbar.KeyguardIndicationController; import com.android.systemui.statusbar.LockscreenShadeTransitionController; @@ -107,12 +107,12 @@ public class StatusBarNotificationPresenterTest extends SysuiTestCase { mock(NotificationStackScrollLayout.class)); when(notificationShadeWindowView.getResources()).thenReturn(mContext.getResources()); - NotificationPanelViewController npvc = mock(NotificationPanelViewController.class); - when(npvc.getShadeNotificationPresenter()) + ShadeViewController shadeViewController = mock(ShadeViewController.class); + when(shadeViewController.getShadeNotificationPresenter()) .thenReturn(mock(ShadeNotificationPresenter.class)); mStatusBarNotificationPresenter = new StatusBarNotificationPresenter( mContext, - npvc, + shadeViewController, mock(QuickSettingsController.class), mock(HeadsUpManagerPhone.class), notificationShadeWindowView, 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 02c459b11d07..3c644a5e1dc6 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 @@ -25,7 +25,7 @@ import com.android.internal.jank.InteractionJankMonitor import com.android.systemui.SysuiTestCase import com.android.systemui.keyguard.KeyguardViewMediator import com.android.systemui.keyguard.WakefulnessLifecycle -import com.android.systemui.shade.NotificationPanelViewController +import com.android.systemui.shade.ShadeViewController import com.android.systemui.statusbar.LightRevealScrim import com.android.systemui.statusbar.StatusBarStateControllerImpl import com.android.systemui.statusbar.policy.KeyguardStateController @@ -59,9 +59,9 @@ class UnlockedScreenOffAnimationControllerTest : SysuiTestCase() { @Mock private lateinit var globalSettings: GlobalSettings @Mock - private lateinit var mCentralSurfaces: CentralSurfaces + private lateinit var centralSurfaces: CentralSurfaces @Mock - private lateinit var notificationPanelViewController: NotificationPanelViewController + private lateinit var shadeViewController: ShadeViewController @Mock private lateinit var lightRevealScrim: LightRevealScrim @Mock @@ -91,13 +91,13 @@ class UnlockedScreenOffAnimationControllerTest : SysuiTestCase() { powerManager, handler = handler ) - controller.initialize(mCentralSurfaces, lightRevealScrim) - `when`(mCentralSurfaces.notificationPanelViewController).thenReturn( - notificationPanelViewController) + controller.initialize(centralSurfaces, lightRevealScrim) + `when`(centralSurfaces.shadeViewController).thenReturn( + shadeViewController) // Screen off does not run if the panel is expanded, so we should say it's collapsed to test // screen off. - `when`(notificationPanelViewController.isFullyCollapsed).thenReturn(true) + `when`(shadeViewController.isFullyCollapsed).thenReturn(true) } @After @@ -127,7 +127,7 @@ class UnlockedScreenOffAnimationControllerTest : SysuiTestCase() { callbackCaptor.value.run() - verify(notificationPanelViewController, times(1)).showAodUi() + verify(shadeViewController, times(1)).showAodUi() } /** @@ -149,7 +149,7 @@ class UnlockedScreenOffAnimationControllerTest : SysuiTestCase() { verify(handler).postDelayed(callbackCaptor.capture(), anyLong()) callbackCaptor.value.run() - verify(notificationPanelViewController, never()).showAodUi() + verify(shadeViewController, never()).showAodUi() } @Test diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragmentTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragmentTest.java index be0c83f910f2..2a3c775eaf54 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragmentTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragmentTest.java @@ -56,8 +56,8 @@ import com.android.systemui.plugins.DarkIconDispatcher; import com.android.systemui.plugins.log.LogBuffer; import com.android.systemui.plugins.log.LogcatEchoTracker; import com.android.systemui.plugins.statusbar.StatusBarStateController; -import com.android.systemui.shade.NotificationPanelViewController; import com.android.systemui.shade.ShadeExpansionStateManager; +import com.android.systemui.shade.ShadeViewController; import com.android.systemui.statusbar.CommandQueue; import com.android.systemui.statusbar.OperatorNameViewController; import com.android.systemui.statusbar.disableflags.DisableFlagsLogger; @@ -117,7 +117,7 @@ public class CollapsedStatusBarFragmentTest extends SysuiBaseFragmentTest { @Mock private HeadsUpAppearanceController mHeadsUpAppearanceController; @Mock - private NotificationPanelViewController mNotificationPanelViewController; + private ShadeViewController mShadeViewController; @Mock private StatusBarIconController.DarkIconManager.Factory mIconManagerFactory; @Mock @@ -507,7 +507,7 @@ public class CollapsedStatusBarFragmentTest extends SysuiBaseFragmentTest { mIconManagerFactory, mStatusBarHideIconsForBouncerManager, mKeyguardStateController, - mNotificationPanelViewController, + mShadeViewController, mStatusBarStateController, mCommandQueue, mCarrierConfigTracker, diff --git a/packages/SystemUI/tests/src/com/android/systemui/unfold/FoldAodAnimationControllerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/unfold/FoldAodAnimationControllerTest.kt index dfbd61bd057b..8fc0a1acf76b 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/unfold/FoldAodAnimationControllerTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/unfold/FoldAodAnimationControllerTest.kt @@ -31,8 +31,8 @@ import com.android.systemui.keyguard.WakefulnessLifecycle import com.android.systemui.keyguard.data.repository.FakeKeyguardBouncerRepository import com.android.systemui.keyguard.data.repository.FakeKeyguardRepository import com.android.systemui.keyguard.domain.interactor.KeyguardInteractor -import com.android.systemui.shade.NotificationPanelViewController import com.android.systemui.shade.ShadeFoldAnimator +import com.android.systemui.shade.ShadeViewController import com.android.systemui.statusbar.CommandQueue import com.android.systemui.statusbar.LightRevealScrim import com.android.systemui.statusbar.phone.CentralSurfaces @@ -74,7 +74,7 @@ class FoldAodAnimationControllerTest : SysuiTestCase() { @Mock lateinit var lightRevealScrim: LightRevealScrim - @Mock lateinit var notificationPanelViewController: NotificationPanelViewController + @Mock lateinit var shadeViewController: ShadeViewController @Mock lateinit var viewGroup: ViewGroup @@ -100,13 +100,12 @@ class FoldAodAnimationControllerTest : SysuiTestCase() { deviceStates = FoldableTestUtils.findDeviceStates(context) // TODO(b/254878364): remove this call to NPVC.getView() - whenever(notificationPanelViewController.shadeFoldAnimator).thenReturn(shadeFoldAnimator) + whenever(shadeViewController.shadeFoldAnimator).thenReturn(shadeFoldAnimator) whenever(shadeFoldAnimator.view).thenReturn(viewGroup) whenever(viewGroup.viewTreeObserver).thenReturn(viewTreeObserver) whenever(wakefulnessLifecycle.lastSleepReason) .thenReturn(PowerManager.GO_TO_SLEEP_REASON_DEVICE_FOLD) - whenever(centralSurfaces.notificationPanelViewController) - .thenReturn(notificationPanelViewController) + whenever(centralSurfaces.shadeViewController).thenReturn(shadeViewController) whenever(shadeFoldAnimator.startFoldToAodAnimation(any(), any(), any())).then { val onActionStarted = it.arguments[0] as Runnable onActionStarted.run() |