Loading packages/SystemUI/src/com/android/systemui/qs/footer/ui/viewmodel/FooterActionsViewModel.kt +12 −1 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ import com.android.systemui.common.shared.model.Icon import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dagger.qualifiers.Application import com.android.systemui.globalactions.GlobalActionsDialogLite import com.android.systemui.plugins.ActivityStarter import com.android.systemui.plugins.FalsingManager import com.android.systemui.qs.dagger.QSFlagsModule.PM_LITE_ENABLED import com.android.systemui.qs.footer.data.model.UserSwitcherStatusModel Loading Loading @@ -109,6 +110,7 @@ class FooterActionsViewModel( private val falsingManager: FalsingManager, private val footerActionsInteractor: FooterActionsInteractor, private val globalActionsDialogLiteProvider: Provider<GlobalActionsDialogLite>, private val activityStarter: ActivityStarter, @Named(PM_LITE_ENABLED) private val showPowerButton: Boolean, ) { /** Create a [FooterActionsViewModel] bound to the lifecycle of [lifecycleOwner]. */ Loading @@ -134,6 +136,7 @@ class FooterActionsViewModel( footerActionsInteractor, falsingManager, globalActionsDialogLite, activityStarter, showPowerButton, ) } Loading @@ -145,6 +148,7 @@ fun FooterActionsViewModel( footerActionsInteractor: FooterActionsInteractor, falsingManager: FalsingManager, globalActionsDialogLite: GlobalActionsDialogLite, activityStarter: ActivityStarter, showPowerButton: Boolean, ): FooterActionsViewModel { suspend fun observeDeviceMonitoringDialogRequests(quickSettingsContext: Context) { Loading @@ -169,7 +173,14 @@ fun FooterActionsViewModel( return } activityStarter.dismissKeyguardThenExecute( { footerActionsInteractor.showForegroundServicesDialog(expandable) false /* if the dismiss should be deferred */ }, null /* cancelAction */, true /* afterKeyguardGone */ ) } fun onUserSwitcherClicked(expandable: Expandable) { Loading packages/SystemUI/tests/utils/src/com/android/systemui/qs/QuickSettingsKosmos.kt +1 −0 Original line number Diff line number Diff line Loading @@ -94,6 +94,7 @@ val Kosmos.footerActionsViewModelFactory by Fixture { falsingManager = falsingManager, footerActionsInteractor = footerActionsInteractor, globalActionsDialogLiteProvider = { mock() }, activityStarter, showPowerButton = true, ) } packages/SystemUI/tests/utils/src/com/android/systemui/qs/footer/FooterActionsTestUtils.kt +3 −1 Original line number Diff line number Diff line Loading @@ -68,6 +68,7 @@ class FooterActionsTestUtils( private val testableLooper: TestableLooper, private val scheduler: TestCoroutineScheduler, ) { private val mockActivityStarter: ActivityStarter = mock<ActivityStarter>() /** Enable or disable the user switcher in the settings. */ fun setUserSwitcherEnabled(settings: GlobalSettings, enabled: Boolean) { settings.putBool(Settings.Global.USER_SWITCHER_ENABLED, enabled) Loading @@ -90,13 +91,14 @@ class FooterActionsTestUtils( footerActionsInteractor, falsingManager, globalActionsDialogLite, mockActivityStarter, showPowerButton, ) } /** Create a [FooterActionsInteractor] to be used in tests. */ fun footerActionsInteractor( activityStarter: ActivityStarter = mock(), activityStarter: ActivityStarter = mockActivityStarter, metricsLogger: MetricsLogger = FakeMetricsLogger(), uiEventLogger: UiEventLogger = UiEventLoggerFake(), deviceProvisionedController: DeviceProvisionedController = mock(), Loading Loading
packages/SystemUI/src/com/android/systemui/qs/footer/ui/viewmodel/FooterActionsViewModel.kt +12 −1 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ import com.android.systemui.common.shared.model.Icon import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dagger.qualifiers.Application import com.android.systemui.globalactions.GlobalActionsDialogLite import com.android.systemui.plugins.ActivityStarter import com.android.systemui.plugins.FalsingManager import com.android.systemui.qs.dagger.QSFlagsModule.PM_LITE_ENABLED import com.android.systemui.qs.footer.data.model.UserSwitcherStatusModel Loading Loading @@ -109,6 +110,7 @@ class FooterActionsViewModel( private val falsingManager: FalsingManager, private val footerActionsInteractor: FooterActionsInteractor, private val globalActionsDialogLiteProvider: Provider<GlobalActionsDialogLite>, private val activityStarter: ActivityStarter, @Named(PM_LITE_ENABLED) private val showPowerButton: Boolean, ) { /** Create a [FooterActionsViewModel] bound to the lifecycle of [lifecycleOwner]. */ Loading @@ -134,6 +136,7 @@ class FooterActionsViewModel( footerActionsInteractor, falsingManager, globalActionsDialogLite, activityStarter, showPowerButton, ) } Loading @@ -145,6 +148,7 @@ fun FooterActionsViewModel( footerActionsInteractor: FooterActionsInteractor, falsingManager: FalsingManager, globalActionsDialogLite: GlobalActionsDialogLite, activityStarter: ActivityStarter, showPowerButton: Boolean, ): FooterActionsViewModel { suspend fun observeDeviceMonitoringDialogRequests(quickSettingsContext: Context) { Loading @@ -169,7 +173,14 @@ fun FooterActionsViewModel( return } activityStarter.dismissKeyguardThenExecute( { footerActionsInteractor.showForegroundServicesDialog(expandable) false /* if the dismiss should be deferred */ }, null /* cancelAction */, true /* afterKeyguardGone */ ) } fun onUserSwitcherClicked(expandable: Expandable) { Loading
packages/SystemUI/tests/utils/src/com/android/systemui/qs/QuickSettingsKosmos.kt +1 −0 Original line number Diff line number Diff line Loading @@ -94,6 +94,7 @@ val Kosmos.footerActionsViewModelFactory by Fixture { falsingManager = falsingManager, footerActionsInteractor = footerActionsInteractor, globalActionsDialogLiteProvider = { mock() }, activityStarter, showPowerButton = true, ) }
packages/SystemUI/tests/utils/src/com/android/systemui/qs/footer/FooterActionsTestUtils.kt +3 −1 Original line number Diff line number Diff line Loading @@ -68,6 +68,7 @@ class FooterActionsTestUtils( private val testableLooper: TestableLooper, private val scheduler: TestCoroutineScheduler, ) { private val mockActivityStarter: ActivityStarter = mock<ActivityStarter>() /** Enable or disable the user switcher in the settings. */ fun setUserSwitcherEnabled(settings: GlobalSettings, enabled: Boolean) { settings.putBool(Settings.Global.USER_SWITCHER_ENABLED, enabled) Loading @@ -90,13 +91,14 @@ class FooterActionsTestUtils( footerActionsInteractor, falsingManager, globalActionsDialogLite, mockActivityStarter, showPowerButton, ) } /** Create a [FooterActionsInteractor] to be used in tests. */ fun footerActionsInteractor( activityStarter: ActivityStarter = mock(), activityStarter: ActivityStarter = mockActivityStarter, metricsLogger: MetricsLogger = FakeMetricsLogger(), uiEventLogger: UiEventLogger = UiEventLoggerFake(), deviceProvisionedController: DeviceProvisionedController = mock(), Loading