Loading packages/SystemUI/multivalentTests/src/com/android/systemui/shade/domain/interactor/ShadeModeInteractorImplTest.kt +20 −0 Original line number Diff line number Diff line Loading @@ -87,6 +87,26 @@ class ShadeModeInteractorImplTest : SysuiTestCase() { assertThat(shadeMode).isEqualTo(ShadeMode.Dual) } @Test @EnableFlags(DualShade.FLAG_NAME) fun isDualShade_flagEnabled_true() = testScope.runTest { // Initiate collection. val shadeMode by collectLastValue(underTest.shadeMode) assertThat(underTest.isDualShade).isTrue() } @Test @DisableFlags(DualShade.FLAG_NAME) fun isDualShade_flagDisabled_false() = testScope.runTest { // Initiate collection. val shadeMode by collectLastValue(underTest.shadeMode) assertThat(underTest.isDualShade).isFalse() } @Test fun getTopEdgeSplitFraction_narrowScreen_splitInHalf() = testScope.runTest { Loading packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java +7 −10 Original line number Diff line number Diff line Loading @@ -101,10 +101,10 @@ import com.android.systemui.navigationbar.views.buttons.KeyButtonView; import com.android.systemui.recents.OverviewProxyService.OverviewProxyListener; import com.android.systemui.scene.domain.interactor.SceneInteractor; import com.android.systemui.scene.shared.flag.SceneContainerFlag; import com.android.systemui.scene.shared.model.SceneFamilies; import com.android.systemui.settings.DisplayTracker; import com.android.systemui.settings.UserTracker; import com.android.systemui.shade.ShadeViewController; import com.android.systemui.shade.domain.interactor.ShadeInteractor; import com.android.systemui.shared.recents.IOverviewProxy; import com.android.systemui.shared.recents.ISystemUiProxy; import com.android.systemui.shared.system.QuickStepContract; Loading Loading @@ -158,6 +158,7 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis private final ScreenPinningRequest mScreenPinningRequest; private final NotificationShadeWindowController mStatusBarWinController; private final Provider<SceneInteractor> mSceneInteractor; private final Provider<ShadeInteractor> mShadeInteractor; private final KeyboardTouchpadEduStatsInteractor mKeyboardTouchpadEduStatsInteractor; Loading Loading @@ -246,11 +247,8 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis } } else if (action == ACTION_UP) { // Gesture was too short to be picked up by scene container touch // handling; programmatically start the transition to shade scene. mSceneInteractor.get().changeScene( SceneFamilies.NotifShade, "short launcher swipe" ); // handling; programmatically start the transition to the shade. mShadeInteractor.get().expandNotificationShade("short launcher swipe"); } } event.recycle(); Loading @@ -267,10 +265,7 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis mSceneInteractor.get().onRemoteUserInputStarted( "trackpad swipe"); } else if (action == ACTION_UP) { mSceneInteractor.get().changeScene( SceneFamilies.NotifShade, "short trackpad swipe" ); mShadeInteractor.get().expandNotificationShade("short trackpad swipe"); } mStatusBarWinController.getWindowRootView().dispatchTouchEvent(event); } else { Loading Loading @@ -652,6 +647,7 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis NotificationShadeWindowController statusBarWinController, SysUiState sysUiState, Provider<SceneInteractor> sceneInteractor, Provider<ShadeInteractor> shadeInteractor, UserTracker userTracker, UserManager userManager, WakefulnessLifecycle wakefulnessLifecycle, Loading Loading @@ -688,6 +684,7 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis mScreenPinningRequest = screenPinningRequest; mStatusBarWinController = statusBarWinController; mSceneInteractor = sceneInteractor; mShadeInteractor = shadeInteractor; mUserTracker = userTracker; mConnectionBackoffAttempts = 0; mRecentsComponentName = ComponentName.unflattenFromString(context.getString( Loading packages/SystemUI/src/com/android/systemui/shade/ShadeControllerSceneImpl.kt +5 −14 Original line number Diff line number Diff line Loading @@ -91,17 +91,14 @@ constructor( } override fun instantCollapseShade() { sceneInteractor.snapToScene( SceneFamilies.Home, "hide shade", ) sceneInteractor.snapToScene(SceneFamilies.Home, "hide shade") } override fun animateCollapseShade( flags: Int, force: Boolean, delayed: Boolean, speedUpFactor: Float speedUpFactor: Float, ) { if (!force && !shadeInteractor.isAnyExpanded.value) { runPostCollapseActions() Loading Loading @@ -147,7 +144,7 @@ constructor( if (shadeInteractor.isAnyExpanded.value) { commandQueue.animateCollapsePanels( CommandQueue.FLAG_EXCLUDE_RECENTS_PANEL, true /* force */ true, /* force */ ) assistManagerLazy.get().hideAssist() } Loading @@ -172,17 +169,11 @@ constructor( } override fun expandToNotifications() { sceneInteractor.changeScene( SceneFamilies.NotifShade, "ShadeController.animateExpandShade", ) shadeInteractor.expandNotificationShade("ShadeController.animateExpandShade") } override fun expandToQs() { sceneInteractor.changeScene( SceneFamilies.QuickSettings, "ShadeController.animateExpandQs", ) shadeInteractor.expandQuickSettingsShade("ShadeController.animateExpandQs") } override fun setVisibilityListener(listener: ShadeVisibilityListener) { Loading packages/SystemUI/src/com/android/systemui/shade/domain/interactor/ShadeInteractor.kt +12 −0 Original line number Diff line number Diff line Loading @@ -140,6 +140,18 @@ interface BaseShadeInteractor { * animating. */ val isUserInteractingWithQs: Flow<Boolean> /** * Triggers the expansion (opening) of the notification shade. If the notification shade is * already open, this has no effect. */ fun expandNotificationShade(loggingReason: String) /** * Triggers the expansion (opening) of the quick settings shade. If the quick settings shade is * already open, this has no effect. */ fun expandQuickSettingsShade(loggingReason: String) } fun createAnyExpansionFlow( Loading packages/SystemUI/src/com/android/systemui/shade/domain/interactor/ShadeInteractorEmptyImpl.kt +4 −0 Original line number Diff line number Diff line Loading @@ -49,4 +49,8 @@ class ShadeInteractorEmptyImpl @Inject constructor() : ShadeInteractor { override val isShadeLayoutWide: StateFlow<Boolean> = inactiveFlowBoolean override fun getTopEdgeSplitFraction(): Float = 0.5f override fun expandNotificationShade(loggingReason: String) {} override fun expandQuickSettingsShade(loggingReason: String) {} } Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/shade/domain/interactor/ShadeModeInteractorImplTest.kt +20 −0 Original line number Diff line number Diff line Loading @@ -87,6 +87,26 @@ class ShadeModeInteractorImplTest : SysuiTestCase() { assertThat(shadeMode).isEqualTo(ShadeMode.Dual) } @Test @EnableFlags(DualShade.FLAG_NAME) fun isDualShade_flagEnabled_true() = testScope.runTest { // Initiate collection. val shadeMode by collectLastValue(underTest.shadeMode) assertThat(underTest.isDualShade).isTrue() } @Test @DisableFlags(DualShade.FLAG_NAME) fun isDualShade_flagDisabled_false() = testScope.runTest { // Initiate collection. val shadeMode by collectLastValue(underTest.shadeMode) assertThat(underTest.isDualShade).isFalse() } @Test fun getTopEdgeSplitFraction_narrowScreen_splitInHalf() = testScope.runTest { Loading
packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java +7 −10 Original line number Diff line number Diff line Loading @@ -101,10 +101,10 @@ import com.android.systemui.navigationbar.views.buttons.KeyButtonView; import com.android.systemui.recents.OverviewProxyService.OverviewProxyListener; import com.android.systemui.scene.domain.interactor.SceneInteractor; import com.android.systemui.scene.shared.flag.SceneContainerFlag; import com.android.systemui.scene.shared.model.SceneFamilies; import com.android.systemui.settings.DisplayTracker; import com.android.systemui.settings.UserTracker; import com.android.systemui.shade.ShadeViewController; import com.android.systemui.shade.domain.interactor.ShadeInteractor; import com.android.systemui.shared.recents.IOverviewProxy; import com.android.systemui.shared.recents.ISystemUiProxy; import com.android.systemui.shared.system.QuickStepContract; Loading Loading @@ -158,6 +158,7 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis private final ScreenPinningRequest mScreenPinningRequest; private final NotificationShadeWindowController mStatusBarWinController; private final Provider<SceneInteractor> mSceneInteractor; private final Provider<ShadeInteractor> mShadeInteractor; private final KeyboardTouchpadEduStatsInteractor mKeyboardTouchpadEduStatsInteractor; Loading Loading @@ -246,11 +247,8 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis } } else if (action == ACTION_UP) { // Gesture was too short to be picked up by scene container touch // handling; programmatically start the transition to shade scene. mSceneInteractor.get().changeScene( SceneFamilies.NotifShade, "short launcher swipe" ); // handling; programmatically start the transition to the shade. mShadeInteractor.get().expandNotificationShade("short launcher swipe"); } } event.recycle(); Loading @@ -267,10 +265,7 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis mSceneInteractor.get().onRemoteUserInputStarted( "trackpad swipe"); } else if (action == ACTION_UP) { mSceneInteractor.get().changeScene( SceneFamilies.NotifShade, "short trackpad swipe" ); mShadeInteractor.get().expandNotificationShade("short trackpad swipe"); } mStatusBarWinController.getWindowRootView().dispatchTouchEvent(event); } else { Loading Loading @@ -652,6 +647,7 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis NotificationShadeWindowController statusBarWinController, SysUiState sysUiState, Provider<SceneInteractor> sceneInteractor, Provider<ShadeInteractor> shadeInteractor, UserTracker userTracker, UserManager userManager, WakefulnessLifecycle wakefulnessLifecycle, Loading Loading @@ -688,6 +684,7 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis mScreenPinningRequest = screenPinningRequest; mStatusBarWinController = statusBarWinController; mSceneInteractor = sceneInteractor; mShadeInteractor = shadeInteractor; mUserTracker = userTracker; mConnectionBackoffAttempts = 0; mRecentsComponentName = ComponentName.unflattenFromString(context.getString( Loading
packages/SystemUI/src/com/android/systemui/shade/ShadeControllerSceneImpl.kt +5 −14 Original line number Diff line number Diff line Loading @@ -91,17 +91,14 @@ constructor( } override fun instantCollapseShade() { sceneInteractor.snapToScene( SceneFamilies.Home, "hide shade", ) sceneInteractor.snapToScene(SceneFamilies.Home, "hide shade") } override fun animateCollapseShade( flags: Int, force: Boolean, delayed: Boolean, speedUpFactor: Float speedUpFactor: Float, ) { if (!force && !shadeInteractor.isAnyExpanded.value) { runPostCollapseActions() Loading Loading @@ -147,7 +144,7 @@ constructor( if (shadeInteractor.isAnyExpanded.value) { commandQueue.animateCollapsePanels( CommandQueue.FLAG_EXCLUDE_RECENTS_PANEL, true /* force */ true, /* force */ ) assistManagerLazy.get().hideAssist() } Loading @@ -172,17 +169,11 @@ constructor( } override fun expandToNotifications() { sceneInteractor.changeScene( SceneFamilies.NotifShade, "ShadeController.animateExpandShade", ) shadeInteractor.expandNotificationShade("ShadeController.animateExpandShade") } override fun expandToQs() { sceneInteractor.changeScene( SceneFamilies.QuickSettings, "ShadeController.animateExpandQs", ) shadeInteractor.expandQuickSettingsShade("ShadeController.animateExpandQs") } override fun setVisibilityListener(listener: ShadeVisibilityListener) { Loading
packages/SystemUI/src/com/android/systemui/shade/domain/interactor/ShadeInteractor.kt +12 −0 Original line number Diff line number Diff line Loading @@ -140,6 +140,18 @@ interface BaseShadeInteractor { * animating. */ val isUserInteractingWithQs: Flow<Boolean> /** * Triggers the expansion (opening) of the notification shade. If the notification shade is * already open, this has no effect. */ fun expandNotificationShade(loggingReason: String) /** * Triggers the expansion (opening) of the quick settings shade. If the quick settings shade is * already open, this has no effect. */ fun expandQuickSettingsShade(loggingReason: String) } fun createAnyExpansionFlow( Loading
packages/SystemUI/src/com/android/systemui/shade/domain/interactor/ShadeInteractorEmptyImpl.kt +4 −0 Original line number Diff line number Diff line Loading @@ -49,4 +49,8 @@ class ShadeInteractorEmptyImpl @Inject constructor() : ShadeInteractor { override val isShadeLayoutWide: StateFlow<Boolean> = inactiveFlowBoolean override fun getTopEdgeSplitFraction(): Float = 0.5f override fun expandNotificationShade(loggingReason: String) {} override fun expandQuickSettingsShade(loggingReason: String) {} }