Refactor of LargeScreenUtils.shouldUseLargeScreenShadeHeader
Primary reason for refactor is to include flagging - so split shade on small landscape screens can be flag-guarded.
Refactor:
- removed static methods LargeScreenUtils.shouldUseLargeScreenShadeHeader
- now using SplitShadeStateController.shouldUseSplitNotificationShade
- SplitShadeStateController is injected or passed when necessary
- flag guarding can now be done in SplitShadeStateController.shouldUseSplitNotificationShade
- FakeSplitShadeStateController is passed in test classes
Improvements that could be made in a follow up CL:
- no longer need resources as a parameter for shouldUseLargeScreenShadeHeader, context can be injected and then context.resources could be used internally
- StateFlow could be used, this could be subscribed to instead of checking shouldUseLargeScreenShadeHeader in 'updateResources' methods.
- Improvements ignored for now to reduce the size of the change and speed up review
Now, when LOCKSCREEN_ENABLE_LANDSCAPE is on: split shade is used on small landscape screens.
Bug: 293252410
Test: See files
Change-Id: If35ad6d5e095f15e037b0d2bb58f346758966379
diff --git a/packages/SystemUI/res/values-land/config.xml b/packages/SystemUI/res/values-land/config.xml
index d800d49..85fb3ac 100644
--- a/packages/SystemUI/res/values-land/config.xml
+++ b/packages/SystemUI/res/values-land/config.xml
@@ -42,4 +42,8 @@
<!-- Whether we use large screen shade header which takes only one row compared to QS header -->
<bool name="config_use_large_screen_shade_header">true</bool>
+ <!-- Whether to force split shade.
+ For now, this value has effect only when flag lockscreen.enable_landscape is enabled.
+ TODO (b/293290851) - change this comment/resource when flag is enabled -->
+ <bool name="force_config_use_split_notification_shade">true</bool>
</resources>
diff --git a/packages/SystemUI/res/values-sw600dp-land/config.xml b/packages/SystemUI/res/values-sw600dp-land/config.xml
index 588638f..e63229a 100644
--- a/packages/SystemUI/res/values-sw600dp-land/config.xml
+++ b/packages/SystemUI/res/values-sw600dp-land/config.xml
@@ -36,4 +36,8 @@
<integer name="power_menu_lite_max_columns">3</integer>
<integer name="power_menu_lite_max_rows">2</integer>
+ <!-- Whether to force split shade.
+ For now, this value has effect only when flag lockscreen.enable_landscape is enabled.
+ TODO (b/293290851) - change this comment/resource when flag is enabled -->
+ <bool name="force_config_use_split_notification_shade">false</bool>
</resources>
diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml
index c134806..c72f565 100644
--- a/packages/SystemUI/res/values/config.xml
+++ b/packages/SystemUI/res/values/config.xml
@@ -592,6 +592,11 @@
<!-- Whether to use the split 2-column notification shade -->
<bool name="config_use_split_notification_shade">false</bool>
+ <!-- Whether to force split shade.
+ For now, this value has effect only when flag lockscreen.enable_landscape is enabled.
+ TODO (b/293290851) - change this comment/resource when flag is enabled -->
+ <bool name="force_config_use_split_notification_shade">false</bool>
+
<!-- Whether we use large screen shade header which takes only one row compared to QS header -->
<bool name="config_use_large_screen_shade_header">false</bool>
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/DefaultStatusViewSection.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/DefaultStatusViewSection.kt
index b1dd373..c7b0cb9 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/DefaultStatusViewSection.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/DefaultStatusViewSection.kt
@@ -39,7 +39,7 @@
import com.android.systemui.media.controls.ui.KeyguardMediaController
import com.android.systemui.shade.NotificationPanelView
import com.android.systemui.shade.NotificationPanelViewController
-import com.android.systemui.util.LargeScreenUtils
+import com.android.systemui.statusbar.policy.SplitShadeStateController
import com.android.systemui.util.Utils
import dagger.Lazy
import javax.inject.Inject
@@ -55,6 +55,7 @@
private val keyguardViewConfigurator: Lazy<KeyguardViewConfigurator>,
private val notificationPanelViewController: Lazy<NotificationPanelViewController>,
private val keyguardMediaController: KeyguardMediaController,
+ private val splitShadeStateController: SplitShadeStateController
) : KeyguardSection() {
private val statusViewId = R.id.keyguard_status_view
@@ -104,7 +105,7 @@
connect(statusViewId, END, PARENT_ID, END)
val margin =
- if (LargeScreenUtils.shouldUseSplitNotificationShade(context.resources)) {
+ if (splitShadeStateController.shouldUseSplitNotificationShade(context.resources)) {
context.resources.getDimensionPixelSize(R.dimen.keyguard_split_shade_top_margin)
} else {
context.resources.getDimensionPixelSize(R.dimen.keyguard_clock_top_margin) +
diff --git a/packages/SystemUI/src/com/android/systemui/media/controls/ui/KeyguardMediaController.kt b/packages/SystemUI/src/com/android/systemui/media/controls/ui/KeyguardMediaController.kt
index 2883210..83a6e58 100644
--- a/packages/SystemUI/src/com/android/systemui/media/controls/ui/KeyguardMediaController.kt
+++ b/packages/SystemUI/src/com/android/systemui/media/controls/ui/KeyguardMediaController.kt
@@ -35,7 +35,7 @@
import com.android.systemui.statusbar.notification.stack.MediaContainerView
import com.android.systemui.statusbar.phone.KeyguardBypassController
import com.android.systemui.statusbar.policy.ConfigurationController
-import com.android.systemui.util.LargeScreenUtils
+import com.android.systemui.statusbar.policy.SplitShadeStateController
import com.android.systemui.util.settings.SecureSettings
import javax.inject.Inject
import javax.inject.Named
@@ -55,6 +55,7 @@
private val secureSettings: SecureSettings,
@Main private val handler: Handler,
configurationController: ConfigurationController,
+ private val splitShadeStateController: SplitShadeStateController
) {
init {
@@ -108,7 +109,7 @@
}
private fun updateResources() {
- useSplitShade = LargeScreenUtils.shouldUseSplitNotificationShade(context.resources)
+ useSplitShade = splitShadeStateController.shouldUseSplitNotificationShade(context.resources)
}
@VisibleForTesting
diff --git a/packages/SystemUI/src/com/android/systemui/media/controls/ui/MediaHierarchyManager.kt b/packages/SystemUI/src/com/android/systemui/media/controls/ui/MediaHierarchyManager.kt
index c1c757e..0b30e59 100644
--- a/packages/SystemUI/src/com/android/systemui/media/controls/ui/MediaHierarchyManager.kt
+++ b/packages/SystemUI/src/com/android/systemui/media/controls/ui/MediaHierarchyManager.kt
@@ -52,7 +52,7 @@
import com.android.systemui.statusbar.phone.KeyguardBypassController
import com.android.systemui.statusbar.policy.ConfigurationController
import com.android.systemui.statusbar.policy.KeyguardStateController
-import com.android.systemui.util.LargeScreenUtils
+import com.android.systemui.statusbar.policy.SplitShadeStateController
import com.android.systemui.util.animation.UniqueObjectHostView
import com.android.systemui.util.settings.SecureSettings
import com.android.systemui.util.traceSection
@@ -101,6 +101,7 @@
panelEventsEvents: ShadeStateEvents,
private val secureSettings: SecureSettings,
@Main private val handler: Handler,
+ private val splitShadeStateController: SplitShadeStateController
) {
/** Track the media player setting status on lock screen. */
@@ -568,7 +569,7 @@
context.resources.getDimensionPixelSize(
R.dimen.lockscreen_shade_media_transition_distance
)
- inSplitShade = LargeScreenUtils.shouldUseSplitNotificationShade(context.resources)
+ inSplitShade = splitShadeStateController.shouldUseSplitNotificationShade(context.resources)
}
/**
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSPanelController.java b/packages/SystemUI/src/com/android/systemui/qs/QSPanelController.java
index 856a92e..9359958 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSPanelController.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSPanelController.java
@@ -39,6 +39,7 @@
import com.android.systemui.settings.brightness.BrightnessSliderController;
import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager;
import com.android.systemui.statusbar.policy.BrightnessMirrorController;
+import com.android.systemui.statusbar.policy.SplitShadeStateController;
import com.android.systemui.tuner.TunerService;
import javax.inject.Inject;
@@ -80,9 +81,10 @@
QSLogger qsLogger, BrightnessController.Factory brightnessControllerFactory,
BrightnessSliderController.Factory brightnessSliderFactory,
FalsingManager falsingManager,
- StatusBarKeyguardViewManager statusBarKeyguardViewManager) {
+ StatusBarKeyguardViewManager statusBarKeyguardViewManager,
+ SplitShadeStateController splitShadeStateController) {
super(view, qsHost, qsCustomizerController, usingMediaPlayer, mediaHost,
- metricsLogger, uiEventLogger, qsLogger, dumpManager);
+ metricsLogger, uiEventLogger, qsLogger, dumpManager, splitShadeStateController);
mTunerService = tunerService;
mQsCustomizerController = qsCustomizerController;
mQsTileRevealControllerFactory = qsTileRevealControllerFactory;
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSPanelControllerBase.java b/packages/SystemUI/src/com/android/systemui/qs/QSPanelControllerBase.java
index 20f0352..81e3a2f 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSPanelControllerBase.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSPanelControllerBase.java
@@ -40,7 +40,7 @@
import com.android.systemui.qs.external.CustomTile;
import com.android.systemui.qs.logging.QSLogger;
import com.android.systemui.qs.tileimpl.QSTileViewImpl;
-import com.android.systemui.util.LargeScreenUtils;
+import com.android.systemui.statusbar.policy.SplitShadeStateController;
import com.android.systemui.util.ViewController;
import com.android.systemui.util.animation.DisappearParameters;
@@ -86,6 +86,8 @@
private final QSHost.Callback mQSHostCallback = this::setTiles;
+ private SplitShadeStateController mSplitShadeStateController;
+
@VisibleForTesting
protected final QSPanel.OnConfigurationChangedListener mOnConfigurationChangedListener =
new QSPanel.OnConfigurationChangedListener() {
@@ -93,8 +95,8 @@
public void onConfigurationChange(Configuration newConfig) {
final boolean previousSplitShadeState = mShouldUseSplitNotificationShade;
final int previousOrientation = mLastOrientation;
- mShouldUseSplitNotificationShade =
- LargeScreenUtils.shouldUseSplitNotificationShade(getResources());
+ mShouldUseSplitNotificationShade = mSplitShadeStateController
+ .shouldUseSplitNotificationShade(getResources());
mLastOrientation = newConfig.orientation;
mQSLogger.logOnConfigurationChanged(
@@ -138,7 +140,8 @@
MetricsLogger metricsLogger,
UiEventLogger uiEventLogger,
QSLogger qsLogger,
- DumpManager dumpManager
+ DumpManager dumpManager,
+ SplitShadeStateController splitShadeStateController
) {
super(view);
mHost = host;
@@ -149,8 +152,9 @@
mUiEventLogger = uiEventLogger;
mQSLogger = qsLogger;
mDumpManager = dumpManager;
+ mSplitShadeStateController = splitShadeStateController;
mShouldUseSplitNotificationShade =
- LargeScreenUtils.shouldUseSplitNotificationShade(getResources());
+ mSplitShadeStateController.shouldUseSplitNotificationShade(getResources());
}
@Override
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QuickQSPanelController.java b/packages/SystemUI/src/com/android/systemui/qs/QuickQSPanelController.java
index 2d54313..585136a 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QuickQSPanelController.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QuickQSPanelController.java
@@ -32,6 +32,7 @@
import com.android.systemui.qs.customize.QSCustomizerController;
import com.android.systemui.qs.dagger.QSScope;
import com.android.systemui.qs.logging.QSLogger;
+import com.android.systemui.statusbar.policy.SplitShadeStateController;
import com.android.systemui.util.leak.RotationUtils;
import java.util.ArrayList;
@@ -55,10 +56,10 @@
@Named(QS_USING_COLLAPSED_LANDSCAPE_MEDIA)
Provider<Boolean> usingCollapsedLandscapeMediaProvider,
MetricsLogger metricsLogger, UiEventLogger uiEventLogger, QSLogger qsLogger,
- DumpManager dumpManager
+ DumpManager dumpManager, SplitShadeStateController splitShadeStateController
) {
super(view, qsHost, qsCustomizerController, usingMediaPlayer, mediaHost, metricsLogger,
- uiEventLogger, qsLogger, dumpManager);
+ uiEventLogger, qsLogger, dumpManager, splitShadeStateController);
mUsingCollapsedLandscapeMediaProvider = usingCollapsedLandscapeMediaProvider;
}
diff --git a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java
index 79b4791..3aa7bac 100644
--- a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java
+++ b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java
@@ -222,10 +222,10 @@
import com.android.systemui.statusbar.policy.KeyguardUserSwitcherController;
import com.android.systemui.statusbar.policy.KeyguardUserSwitcherView;
import com.android.systemui.statusbar.policy.OnHeadsUpChangedListener;
+import com.android.systemui.statusbar.policy.SplitShadeStateController;
import com.android.systemui.statusbar.window.StatusBarWindowStateController;
import com.android.systemui.unfold.SysUIUnfoldComponent;
import com.android.systemui.util.Compile;
-import com.android.systemui.util.LargeScreenUtils;
import com.android.systemui.util.Utils;
import com.android.systemui.util.time.SystemClock;
import com.android.wm.shell.animation.FlingAnimationUtils;
@@ -618,7 +618,7 @@
private int mLockscreenToDreamingTransitionTranslationY;
private int mGoneToDreamingTransitionTranslationY;
private int mLockscreenToOccludedTransitionTranslationY;
-
+ private SplitShadeStateController mSplitShadeStateController;
private final Runnable mFlingCollapseRunnable = () -> fling(0, false /* expand */,
mNextCollapseSpeedUpFactor, false /* expandBecauseOfFalsing */);
private final Runnable mAnimateKeyguardBottomAreaInvisibleEndRunnable =
@@ -776,7 +776,8 @@
ActivityStarter activityStarter,
SharedNotificationContainerInteractor sharedNotificationContainerInteractor,
KeyguardViewConfigurator keyguardViewConfigurator,
- KeyguardFaceAuthInteractor keyguardFaceAuthInteractor) {
+ KeyguardFaceAuthInteractor keyguardFaceAuthInteractor,
+ SplitShadeStateController splitShadeStateController) {
keyguardStateController.addCallback(new KeyguardStateController.Callback() {
@Override
public void onKeyguardFadingAwayChanged() {
@@ -872,8 +873,9 @@
mFragmentService = fragmentService;
mStatusBarService = statusBarService;
mSettingsChangeObserver = new SettingsChangeObserver(handler);
+ mSplitShadeStateController = splitShadeStateController;
mSplitShadeEnabled =
- LargeScreenUtils.shouldUseSplitNotificationShade(mResources);
+ mSplitShadeStateController.shouldUseSplitNotificationShade(mResources);
mView.setWillNotDraw(!DEBUG_DRAWABLE);
mShadeHeaderController = shadeHeaderController;
mLayoutInflater = layoutInflater;
@@ -1293,7 +1295,7 @@
@Override
public void updateResources() {
final boolean newSplitShadeEnabled =
- LargeScreenUtils.shouldUseSplitNotificationShade(mResources);
+ mSplitShadeStateController.shouldUseSplitNotificationShade(mResources);
final boolean splitShadeChanged = mSplitShadeEnabled != newSplitShadeEnabled;
mSplitShadeEnabled = newSplitShadeEnabled;
mQsController.updateResources();
diff --git a/packages/SystemUI/src/com/android/systemui/shade/NotificationsQSContainerController.kt b/packages/SystemUI/src/com/android/systemui/shade/NotificationsQSContainerController.kt
index 9412542..bdf114e 100644
--- a/packages/SystemUI/src/com/android/systemui/shade/NotificationsQSContainerController.kt
+++ b/packages/SystemUI/src/com/android/systemui/shade/NotificationsQSContainerController.kt
@@ -39,6 +39,7 @@
import com.android.systemui.recents.OverviewProxyService.OverviewProxyListener
import com.android.systemui.shared.system.QuickStepContract
import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayoutController
+import com.android.systemui.statusbar.policy.SplitShadeStateController
import com.android.systemui.util.LargeScreenUtils
import com.android.systemui.util.ViewController
import com.android.systemui.util.concurrency.DelayableExecutor
@@ -61,6 +62,7 @@
private val featureFlags: FeatureFlags,
private val
notificationStackScrollLayoutController: NotificationStackScrollLayoutController,
+ private val splitShadeStateController: SplitShadeStateController
) : ViewController<NotificationsQuickSettingsContainer>(view), QSContainerController {
private var qsExpanded = false
@@ -149,7 +151,8 @@
}
fun updateResources() {
- val newSplitShadeEnabled = LargeScreenUtils.shouldUseSplitNotificationShade(resources)
+ val newSplitShadeEnabled =
+ splitShadeStateController.shouldUseSplitNotificationShade(resources)
val splitShadeEnabledChanged = newSplitShadeEnabled != splitShadeEnabled
splitShadeEnabled = newSplitShadeEnabled
largeScreenShadeHeaderActive = LargeScreenUtils.shouldUseLargeScreenShadeHeader(resources)
diff --git a/packages/SystemUI/src/com/android/systemui/shade/QuickSettingsController.java b/packages/SystemUI/src/com/android/systemui/shade/QuickSettingsController.java
index b2bbffd..9a16538 100644
--- a/packages/SystemUI/src/com/android/systemui/shade/QuickSettingsController.java
+++ b/packages/SystemUI/src/com/android/systemui/shade/QuickSettingsController.java
@@ -100,6 +100,7 @@
import com.android.systemui.statusbar.phone.StatusBarTouchableRegionManager;
import com.android.systemui.statusbar.policy.CastController;
import com.android.systemui.statusbar.policy.KeyguardStateController;
+import com.android.systemui.statusbar.policy.SplitShadeStateController;
import com.android.systemui.util.LargeScreenUtils;
import com.android.systemui.util.kotlin.JavaAdapter;
@@ -150,6 +151,7 @@
private final ShadeLogger mShadeLog;
private final KeyguardFaceAuthInteractor mKeyguardFaceAuthInteractor;
private final CastController mCastController;
+ private final SplitShadeStateController mSplitShadeStateController;
private final FeatureFlags mFeatureFlags;
private final InteractionJankMonitor mInteractionJankMonitor;
private final ShadeRepository mShadeRepository;
@@ -344,14 +346,16 @@
ShadeRepository shadeRepository,
ShadeInteractor shadeInteractor,
JavaAdapter javaAdapter,
- CastController castController
+ CastController castController,
+ SplitShadeStateController splitShadeStateController
) {
mPanelViewControllerLazy = panelViewControllerLazy;
mPanelView = panelView;
mQsFrame = mPanelView.findViewById(R.id.qs_frame);
mKeyguardStatusBar = mPanelView.findViewById(R.id.keyguard_header);
mResources = mPanelView.getResources();
- mSplitShadeEnabled = LargeScreenUtils.shouldUseSplitNotificationShade(mResources);
+ mSplitShadeStateController = splitShadeStateController;
+ mSplitShadeEnabled = mSplitShadeStateController.shouldUseSplitNotificationShade(mResources);
mQsFrameTranslateController = qsFrameTranslateController;
mShadeTransitionController = shadeTransitionController;
mPulseExpansionHandler = pulseExpansionHandler;
@@ -437,7 +441,7 @@
}
void updateResources() {
- mSplitShadeEnabled = LargeScreenUtils.shouldUseSplitNotificationShade(mResources);
+ mSplitShadeEnabled = mSplitShadeStateController.shouldUseSplitNotificationShade(mResources);
if (mQs != null) {
mQs.setInSplitShade(mSplitShadeEnabled);
}
diff --git a/packages/SystemUI/src/com/android/systemui/shade/transition/LargeScreenShadeInterpolatorImpl.kt b/packages/SystemUI/src/com/android/systemui/shade/transition/LargeScreenShadeInterpolatorImpl.kt
index fd57f21..4ba5674 100644
--- a/packages/SystemUI/src/com/android/systemui/shade/transition/LargeScreenShadeInterpolatorImpl.kt
+++ b/packages/SystemUI/src/com/android/systemui/shade/transition/LargeScreenShadeInterpolatorImpl.kt
@@ -20,7 +20,7 @@
import android.content.res.Configuration
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.statusbar.policy.ConfigurationController
-import com.android.systemui.util.LargeScreenUtils
+import com.android.systemui.statusbar.policy.SplitShadeStateController
import javax.inject.Inject
/** Interpolator responsible for the shade when on large screens. */
@@ -32,6 +32,7 @@
private val context: Context,
private val splitShadeInterpolator: SplitShadeInterpolator,
private val portraitShadeInterpolator: LargeScreenPortraitShadeInterpolator,
+ private val splitShadeStateController: SplitShadeStateController
) : LargeScreenShadeInterpolator {
private var inSplitShade = false
@@ -48,7 +49,7 @@
}
private fun updateResources() {
- inSplitShade = LargeScreenUtils.shouldUseSplitNotificationShade(context.resources)
+ inSplitShade = splitShadeStateController.shouldUseSplitNotificationShade(context.resources)
}
private val impl: LargeScreenShadeInterpolator
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 ec16109..9715070 100644
--- a/packages/SystemUI/src/com/android/systemui/shade/transition/ShadeTransitionController.kt
+++ b/packages/SystemUI/src/com/android/systemui/shade/transition/ShadeTransitionController.kt
@@ -18,7 +18,6 @@
import android.content.Context
import android.content.res.Configuration
-import com.android.systemui.R
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dump.DumpManager
import com.android.systemui.plugins.qs.QS
@@ -31,6 +30,7 @@
import com.android.systemui.statusbar.SysuiStatusBarStateController
import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayoutController
import com.android.systemui.statusbar.policy.ConfigurationController
+import com.android.systemui.statusbar.policy.SplitShadeStateController
import java.io.PrintWriter
import javax.inject.Inject
@@ -45,6 +45,7 @@
private val context: Context,
private val scrimShadeTransitionController: ScrimShadeTransitionController,
private val statusBarStateController: SysuiStatusBarStateController,
+ private val splitShadeStateController: SplitShadeStateController
) {
lateinit var shadeViewController: ShadeViewController
@@ -73,7 +74,7 @@
}
private fun updateResources() {
- inSplitShade = context.resources.getBoolean(R.bool.config_use_split_notification_shade)
+ inSplitShade = splitShadeStateController.shouldUseSplitNotificationShade(context.resources)
}
private fun onPanelStateChanged(@PanelState state: Int) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/AbstractLockscreenShadeTransitionController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/AbstractLockscreenShadeTransitionController.kt
index 5b24af0..b6a633f 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/AbstractLockscreenShadeTransitionController.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/AbstractLockscreenShadeTransitionController.kt
@@ -6,14 +6,15 @@
import com.android.systemui.Dumpable
import com.android.systemui.dump.DumpManager
import com.android.systemui.statusbar.policy.ConfigurationController
-import com.android.systemui.util.LargeScreenUtils
+import com.android.systemui.statusbar.policy.SplitShadeStateController
import java.io.PrintWriter
/** An abstract implementation of a class that controls the lockscreen to shade transition. */
abstract class AbstractLockscreenShadeTransitionController(
protected val context: Context,
configurationController: ConfigurationController,
- dumpManager: DumpManager
+ dumpManager: DumpManager,
+ private val splitShadeStateController: SplitShadeStateController
) : Dumpable {
protected var useSplitShade = false
@@ -44,7 +45,8 @@
}
private fun updateResourcesInternal() {
- useSplitShade = LargeScreenUtils.shouldUseSplitNotificationShade(context.resources)
+ useSplitShade = splitShadeStateController
+ .shouldUseSplitNotificationShade(context.resources)
updateResources()
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/LockscreenShadeKeyguardTransitionController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/LockscreenShadeKeyguardTransitionController.kt
index fec6112..238317c 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/LockscreenShadeKeyguardTransitionController.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/LockscreenShadeKeyguardTransitionController.kt
@@ -8,6 +8,7 @@
import com.android.systemui.media.controls.ui.MediaHierarchyManager
import com.android.systemui.shade.ShadeViewController
import com.android.systemui.statusbar.policy.ConfigurationController
+import com.android.systemui.statusbar.policy.SplitShadeStateController
import dagger.assisted.Assisted
import dagger.assisted.AssistedFactory
import dagger.assisted.AssistedInject
@@ -16,12 +17,14 @@
class LockscreenShadeKeyguardTransitionController
@AssistedInject
constructor(
- private val mediaHierarchyManager: MediaHierarchyManager,
- @Assisted private val notificationPanelController: ShadeViewController,
- context: Context,
- configurationController: ConfigurationController,
- dumpManager: DumpManager
-) : AbstractLockscreenShadeTransitionController(context, configurationController, dumpManager) {
+ private val mediaHierarchyManager: MediaHierarchyManager,
+ @Assisted private val notificationPanelController: ShadeViewController,
+ context: Context,
+ configurationController: ConfigurationController,
+ dumpManager: DumpManager,
+ splitShadeStateController: SplitShadeStateController
+) : AbstractLockscreenShadeTransitionController(context, configurationController, dumpManager,
+ splitShadeStateController) {
/**
* Distance that the full shade transition takes in order for the keyguard content on
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/LockscreenShadeQsTransitionController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/LockscreenShadeQsTransitionController.kt
index df8c6ab..5f3d757 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/LockscreenShadeQsTransitionController.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/LockscreenShadeQsTransitionController.kt
@@ -25,6 +25,7 @@
import com.android.systemui.dump.DumpManager
import com.android.systemui.plugins.qs.QS
import com.android.systemui.statusbar.policy.ConfigurationController
+import com.android.systemui.statusbar.policy.SplitShadeStateController
import dagger.assisted.Assisted
import dagger.assisted.AssistedFactory
import dagger.assisted.AssistedInject
@@ -38,7 +39,14 @@
configurationController: ConfigurationController,
dumpManager: DumpManager,
@Assisted private val qsProvider: () -> QS,
-) : AbstractLockscreenShadeTransitionController(context, configurationController, dumpManager) {
+ splitShadeStateController: SplitShadeStateController
+) :
+ AbstractLockscreenShadeTransitionController(
+ context,
+ configurationController,
+ dumpManager,
+ splitShadeStateController
+ ) {
private val qs: QS
get() = qsProvider()
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/LockscreenShadeScrimTransitionController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/LockscreenShadeScrimTransitionController.kt
index 00d3701..af4a1aa 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/LockscreenShadeScrimTransitionController.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/LockscreenShadeScrimTransitionController.kt
@@ -7,6 +7,7 @@
import com.android.systemui.dump.DumpManager
import com.android.systemui.statusbar.phone.ScrimController
import com.android.systemui.statusbar.policy.ConfigurationController
+import com.android.systemui.statusbar.policy.SplitShadeStateController
import javax.inject.Inject
/** Controls the lockscreen to shade transition for scrims. */
@@ -16,8 +17,10 @@
private val scrimController: ScrimController,
context: Context,
configurationController: ConfigurationController,
- dumpManager: DumpManager
-) : AbstractLockscreenShadeTransitionController(context, configurationController, dumpManager) {
+ dumpManager: DumpManager,
+ splitShadeStateController: SplitShadeStateController
+) : AbstractLockscreenShadeTransitionController(context, configurationController, dumpManager,
+ splitShadeStateController) {
/**
* Distance that the full shade transition takes in order for scrim to fully transition to the
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/LockscreenShadeTransitionController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/LockscreenShadeTransitionController.kt
index 73bbbca..29ca0f4 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/LockscreenShadeTransitionController.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/LockscreenShadeTransitionController.kt
@@ -42,7 +42,7 @@
import com.android.systemui.statusbar.phone.KeyguardBypassController
import com.android.systemui.statusbar.phone.LSShadeTransitionLogger
import com.android.systemui.statusbar.policy.ConfigurationController
-import com.android.systemui.util.LargeScreenUtils
+import com.android.systemui.statusbar.policy.SplitShadeStateController
import com.android.wm.shell.animation.Interpolators
import java.io.PrintWriter
import javax.inject.Inject
@@ -79,6 +79,7 @@
private val shadeRepository: ShadeRepository,
private val shadeInteractor: ShadeInteractor,
private val powerInteractor: PowerInteractor,
+ private val splitShadeStateController: SplitShadeStateController
) : Dumpable {
private var pulseHeight: Float = 0f
@@ -267,7 +268,9 @@
R.dimen.lockscreen_shade_udfps_keyguard_transition_distance)
statusBarTransitionDistance = context.resources.getDimensionPixelSize(
R.dimen.lockscreen_shade_status_bar_transition_distance)
- useSplitShade = LargeScreenUtils.shouldUseSplitNotificationShade(context.resources)
+
+ useSplitShade = splitShadeStateController
+ .shouldUseSplitNotificationShade(context.resources)
}
fun setStackScroller(nsslController: NotificationStackScrollLayoutController) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt
index 59c63aa..5c45f3d 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt
@@ -46,7 +46,7 @@
import com.android.systemui.statusbar.phone.ScrimController
import com.android.systemui.statusbar.policy.ConfigurationController
import com.android.systemui.statusbar.policy.KeyguardStateController
-import com.android.systemui.util.LargeScreenUtils
+import com.android.systemui.statusbar.policy.SplitShadeStateController
import com.android.systemui.util.WallpaperController
import java.io.PrintWriter
import javax.inject.Inject
@@ -67,6 +67,7 @@
private val notificationShadeWindowController: NotificationShadeWindowController,
private val dozeParameters: DozeParameters,
private val context: Context,
+ private val splitShadeStateController: SplitShadeStateController,
dumpManager: DumpManager,
configurationController: ConfigurationController
) : ShadeExpansionListener, Dumpable {
@@ -329,7 +330,7 @@
}
private fun updateResources() {
- inSplitShade = LargeScreenUtils.shouldUseSplitNotificationShade(context.resources)
+ inSplitShade = splitShadeStateController.shouldUseSplitNotificationShade(context.resources)
}
fun addListener(listener: DepthListener) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java
index d934f6e..e8521d1 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java
@@ -118,9 +118,9 @@
import com.android.systemui.statusbar.phone.ScreenOffAnimationController;
import com.android.systemui.statusbar.policy.HeadsUpUtil;
import com.android.systemui.statusbar.policy.ScrollAdapter;
+import com.android.systemui.statusbar.policy.SplitShadeStateController;
import com.android.systemui.util.Assert;
import com.android.systemui.util.DumpUtilsKt;
-import com.android.systemui.util.LargeScreenUtils;
import com.google.errorprone.annotations.CompileTimeConstant;
@@ -568,6 +568,13 @@
private final ScreenOffAnimationController mScreenOffAnimationController;
private boolean mShouldUseSplitNotificationShade;
private boolean mHasFilteredOutSeenNotifications;
+ @Nullable private SplitShadeStateController mSplitShadeStateController = null;
+
+ /** Pass splitShadeStateController to view and update split shade */
+ public void passSplitShadeStateController(SplitShadeStateController splitShadeStateController) {
+ mSplitShadeStateController = splitShadeStateController;
+ updateSplitNotificationShade();
+ }
private final ExpandableView.OnHeightChangedListener mOnChildHeightChangedListener =
new ExpandableView.OnHeightChangedListener() {
@@ -630,7 +637,6 @@
mSectionsManager = Dependency.get(NotificationSectionsManager.class);
mScreenOffAnimationController =
Dependency.get(ScreenOffAnimationController.class);
- updateSplitNotificationShade();
mSectionsManager.initialize(this);
mSections = mSectionsManager.createSectionsForBuckets();
@@ -5666,7 +5672,7 @@
@VisibleForTesting
void updateSplitNotificationShade() {
- boolean split = LargeScreenUtils.shouldUseSplitNotificationShade(getResources());
+ boolean split = mSplitShadeStateController.shouldUseSplitNotificationShade(getResources());
if (split != mShouldUseSplitNotificationShade) {
mShouldUseSplitNotificationShade = split;
updateDismissBehavior();
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java
index 80c0c9e..b051809 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java
@@ -128,6 +128,7 @@
import com.android.systemui.statusbar.policy.DeviceProvisionedController;
import com.android.systemui.statusbar.policy.DeviceProvisionedController.DeviceProvisionedListener;
import com.android.systemui.statusbar.policy.OnHeadsUpChangedListener;
+import com.android.systemui.statusbar.policy.SplitShadeStateController;
import com.android.systemui.statusbar.policy.ZenModeController;
import com.android.systemui.tuner.TunerService;
import com.android.systemui.util.Compile;
@@ -672,7 +673,8 @@
NotificationTargetsHelper notificationTargetsHelper,
SecureSettings secureSettings,
NotificationDismissibilityProvider dismissibilityProvider,
- ActivityStarter activityStarter) {
+ ActivityStarter activityStarter,
+ SplitShadeStateController splitShadeStateController) {
mView = view;
mKeyguardTransitionRepo = keyguardTransitionRepo;
mStackStateLogger = stackLogger;
@@ -722,6 +724,7 @@
mSecureSettings = secureSettings;
mDismissibilityProvider = dismissibilityProvider;
mActivityStarter = activityStarter;
+ mView.passSplitShadeStateController(splitShadeStateController);
updateResources();
setUpView();
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackSizeCalculator.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackSizeCalculator.kt
index c7cb70c..24104d2 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackSizeCalculator.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackSizeCalculator.kt
@@ -29,8 +29,8 @@
import com.android.systemui.statusbar.SysuiStatusBarStateController
import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow
import com.android.systemui.statusbar.notification.row.ExpandableView
+import com.android.systemui.statusbar.policy.SplitShadeStateController
import com.android.systemui.util.Compile
-import com.android.systemui.util.LargeScreenUtils.shouldUseSplitNotificationShade
import com.android.systemui.util.children
import java.io.PrintWriter
import javax.inject.Inject
@@ -54,7 +54,8 @@
private val statusBarStateController: SysuiStatusBarStateController,
private val lockscreenShadeTransitionController: LockscreenShadeTransitionController,
private val mediaDataManager: MediaDataManager,
- @Main private val resources: Resources
+ @Main private val resources: Resources,
+ private val splitShadeStateController: SplitShadeStateController
) {
/**
@@ -181,7 +182,8 @@
// How many notifications we can show at heightWithoutLockscreenConstraints
var minCountAtHeightWithoutConstraints =
- if (isMediaShowing && !shouldUseSplitNotificationShade(resources)) 2 else 1
+ if (isMediaShowing && !splitShadeStateController
+ .shouldUseSplitNotificationShade(resources)) 2 else 1
log {
"\t---maxNotifWithoutSavingSpace=$maxNotifWithoutSavingSpace " +
"isMediaShowing=$isMediaShowing" +
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/domain/interactor/SharedNotificationContainerInteractor.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/domain/interactor/SharedNotificationContainerInteractor.kt
index 4ed31c2..51b6c75 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/domain/interactor/SharedNotificationContainerInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/domain/interactor/SharedNotificationContainerInteractor.kt
@@ -21,6 +21,7 @@
import com.android.systemui.R
import com.android.systemui.common.ui.data.repository.ConfigurationRepository
import com.android.systemui.dagger.SysUISingleton
+import com.android.systemui.statusbar.policy.SplitShadeStateController
import javax.inject.Inject
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.MutableStateFlow
@@ -36,6 +37,7 @@
constructor(
configurationRepository: ConfigurationRepository,
private val context: Context,
+ private val splitShadeStateController: SplitShadeStateController
) {
private val _topPosition = MutableStateFlow(0f)
@@ -47,7 +49,10 @@
.map { _ ->
with(context.resources) {
ConfigurationBasedDimensions(
- useSplitShade = getBoolean(R.bool.config_use_split_notification_shade),
+ useSplitShade =
+ splitShadeStateController.shouldUseSplitNotificationShade(
+ context.resources
+ ),
useLargeScreenHeader =
getBoolean(R.bool.config_use_large_screen_shade_header),
marginHorizontal =
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputQuickSettingsDisabler.kt b/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputQuickSettingsDisabler.kt
index d5f2d21..67a8e3d 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputQuickSettingsDisabler.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputQuickSettingsDisabler.kt
@@ -20,7 +20,6 @@
import android.content.res.Configuration
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.statusbar.CommandQueue
-import com.android.systemui.util.LargeScreenUtils
import javax.inject.Inject
/**
@@ -30,9 +29,10 @@
*/
@SysUISingleton
class RemoteInputQuickSettingsDisabler @Inject constructor(
- private val context: Context,
- private val commandQueue: CommandQueue,
- configController: ConfigurationController
+ private val context: Context,
+ private val commandQueue: CommandQueue,
+ private val splitShadeStateController: SplitShadeStateController,
+ configController: ConfigurationController
) : ConfigurationController.ConfigurationListener {
private var remoteInputActive = false
@@ -43,7 +43,7 @@
isLandscape =
context.resources.configuration.orientation == Configuration.ORIENTATION_LANDSCAPE
shouldUseSplitNotificationShade =
- LargeScreenUtils.shouldUseSplitNotificationShade(context.resources)
+ splitShadeStateController.shouldUseSplitNotificationShade(context.resources)
configController.addCallback(this)
}
@@ -74,7 +74,8 @@
needToRecompute = true
}
- val newSplitShadeFlag = LargeScreenUtils.shouldUseSplitNotificationShade(context.resources)
+ val newSplitShadeFlag = splitShadeStateController
+ .shouldUseSplitNotificationShade(context.resources)
if (newSplitShadeFlag != shouldUseSplitNotificationShade) {
shouldUseSplitNotificationShade = newSplitShadeFlag
needToRecompute = true
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/ResourcesSplitShadeStateController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/policy/ResourcesSplitShadeStateController.kt
new file mode 100644
index 0000000..e71c972
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/ResourcesSplitShadeStateController.kt
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.systemui.statusbar.policy
+
+import android.content.res.Resources
+import com.android.systemui.R
+
+/**
+ * Fake SplitShadeStateController
+ *
+ * Identical behaviour to legacy implementation (that used LargeScreenUtils.kt) I.E., behaviour
+ * based solely on resources, no extra flag logic.
+ */
+class ResourcesSplitShadeStateController : SplitShadeStateController {
+ override fun shouldUseSplitNotificationShade(resources: Resources): Boolean {
+ return resources.getBoolean(R.bool.config_use_split_notification_shade)
+ }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/SplitShadeStateController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/policy/SplitShadeStateController.kt
new file mode 100644
index 0000000..f64d4c6
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/SplitShadeStateController.kt
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.systemui.statusbar.policy
+
+import android.content.res.Resources
+
+/** Source of truth for split shade state: should or should not use split shade. */
+interface SplitShadeStateController {
+ /** Returns true if the device should use the split notification shade. */
+ fun shouldUseSplitNotificationShade(resources: Resources): Boolean
+}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/SplitShadeStateControllerImpl.kt b/packages/SystemUI/src/com/android/systemui/statusbar/policy/SplitShadeStateControllerImpl.kt
new file mode 100644
index 0000000..ab4a8af
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/SplitShadeStateControllerImpl.kt
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.systemui.statusbar.policy
+
+import android.content.res.Resources
+import com.android.systemui.R
+import com.android.systemui.dagger.SysUISingleton
+import com.android.systemui.flags.FeatureFlags
+import com.android.systemui.flags.Flags
+import javax.inject.Inject
+
+/**
+ * Source of truth for split shade state: should or should not use split shade based on orientation,
+ * screen width, and flags.
+ */
+@SysUISingleton
+class SplitShadeStateControllerImpl @Inject constructor(private val featureFlags: FeatureFlags) :
+ SplitShadeStateController {
+ /**
+ * Returns true if the device should use the split notification shade. Based on orientation,
+ * screen width, and flags.
+ */
+ override fun shouldUseSplitNotificationShade(resources: Resources): Boolean {
+ return (resources.getBoolean(R.bool.config_use_split_notification_shade) ||
+ (featureFlags.isEnabled(Flags.LOCKSCREEN_ENABLE_LANDSCAPE) &&
+ resources.getBoolean(R.bool.force_config_use_split_notification_shade)))
+ }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/dagger/StatusBarPolicyModule.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/dagger/StatusBarPolicyModule.java
index de07a48..927024f 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/dagger/StatusBarPolicyModule.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/dagger/StatusBarPolicyModule.java
@@ -60,6 +60,8 @@
import com.android.systemui.statusbar.policy.RotationLockControllerImpl;
import com.android.systemui.statusbar.policy.SecurityController;
import com.android.systemui.statusbar.policy.SecurityControllerImpl;
+import com.android.systemui.statusbar.policy.SplitShadeStateController;
+import com.android.systemui.statusbar.policy.SplitShadeStateControllerImpl;
import com.android.systemui.statusbar.policy.UserInfoController;
import com.android.systemui.statusbar.policy.UserInfoControllerImpl;
import com.android.systemui.statusbar.policy.WalletController;
@@ -113,6 +115,11 @@
/** */
@Binds
+ SplitShadeStateController provideSplitShadeStateController(
+ SplitShadeStateControllerImpl splitShadeStateControllerImpl);
+
+ /** */
+ @Binds
HotspotController provideHotspotController(HotspotControllerImpl controllerImpl);
/** */
diff --git a/packages/SystemUI/src/com/android/systemui/util/LargeScreenUtils.kt b/packages/SystemUI/src/com/android/systemui/util/LargeScreenUtils.kt
index 8b29310..9b241a7 100644
--- a/packages/SystemUI/src/com/android/systemui/util/LargeScreenUtils.kt
+++ b/packages/SystemUI/src/com/android/systemui/util/LargeScreenUtils.kt
@@ -4,16 +4,6 @@
import com.android.systemui.R
object LargeScreenUtils {
-
- /**
- * Returns true if the device should use the split notification shade, based on orientation and
- * screen width.
- */
- @JvmStatic
- fun shouldUseSplitNotificationShade(resources: Resources): Boolean {
- return resources.getBoolean(R.bool.config_use_split_notification_shade)
- }
-
/**
* Returns true if we should use large screen shade header:
* [com.android.systemui.statusbar.phone.LargeScreenShadeHeaderController]
diff --git a/packages/SystemUI/tests/src/com/android/systemui/biometrics/AuthDialogPanelInteractionDetectorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/biometrics/AuthDialogPanelInteractionDetectorTest.kt
index 2bb3785..8fc63b2 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/biometrics/AuthDialogPanelInteractionDetectorTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/biometrics/AuthDialogPanelInteractionDetectorTest.kt
@@ -36,6 +36,7 @@
import com.android.systemui.statusbar.notification.stack.domain.interactor.SharedNotificationContainerInteractor
import com.android.systemui.statusbar.pipeline.mobile.data.repository.FakeUserSetupRepository
import com.android.systemui.statusbar.policy.DeviceProvisionedController
+import com.android.systemui.statusbar.policy.ResourcesSplitShadeStateController
import com.android.systemui.telephony.data.repository.FakeTelephonyRepository
import com.android.systemui.telephony.domain.interactor.TelephonyInteractor
import com.android.systemui.user.data.repository.FakeUserRepository
@@ -72,6 +73,7 @@
SharedNotificationContainerInteractor(
configurationRepository,
mContext,
+ ResourcesSplitShadeStateController()
)
private lateinit var detector: AuthDialogPanelInteractionDetector
diff --git a/packages/SystemUI/tests/src/com/android/systemui/media/controls/ui/KeyguardMediaControllerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/media/controls/ui/KeyguardMediaControllerTest.kt
index 91b0245..7ad2ce8 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/media/controls/ui/KeyguardMediaControllerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/media/controls/ui/KeyguardMediaControllerTest.kt
@@ -30,6 +30,7 @@
import com.android.systemui.statusbar.notification.stack.MediaContainerView
import com.android.systemui.statusbar.phone.KeyguardBypassController
import com.android.systemui.statusbar.policy.ConfigurationController
+import com.android.systemui.statusbar.policy.ResourcesSplitShadeStateController
import com.android.systemui.util.animation.UniqueObjectHostView
import com.android.systemui.util.mockito.whenever
import com.android.systemui.util.settings.FakeSettings
@@ -90,6 +91,7 @@
settings,
fakeHandler,
configurationController,
+ ResourcesSplitShadeStateController()
)
keyguardMediaController.attachSinglePaneContainer(mediaContainerView)
keyguardMediaController.useSplitShade = false
diff --git a/packages/SystemUI/tests/src/com/android/systemui/media/controls/ui/MediaHierarchyManagerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/media/controls/ui/MediaHierarchyManagerTest.kt
index 2ce236d..33ed01f 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/media/controls/ui/MediaHierarchyManagerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/media/controls/ui/MediaHierarchyManagerTest.kt
@@ -38,6 +38,7 @@
import com.android.systemui.statusbar.phone.KeyguardBypassController
import com.android.systemui.statusbar.policy.FakeConfigurationController
import com.android.systemui.statusbar.policy.KeyguardStateController
+import com.android.systemui.statusbar.policy.ResourcesSplitShadeStateController
import com.android.systemui.util.animation.UniqueObjectHostView
import com.android.systemui.util.mockito.any
import com.android.systemui.util.mockito.mock
@@ -120,6 +121,7 @@
notifPanelEvents,
settings,
fakeHandler,
+ ResourcesSplitShadeStateController()
)
verify(wakefulnessLifecycle).addObserver(wakefullnessObserver.capture())
verify(statusBarStateController).addCallback(statusBarCallback.capture())
diff --git a/packages/SystemUI/tests/src/com/android/systemui/qs/QSFragmentTest.java b/packages/SystemUI/tests/src/com/android/systemui/qs/QSFragmentTest.java
index fcda5f5..8afe095 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/qs/QSFragmentTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/qs/QSFragmentTest.java
@@ -66,6 +66,7 @@
import com.android.systemui.statusbar.SysuiStatusBarStateController;
import com.android.systemui.statusbar.phone.KeyguardBypassController;
import com.android.systemui.statusbar.policy.ConfigurationController;
+import com.android.systemui.statusbar.policy.ResourcesSplitShadeStateController;
import com.android.systemui.statusbar.policy.RemoteInputQuickSettingsDisabler;
import com.android.systemui.util.animation.UniqueObjectHostView;
@@ -524,7 +525,10 @@
return new QSFragment(
new RemoteInputQuickSettingsDisabler(
- context, commandQueue, mock(ConfigurationController.class)),
+ context,
+ commandQueue,
+ new ResourcesSplitShadeStateController(),
+ mock(ConfigurationController.class)),
mStatusBarStateController,
commandQueue,
mQSMediaHost,
diff --git a/packages/SystemUI/tests/src/com/android/systemui/qs/QSPanelControllerBaseTest.java b/packages/SystemUI/tests/src/com/android/systemui/qs/QSPanelControllerBaseTest.java
index 6720dae..2ac220c 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/qs/QSPanelControllerBaseTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/qs/QSPanelControllerBaseTest.java
@@ -50,6 +50,7 @@
import com.android.systemui.qs.customize.QSCustomizerController;
import com.android.systemui.qs.logging.QSLogger;
import com.android.systemui.qs.tileimpl.QSTileImpl;
+import com.android.systemui.statusbar.policy.ResourcesSplitShadeStateController;
import com.android.systemui.util.animation.DisappearParameters;
import org.junit.Before;
@@ -110,7 +111,7 @@
MetricsLogger metricsLogger, UiEventLogger uiEventLogger, QSLogger qsLogger,
DumpManager dumpManager) {
super(view, host, qsCustomizerController, true, mediaHost, metricsLogger, uiEventLogger,
- qsLogger, dumpManager);
+ qsLogger, dumpManager, new ResourcesSplitShadeStateController());
}
@Override
diff --git a/packages/SystemUI/tests/src/com/android/systemui/qs/QSPanelControllerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/qs/QSPanelControllerTest.kt
index 9d9d0c7..8a530dd 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/qs/QSPanelControllerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/qs/QSPanelControllerTest.kt
@@ -18,6 +18,7 @@
import com.android.systemui.settings.brightness.BrightnessController
import com.android.systemui.settings.brightness.BrightnessSliderController
import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager
+import com.android.systemui.statusbar.policy.ResourcesSplitShadeStateController
import com.android.systemui.tuner.TunerService
import com.google.common.truth.Truth.assertThat
import org.junit.After
@@ -91,7 +92,8 @@
brightnessControllerFactory,
brightnessSliderFactory,
falsingManager,
- statusBarKeyguardViewManager
+ statusBarKeyguardViewManager,
+ ResourcesSplitShadeStateController()
)
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/qs/QuickQSPanelControllerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/qs/QuickQSPanelControllerTest.kt
index 71ea831..f188b4e 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/qs/QuickQSPanelControllerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/qs/QuickQSPanelControllerTest.kt
@@ -29,6 +29,7 @@
import com.android.systemui.plugins.qs.QSTileView
import com.android.systemui.qs.customize.QSCustomizerController
import com.android.systemui.qs.logging.QSLogger
+import com.android.systemui.statusbar.policy.ResourcesSplitShadeStateController
import com.android.systemui.util.leak.RotationUtils
import org.junit.After
import org.junit.Before
@@ -167,7 +168,8 @@
metricsLogger,
uiEventLogger,
qsLogger,
- dumpManager) {
+ dumpManager,
+ ResourcesSplitShadeStateController()) {
private var rotation = RotationUtils.ROTATION_NONE
diff --git a/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerBaseTest.java b/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerBaseTest.java
index 74e917d..13bf53b 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerBaseTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerBaseTest.java
@@ -172,6 +172,7 @@
import com.android.systemui.statusbar.policy.KeyguardStateController;
import com.android.systemui.statusbar.policy.KeyguardUserSwitcherController;
import com.android.systemui.statusbar.policy.KeyguardUserSwitcherView;
+import com.android.systemui.statusbar.policy.ResourcesSplitShadeStateController;
import com.android.systemui.statusbar.window.StatusBarWindowStateController;
import com.android.systemui.unfold.SysUIUnfoldComponent;
import com.android.systemui.util.kotlin.JavaAdapter;
@@ -658,7 +659,8 @@
mActivityStarter,
mSharedNotificationContainerInteractor,
mKeyguardViewConfigurator,
- mKeyguardFaceAuthInteractor);
+ mKeyguardFaceAuthInteractor,
+ new ResourcesSplitShadeStateController());
mNotificationPanelViewController.initDependencies(
mCentralSurfaces,
null,
@@ -730,7 +732,8 @@
mShadeRepository,
mShadeInteractor,
mJavaAdapter,
- mCastController
+ mCastController,
+ new ResourcesSplitShadeStateController()
);
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationsQSContainerControllerLegacyTest.kt b/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationsQSContainerControllerLegacyTest.kt
index 577b6e0..36cf1d9 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationsQSContainerControllerLegacyTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationsQSContainerControllerLegacyTest.kt
@@ -39,6 +39,7 @@
import com.android.systemui.recents.OverviewProxyService
import com.android.systemui.recents.OverviewProxyService.OverviewProxyListener
import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayoutController
+import com.android.systemui.statusbar.policy.ResourcesSplitShadeStateController
import com.android.systemui.util.concurrency.FakeExecutor
import com.android.systemui.util.mockito.capture
import com.android.systemui.util.mockito.whenever
@@ -118,6 +119,7 @@
delayableExecutor,
featureFlags,
notificationStackScrollLayoutController,
+ ResourcesSplitShadeStateController()
)
overrideResource(R.dimen.split_shade_notifications_scrim_margin_bottom, SCRIM_MARGIN)
@@ -474,6 +476,7 @@
delayableExecutor,
featureFlags,
notificationStackScrollLayoutController,
+ ResourcesSplitShadeStateController()
)
controller.updateConstraints()
diff --git a/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationsQSContainerControllerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationsQSContainerControllerTest.kt
index 405199e..090bee2 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationsQSContainerControllerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationsQSContainerControllerTest.kt
@@ -39,6 +39,7 @@
import com.android.systemui.recents.OverviewProxyService
import com.android.systemui.recents.OverviewProxyService.OverviewProxyListener
import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayoutController
+import com.android.systemui.statusbar.policy.ResourcesSplitShadeStateController
import com.android.systemui.util.concurrency.FakeExecutor
import com.android.systemui.util.mockito.capture
import com.android.systemui.util.mockito.whenever
@@ -117,6 +118,7 @@
delayableExecutor,
featureFlags,
notificationStackScrollLayoutController,
+ ResourcesSplitShadeStateController()
)
overrideResource(R.dimen.split_shade_notifications_scrim_margin_bottom, SCRIM_MARGIN)
@@ -457,6 +459,7 @@
delayableExecutor,
featureFlags,
notificationStackScrollLayoutController,
+ ResourcesSplitShadeStateController()
)
controller.updateConstraints()
diff --git a/packages/SystemUI/tests/src/com/android/systemui/shade/QuickSettingsControllerBaseTest.java b/packages/SystemUI/tests/src/com/android/systemui/shade/QuickSettingsControllerBaseTest.java
index 46b636b..849127e 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/shade/QuickSettingsControllerBaseTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/shade/QuickSettingsControllerBaseTest.java
@@ -75,6 +75,7 @@
import com.android.systemui.statusbar.pipeline.mobile.data.repository.FakeUserSetupRepository;
import com.android.systemui.statusbar.policy.CastController;
import com.android.systemui.statusbar.policy.DeviceProvisionedController;
+import com.android.systemui.statusbar.policy.ResourcesSplitShadeStateController;
import com.android.systemui.statusbar.policy.KeyguardStateController;
import com.android.systemui.user.domain.interactor.UserInteractor;
import com.android.systemui.util.kotlin.JavaAdapter;
@@ -182,7 +183,8 @@
mUserInteractor,
new SharedNotificationContainerInteractor(
new FakeConfigurationRepository(),
- mContext),
+ mContext,
+ new ResourcesSplitShadeStateController()),
mShadeRepository
);
@@ -260,7 +262,8 @@
mShadeRepository,
mShadeInteractor,
new JavaAdapter(mTestScope.getBackgroundScope()),
- mCastController
+ mCastController,
+ new ResourcesSplitShadeStateController()
);
mQsController.init();
diff --git a/packages/SystemUI/tests/src/com/android/systemui/shade/data/repository/ShadeInteractorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/shade/data/repository/ShadeInteractorTest.kt
index dd6ab73..9275ccb 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/shade/data/repository/ShadeInteractorTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/shade/data/repository/ShadeInteractorTest.kt
@@ -45,6 +45,7 @@
import com.android.systemui.statusbar.notification.stack.domain.interactor.SharedNotificationContainerInteractor
import com.android.systemui.statusbar.pipeline.mobile.data.repository.FakeUserSetupRepository
import com.android.systemui.statusbar.policy.DeviceProvisionedController
+import com.android.systemui.statusbar.policy.ResourcesSplitShadeStateController
import com.android.systemui.telephony.data.repository.FakeTelephonyRepository
import com.android.systemui.telephony.domain.interactor.TelephonyInteractor
import com.android.systemui.user.data.model.UserSwitcherSettingsModel
@@ -85,6 +86,7 @@
SharedNotificationContainerInteractor(
configurationRepository,
mContext,
+ ResourcesSplitShadeStateController()
)
@Mock private lateinit var manager: UserManager
diff --git a/packages/SystemUI/tests/src/com/android/systemui/shade/transition/LargeScreenShadeInterpolatorImplTest.kt b/packages/SystemUI/tests/src/com/android/systemui/shade/transition/LargeScreenShadeInterpolatorImplTest.kt
index 8309342..36f82c2 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/shade/transition/LargeScreenShadeInterpolatorImplTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/shade/transition/LargeScreenShadeInterpolatorImplTest.kt
@@ -5,6 +5,7 @@
import com.android.systemui.R
import com.android.systemui.SysuiTestCase
import com.android.systemui.statusbar.policy.FakeConfigurationController
+import com.android.systemui.statusbar.policy.ResourcesSplitShadeStateController
import com.google.common.truth.Expect
import org.junit.Rule
import org.junit.Test
@@ -23,7 +24,8 @@
configurationController,
context,
splitShadeInterpolator,
- portraitShadeInterpolator
+ portraitShadeInterpolator,
+ ResourcesSplitShadeStateController()
)
@Test
diff --git a/packages/SystemUI/tests/src/com/android/systemui/shade/transition/ShadeTransitionControllerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/shade/transition/ShadeTransitionControllerTest.kt
index d5a1f80..7737b43 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/shade/transition/ShadeTransitionControllerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/shade/transition/ShadeTransitionControllerTest.kt
@@ -9,6 +9,7 @@
import com.android.systemui.shade.ShadeExpansionStateManager
import com.android.systemui.statusbar.SysuiStatusBarStateController
import com.android.systemui.statusbar.policy.FakeConfigurationController
+import com.android.systemui.statusbar.policy.ResourcesSplitShadeStateController
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
@@ -41,6 +42,7 @@
context,
scrimShadeTransitionController,
statusBarStateController,
+ ResourcesSplitShadeStateController()
)
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/LockscreenShadeQsTransitionControllerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/LockscreenShadeQsTransitionControllerTest.kt
index 7041262..673d63f 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/LockscreenShadeQsTransitionControllerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/LockscreenShadeQsTransitionControllerTest.kt
@@ -23,6 +23,7 @@
import com.android.systemui.dump.DumpManager
import com.android.systemui.plugins.qs.QS
import com.android.systemui.statusbar.policy.FakeConfigurationController
+import com.android.systemui.statusbar.policy.ResourcesSplitShadeStateController
import com.google.common.truth.Expect
import com.google.common.truth.Truth.assertThat
import org.junit.Before
@@ -59,7 +60,8 @@
context,
configurationController,
dumpManager,
- qsProvider = { qS }
+ qsProvider = { qS },
+ ResourcesSplitShadeStateController()
)
}
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 2446234..2c9dfcc 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/LockscreenShadeTransitionControllerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/LockscreenShadeTransitionControllerTest.kt
@@ -39,6 +39,7 @@
import com.android.systemui.statusbar.phone.ScrimController
import com.android.systemui.statusbar.pipeline.mobile.data.repository.FakeUserSetupRepository
import com.android.systemui.statusbar.policy.FakeConfigurationController
+import com.android.systemui.statusbar.policy.ResourcesSplitShadeStateController
import com.android.systemui.util.mockito.mock
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.test.runCurrent
@@ -110,6 +111,7 @@
private val sharedNotificationContainerInteractor = SharedNotificationContainerInteractor(
configurationRepository,
mContext,
+ ResourcesSplitShadeStateController()
)
private val shadeInteractor =
ShadeInteractor(
@@ -172,7 +174,8 @@
scrimController,
context,
configurationController,
- dumpManager
+ dumpManager,
+ ResourcesSplitShadeStateController()
),
keyguardTransitionControllerFactory = { notificationPanelController ->
LockscreenShadeKeyguardTransitionController(
@@ -180,7 +183,8 @@
notificationPanelController,
context,
configurationController,
- dumpManager
+ dumpManager,
+ ResourcesSplitShadeStateController()
)
},
qsTransitionControllerFactory = { qsTransitionController },
@@ -188,6 +192,7 @@
shadeRepository = FakeShadeRepository(),
shadeInteractor = shadeInteractor,
powerInteractor = powerInteractor,
+ splitShadeStateController = ResourcesSplitShadeStateController()
)
transitionController.addCallback(transitionControllerCallback)
whenever(nsslController.view).thenReturn(stackscroller)
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationShadeDepthControllerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationShadeDepthControllerTest.kt
index c49f179..a258f67 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationShadeDepthControllerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationShadeDepthControllerTest.kt
@@ -33,6 +33,7 @@
import com.android.systemui.statusbar.phone.DozeParameters
import com.android.systemui.statusbar.phone.ScrimController
import com.android.systemui.statusbar.policy.FakeConfigurationController
+import com.android.systemui.statusbar.policy.ResourcesSplitShadeStateController
import com.android.systemui.statusbar.policy.KeyguardStateController
import com.android.systemui.util.WallpaperController
import com.android.systemui.util.mockito.eq
@@ -114,8 +115,9 @@
notificationShadeWindowController,
dozeParameters,
context,
+ ResourcesSplitShadeStateController(),
dumpManager,
- configurationController)
+ configurationController,)
notificationShadeDepthController.shadeAnimation = shadeAnimation
notificationShadeDepthController.brightnessMirrorSpring = brightnessSpring
notificationShadeDepthController.root = root
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/disableflags/data/repository/DisableFlagsRepositoryTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/disableflags/data/repository/DisableFlagsRepositoryTest.kt
index 580463a..88ddc2d 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/disableflags/data/repository/DisableFlagsRepositoryTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/disableflags/data/repository/DisableFlagsRepositoryTest.kt
@@ -31,6 +31,7 @@
import com.android.systemui.statusbar.disableflags.data.model.DisableFlagsModel
import com.android.systemui.statusbar.policy.ConfigurationController
import com.android.systemui.statusbar.policy.RemoteInputQuickSettingsDisabler
+import com.android.systemui.statusbar.policy.ResourcesSplitShadeStateController
import com.android.systemui.util.mockito.any
import com.android.systemui.util.mockito.argumentCaptor
import com.android.systemui.util.mockito.mock
@@ -56,6 +57,7 @@
RemoteInputQuickSettingsDisabler(
context,
commandQueue,
+ ResourcesSplitShadeStateController(),
configurationController,
)
private val logBuffer = LogBufferFactory(DumpManager(), mock()).create("buffer", 10)
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutControllerTest.java
index 79cf932..b3f5ea2 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutControllerTest.java
@@ -95,6 +95,7 @@
import com.android.systemui.statusbar.phone.ScrimController;
import com.android.systemui.statusbar.policy.ConfigurationController;
import com.android.systemui.statusbar.policy.DeviceProvisionedController;
+import com.android.systemui.statusbar.policy.ResourcesSplitShadeStateController;
import com.android.systemui.statusbar.policy.ZenModeController;
import com.android.systemui.tuner.TunerService;
import com.android.systemui.util.settings.SecureSettings;
@@ -713,7 +714,8 @@
mNotificationTargetsHelper,
mSecureSettings,
mock(NotificationDismissibilityProvider.class),
- mActivityStarter
+ mActivityStarter,
+ new ResourcesSplitShadeStateController()
);
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java
index eb62391..4307066 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java
@@ -87,6 +87,7 @@
import com.android.systemui.statusbar.phone.KeyguardBypassController;
import com.android.systemui.statusbar.phone.ScreenOffAnimationController;
import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager;
+import com.android.systemui.statusbar.policy.ResourcesSplitShadeStateController;
import org.junit.Assert;
import org.junit.Before;
@@ -845,6 +846,7 @@
public void testSplitShade_hasTopOverscroll() {
mTestableResources
.addOverride(R.bool.config_use_split_notification_shade, /* value= */ true);
+ mStackScroller.passSplitShadeStateController(new ResourcesSplitShadeStateController());
mStackScroller.updateSplitNotificationShade();
mAmbientState.setExpansionFraction(1f);
@@ -860,6 +862,7 @@
public void testNormalShade_hasNoTopOverscroll() {
mTestableResources
.addOverride(R.bool.config_use_split_notification_shade, /* value= */ false);
+ mStackScroller.passSplitShadeStateController(new ResourcesSplitShadeStateController());
mStackScroller.updateSplitNotificationShade();
mAmbientState.setExpansionFraction(1f);
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackSizeCalculatorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackSizeCalculatorTest.kt
index 5279740..bc12bb0 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackSizeCalculatorTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackSizeCalculatorTest.kt
@@ -30,6 +30,7 @@
import com.android.systemui.statusbar.notification.collection.NotificationEntry
import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow
import com.android.systemui.statusbar.notification.row.ExpandableView
+import com.android.systemui.statusbar.policy.ResourcesSplitShadeStateController
import com.android.systemui.util.mockito.any
import com.android.systemui.util.mockito.eq
import com.android.systemui.util.mockito.nullable
@@ -70,7 +71,8 @@
statusBarStateController = sysuiStatusBarStateController,
lockscreenShadeTransitionController = lockscreenShadeTransitionController,
mediaDataManager = mediaDataManager,
- testableResources.resources
+ testableResources.resources,
+ ResourcesSplitShadeStateController()
)
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/domain/interactor/SharedNotificationContainerInteractorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/domain/interactor/SharedNotificationContainerInteractorTest.kt
index 7bbb094..7fc399b 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/domain/interactor/SharedNotificationContainerInteractorTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/domain/interactor/SharedNotificationContainerInteractorTest.kt
@@ -23,6 +23,7 @@
import com.android.systemui.SysuiTestCase
import com.android.systemui.common.ui.data.repository.FakeConfigurationRepository
import com.android.systemui.coroutines.collectLastValue
+import com.android.systemui.statusbar.policy.ResourcesSplitShadeStateController
import com.google.common.truth.Truth.assertThat
import kotlinx.coroutines.test.runCurrent
import kotlinx.coroutines.test.runTest
@@ -43,6 +44,7 @@
SharedNotificationContainerInteractor(
configurationRepository,
mContext,
+ ResourcesSplitShadeStateController()
)
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/SharedNotificationContainerViewModelTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/SharedNotificationContainerViewModelTest.kt
index 521069f..bfc0910 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/SharedNotificationContainerViewModelTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/SharedNotificationContainerViewModelTest.kt
@@ -43,6 +43,7 @@
import com.android.systemui.statusbar.notification.stack.domain.interactor.SharedNotificationContainerInteractor
import com.android.systemui.statusbar.pipeline.mobile.data.repository.FakeUserSetupRepository
import com.android.systemui.statusbar.policy.DeviceProvisionedController
+import com.android.systemui.statusbar.policy.ResourcesSplitShadeStateController
import com.android.systemui.user.domain.interactor.UserInteractor
import com.android.systemui.util.mockito.any
import com.android.systemui.util.mockito.mock
@@ -106,6 +107,7 @@
SharedNotificationContainerInteractor(
configurationRepository,
mContext,
+ ResourcesSplitShadeStateController()
)
shadeInteractor =
ShadeInteractor(
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/RemoteInputQuickSettingsDisablerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/RemoteInputQuickSettingsDisablerTest.kt
index 1ab0582..cfb48a8 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/RemoteInputQuickSettingsDisablerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/RemoteInputQuickSettingsDisablerTest.kt
@@ -49,7 +49,9 @@
remoteInputQuickSettingsDisabler = RemoteInputQuickSettingsDisabler(
mContext,
- commandQueue, Mockito.mock(ConfigurationController::class.java)
+ commandQueue,
+ ResourcesSplitShadeStateController(),
+ Mockito.mock(ConfigurationController::class.java),
)
configuration = Configuration(mContext.resources.configuration)