Loading packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/section/SmartSpaceSection.kt +2 −2 Original line number Diff line number Diff line Loading @@ -159,7 +159,7 @@ constructor( factory = { context -> FrameLayout(context).apply { addView( lockscreenSmartspaceController.buildAndConnectWeatherView(this).apply { lockscreenSmartspaceController.buildAndConnectWeatherView(this, false).apply { layoutParams = FrameLayout.LayoutParams( FrameLayout.LayoutParams.WRAP_CONTENT, Loading @@ -184,7 +184,7 @@ constructor( factory = { context -> FrameLayout(context).apply { addView( lockscreenSmartspaceController.buildAndConnectDateView(this).apply { lockscreenSmartspaceController.buildAndConnectDateView(this, false).apply { layoutParams = FrameLayout.LayoutParams( FrameLayout.LayoutParams.WRAP_CONTENT, Loading packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/ui/view/layout/sections/ClockSectionTest.kt +99 −1 Original line number Diff line number Diff line Loading @@ -19,6 +19,8 @@ package com.android.systemui.keyguard.ui.view.layout.sections import android.content.pm.PackageManager import android.content.res.Resources import android.platform.test.annotations.DisableFlags import android.platform.test.annotations.EnableFlags import android.view.View.GONE import android.view.View.VISIBLE import androidx.constraintlayout.widget.ConstraintSet Loading Loading @@ -128,6 +130,7 @@ class ClockSectionTest : SysuiTestCase() { } @Test @DisableFlags(com.android.systemui.shared.Flags.FLAG_CLOCK_REACTIVE_VARIANTS) fun testApplyDefaultConstraints_LargeClock_SplitShade() = kosmos.testScope.runTest { with(kosmos) { Loading @@ -144,6 +147,25 @@ class ClockSectionTest : SysuiTestCase() { } @Test @EnableFlags(com.android.systemui.shared.Flags.FLAG_CLOCK_REACTIVE_VARIANTS) fun testApplyDefaultConstraints_LargeClock_SplitShade_ReactiveVariantsOn() = kosmos.testScope.runTest { with(kosmos) { shadeRepository.setShadeLayoutWide(true) keyguardClockInteractor.setClockSize(ClockSize.LARGE) advanceUntilIdle() } val cs = ConstraintSet() underTest.applyDefaultConstraints(cs) assertLargeClockTop(cs, LARGE_CLOCK_TOP_WITHOUT_SMARTSPACE + ENHANCED_SMART_SPACE_HEIGHT) assertSmallClockTop(cs) } @Test @DisableFlags(com.android.systemui.shared.Flags.FLAG_CLOCK_REACTIVE_VARIANTS) fun testApplyDefaultConstraints_LargeClock_NonSplitShade() = kosmos.testScope.runTest { with(kosmos) { Loading @@ -166,6 +188,31 @@ class ClockSectionTest : SysuiTestCase() { } } @Test @EnableFlags(com.android.systemui.shared.Flags.FLAG_CLOCK_REACTIVE_VARIANTS) fun testApplyDefaultConstraints_LargeClock_NonSplitShade_reactiveVariantsOn() = kosmos.testScope.runTest { with(kosmos) { val isShadeLayoutWide by collectLastValue(shadeRepository.isShadeLayoutWide) val isLargeClockVisible by collectLastValue(keyguardClockViewModel.isLargeClockVisible) shadeRepository.setShadeLayoutWide(false) keyguardClockInteractor.setClockSize(ClockSize.LARGE) notificationsKeyguardInteractor.setNotificationsFullyHidden(true) keyguardSmartspaceInteractor.setBcSmartspaceVisibility(VISIBLE) fakeConfigurationController.notifyConfigurationChanged() advanceUntilIdle() val cs = ConstraintSet() underTest.applyDefaultConstraints(cs) assertLargeClockTop(cs, LARGE_CLOCK_TOP_WITHOUT_SMARTSPACE + ENHANCED_SMART_SPACE_HEIGHT) assertSmallClockTop(cs) } } @Test fun testApplyDefaultConstraints_LargeClock_MissingSmartspace_SplitShade() = kosmos.testScope.runTest { Loading Loading @@ -215,6 +262,7 @@ class ClockSectionTest : SysuiTestCase() { } @Test @DisableFlags(com.android.systemui.shared.Flags.FLAG_CLOCK_REACTIVE_VARIANTS) fun testApplyDefaultConstraints_SmallClock_SplitShade() = kosmos.testScope.runTest { with(kosmos) { Loading @@ -238,6 +286,32 @@ class ClockSectionTest : SysuiTestCase() { } @Test @EnableFlags(com.android.systemui.shared.Flags.FLAG_CLOCK_REACTIVE_VARIANTS) fun testApplyDefaultConstraints_SmallClock_SplitShade_ReactiveVariantsOn() = kosmos.testScope.runTest { with(kosmos) { val isShadeLayoutWide by collectLastValue(shadeRepository.isShadeLayoutWide) val isLargeClockVisible by collectLastValue(keyguardClockViewModel.isLargeClockVisible) shadeRepository.setShadeLayoutWide(true) keyguardClockInteractor.setClockSize(ClockSize.SMALL) notificationsKeyguardInteractor.setNotificationsFullyHidden(true) keyguardSmartspaceInteractor.setBcSmartspaceVisibility(VISIBLE) fakeConfigurationController.notifyConfigurationChanged() advanceUntilIdle() val cs = ConstraintSet() underTest.applyDefaultConstraints(cs) assertLargeClockTop(cs, LARGE_CLOCK_TOP_WITHOUT_SMARTSPACE + ENHANCED_SMART_SPACE_HEIGHT) assertSmallClockTop(cs) } } @Test @DisableFlags(com.android.systemui.shared.Flags.FLAG_CLOCK_REACTIVE_VARIANTS) fun testApplyDefaultConstraints_SmallClock_NonSplitShade() = kosmos.testScope.runTest { with(kosmos) { Loading @@ -259,6 +333,30 @@ class ClockSectionTest : SysuiTestCase() { } } @Test @EnableFlags(com.android.systemui.shared.Flags.FLAG_CLOCK_REACTIVE_VARIANTS) fun testApplyDefaultConstraints_SmallClock_NonSplitShade_ReactiveVariantsOn() = kosmos.testScope.runTest { with(kosmos) { val isShadeLayoutWide by collectLastValue(shadeRepository.isShadeLayoutWide) val isLargeClockVisible by collectLastValue(keyguardClockViewModel.isLargeClockVisible) shadeRepository.setShadeLayoutWide(false) keyguardClockInteractor.setClockSize(ClockSize.SMALL) notificationsKeyguardInteractor.setNotificationsFullyHidden(true) keyguardSmartspaceInteractor.setBcSmartspaceVisibility(VISIBLE) fakeConfigurationController.notifyConfigurationChanged() advanceUntilIdle() val cs = ConstraintSet() underTest.applyDefaultConstraints(cs) assertLargeClockTop(cs, LARGE_CLOCK_TOP_WITHOUT_SMARTSPACE + ENHANCED_SMART_SPACE_HEIGHT) assertSmallClockTop(cs) } } @Test fun testSmartspaceVisible_weatherClockDateAndIconsBarrierBottomBelowBCSmartspace() = kosmos.testScope.runTest { Loading packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/ui/view/layout/sections/SmartspaceSectionTest.kt +15 −2 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.systemui.keyguard.ui.view.layout.sections import android.platform.test.annotations.DisableFlags import android.view.View import android.widget.LinearLayout import androidx.constraintlayout.widget.ConstraintLayout Loading @@ -31,6 +32,7 @@ import com.android.systemui.keyguard.KeyguardUnlockAnimationController import com.android.systemui.keyguard.domain.interactor.KeyguardBlueprintInteractor import com.android.systemui.keyguard.domain.interactor.KeyguardSmartspaceInteractor import com.android.systemui.keyguard.ui.viewmodel.KeyguardClockViewModel import com.android.systemui.keyguard.ui.viewmodel.KeyguardRootViewModel import com.android.systemui.keyguard.ui.viewmodel.KeyguardSmartspaceViewModel import com.android.systemui.res.R import com.android.systemui.shared.R as sharedR Loading @@ -48,6 +50,7 @@ import org.mockito.MockitoAnnotations @RunWith(AndroidJUnit4::class) @SmallTest @DisableFlags(com.android.systemui.shared.Flags.FLAG_CLOCK_REACTIVE_VARIANTS) class SmartspaceSectionTest : SysuiTestCase() { private lateinit var underTest: SmartspaceSection @Mock private lateinit var keyguardClockViewModel: KeyguardClockViewModel Loading @@ -56,6 +59,7 @@ class SmartspaceSectionTest : SysuiTestCase() { @Mock private lateinit var keyguardUnlockAnimationController: KeyguardUnlockAnimationController @Mock private lateinit var keyguardSmartspaceInteractor: KeyguardSmartspaceInteractor @Mock private lateinit var blueprintInteractor: Lazy<KeyguardBlueprintInteractor> @Mock private lateinit var keyguardRootViewModel: KeyguardRootViewModel private val smartspaceView = View(mContext).also { it.id = sharedR.id.bc_smartspace_view } private val weatherView = View(mContext).also { it.id = sharedR.id.weather_smartspace_view } Loading @@ -80,13 +84,14 @@ class SmartspaceSectionTest : SysuiTestCase() { lockscreenSmartspaceController, keyguardUnlockAnimationController, blueprintInteractor, keyguardRootViewModel, ) constraintLayout = ConstraintLayout(mContext) whenever(lockscreenSmartspaceController.buildAndConnectView(any())) .thenReturn(smartspaceView) whenever(lockscreenSmartspaceController.buildAndConnectWeatherView(any())) whenever(lockscreenSmartspaceController.buildAndConnectWeatherView(any(), any())) .thenReturn(weatherView) whenever(lockscreenSmartspaceController.buildAndConnectDateView(any())).thenReturn(dateView) whenever(lockscreenSmartspaceController.buildAndConnectDateView(any(), any())).thenReturn(dateView) whenever(keyguardClockViewModel.hasCustomWeatherDataDisplay) .thenReturn(hasCustomWeatherDataDisplay) whenever(keyguardClockViewModel.clockShouldBeCentered).thenReturn(clockShouldBeCentered) Loading @@ -97,6 +102,7 @@ class SmartspaceSectionTest : SysuiTestCase() { } @Test @DisableFlags(com.android.systemui.shared.Flags.FLAG_CLOCK_REACTIVE_VARIANTS) fun testAddViews_notSmartspaceEnabled() { whenever(keyguardSmartspaceViewModel.isSmartspaceEnabled).thenReturn(false) val constraintLayout = ConstraintLayout(mContext) Loading @@ -107,6 +113,7 @@ class SmartspaceSectionTest : SysuiTestCase() { } @Test @DisableFlags(com.android.systemui.shared.Flags.FLAG_CLOCK_REACTIVE_VARIANTS) fun testAddViews_smartspaceEnabled_dateWeatherDecoupled() { whenever(keyguardSmartspaceViewModel.isDateWeatherDecoupled).thenReturn(true) underTest.addViews(constraintLayout) Loading @@ -125,6 +132,7 @@ class SmartspaceSectionTest : SysuiTestCase() { } @Test @DisableFlags(com.android.systemui.shared.Flags.FLAG_CLOCK_REACTIVE_VARIANTS) fun testConstraintsWhenShadeLayoutIsNotWide() { underTest.addViews(constraintLayout) underTest.applyConstraints(constraintSet) Loading @@ -134,6 +142,7 @@ class SmartspaceSectionTest : SysuiTestCase() { } @Test @DisableFlags(com.android.systemui.shared.Flags.FLAG_CLOCK_REACTIVE_VARIANTS) fun testConstraintsWhenShadeLayoutIsWide() { isShadeLayoutWide.value = true Loading @@ -145,6 +154,7 @@ class SmartspaceSectionTest : SysuiTestCase() { } @Test @DisableFlags(com.android.systemui.shared.Flags.FLAG_CLOCK_REACTIVE_VARIANTS) fun testConstraintsWhenNotHasCustomWeatherDataDisplay() { whenever(keyguardSmartspaceViewModel.isDateWeatherDecoupled).thenReturn(true) underTest.addViews(constraintLayout) Loading @@ -159,6 +169,7 @@ class SmartspaceSectionTest : SysuiTestCase() { } @Test @DisableFlags(com.android.systemui.shared.Flags.FLAG_CLOCK_REACTIVE_VARIANTS) fun testConstraintsWhenHasCustomWeatherDataDisplay() { hasCustomWeatherDataDisplay.value = true underTest.addViews(constraintLayout) Loading @@ -169,6 +180,7 @@ class SmartspaceSectionTest : SysuiTestCase() { } @Test @DisableFlags(com.android.systemui.shared.Flags.FLAG_CLOCK_REACTIVE_VARIANTS) fun testNormalDateWeatherVisibility() { isWeatherVisibleFlow.value = true underTest.addViews(constraintLayout) Loading @@ -182,6 +194,7 @@ class SmartspaceSectionTest : SysuiTestCase() { } @Test @DisableFlags(com.android.systemui.shared.Flags.FLAG_CLOCK_REACTIVE_VARIANTS) fun testCustomDateWeatherVisibility() { hasCustomWeatherDataDisplay.value = true underTest.addViews(constraintLayout) Loading packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/lockscreen/LockscreenSmartspaceControllerTest.kt +2 −2 Original line number Diff line number Diff line Loading @@ -846,7 +846,7 @@ class LockscreenSmartspaceControllerTest : SysuiTestCase() { } private fun connectSession() { val dateView = controller.buildAndConnectDateView(fakeParent) val dateView = controller.buildAndConnectDateView(fakeParent, false) dateSmartspaceView = dateView as SmartspaceView fakeParent.addView(dateView) controller.stateChangeListener.onViewAttachedToWindow(dateView) Loading @@ -860,7 +860,7 @@ class LockscreenSmartspaceControllerTest : SysuiTestCase() { verify(dateSmartspaceView).setPrimaryTextColor(anyInt()) verify(dateSmartspaceView).setDozeAmount(0.5f) val weatherView = controller.buildAndConnectWeatherView(fakeParent) val weatherView = controller.buildAndConnectWeatherView(fakeParent, false) weatherSmartspaceView = weatherView as SmartspaceView fakeParent.addView(weatherView) controller.stateChangeListener.onViewAttachedToWindow(weatherView) Loading packages/SystemUI/plugin/bcsmartspace/src/com/android/systemui/plugins/BcSmartspaceDataPlugin.java +4 −0 Original line number Diff line number Diff line Loading @@ -85,6 +85,10 @@ public interface BcSmartspaceDataPlugin extends Plugin { throw new UnsupportedOperationException("Not implemented by " + getClass()); } default SmartspaceView getLargeClockView(ViewGroup parent) { throw new UnsupportedOperationException("Not implemented by " + getClass()); } /** * As the smartspace view becomes available, allow listeners to receive an event. */ Loading Loading
packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/section/SmartSpaceSection.kt +2 −2 Original line number Diff line number Diff line Loading @@ -159,7 +159,7 @@ constructor( factory = { context -> FrameLayout(context).apply { addView( lockscreenSmartspaceController.buildAndConnectWeatherView(this).apply { lockscreenSmartspaceController.buildAndConnectWeatherView(this, false).apply { layoutParams = FrameLayout.LayoutParams( FrameLayout.LayoutParams.WRAP_CONTENT, Loading @@ -184,7 +184,7 @@ constructor( factory = { context -> FrameLayout(context).apply { addView( lockscreenSmartspaceController.buildAndConnectDateView(this).apply { lockscreenSmartspaceController.buildAndConnectDateView(this, false).apply { layoutParams = FrameLayout.LayoutParams( FrameLayout.LayoutParams.WRAP_CONTENT, Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/ui/view/layout/sections/ClockSectionTest.kt +99 −1 Original line number Diff line number Diff line Loading @@ -19,6 +19,8 @@ package com.android.systemui.keyguard.ui.view.layout.sections import android.content.pm.PackageManager import android.content.res.Resources import android.platform.test.annotations.DisableFlags import android.platform.test.annotations.EnableFlags import android.view.View.GONE import android.view.View.VISIBLE import androidx.constraintlayout.widget.ConstraintSet Loading Loading @@ -128,6 +130,7 @@ class ClockSectionTest : SysuiTestCase() { } @Test @DisableFlags(com.android.systemui.shared.Flags.FLAG_CLOCK_REACTIVE_VARIANTS) fun testApplyDefaultConstraints_LargeClock_SplitShade() = kosmos.testScope.runTest { with(kosmos) { Loading @@ -144,6 +147,25 @@ class ClockSectionTest : SysuiTestCase() { } @Test @EnableFlags(com.android.systemui.shared.Flags.FLAG_CLOCK_REACTIVE_VARIANTS) fun testApplyDefaultConstraints_LargeClock_SplitShade_ReactiveVariantsOn() = kosmos.testScope.runTest { with(kosmos) { shadeRepository.setShadeLayoutWide(true) keyguardClockInteractor.setClockSize(ClockSize.LARGE) advanceUntilIdle() } val cs = ConstraintSet() underTest.applyDefaultConstraints(cs) assertLargeClockTop(cs, LARGE_CLOCK_TOP_WITHOUT_SMARTSPACE + ENHANCED_SMART_SPACE_HEIGHT) assertSmallClockTop(cs) } @Test @DisableFlags(com.android.systemui.shared.Flags.FLAG_CLOCK_REACTIVE_VARIANTS) fun testApplyDefaultConstraints_LargeClock_NonSplitShade() = kosmos.testScope.runTest { with(kosmos) { Loading @@ -166,6 +188,31 @@ class ClockSectionTest : SysuiTestCase() { } } @Test @EnableFlags(com.android.systemui.shared.Flags.FLAG_CLOCK_REACTIVE_VARIANTS) fun testApplyDefaultConstraints_LargeClock_NonSplitShade_reactiveVariantsOn() = kosmos.testScope.runTest { with(kosmos) { val isShadeLayoutWide by collectLastValue(shadeRepository.isShadeLayoutWide) val isLargeClockVisible by collectLastValue(keyguardClockViewModel.isLargeClockVisible) shadeRepository.setShadeLayoutWide(false) keyguardClockInteractor.setClockSize(ClockSize.LARGE) notificationsKeyguardInteractor.setNotificationsFullyHidden(true) keyguardSmartspaceInteractor.setBcSmartspaceVisibility(VISIBLE) fakeConfigurationController.notifyConfigurationChanged() advanceUntilIdle() val cs = ConstraintSet() underTest.applyDefaultConstraints(cs) assertLargeClockTop(cs, LARGE_CLOCK_TOP_WITHOUT_SMARTSPACE + ENHANCED_SMART_SPACE_HEIGHT) assertSmallClockTop(cs) } } @Test fun testApplyDefaultConstraints_LargeClock_MissingSmartspace_SplitShade() = kosmos.testScope.runTest { Loading Loading @@ -215,6 +262,7 @@ class ClockSectionTest : SysuiTestCase() { } @Test @DisableFlags(com.android.systemui.shared.Flags.FLAG_CLOCK_REACTIVE_VARIANTS) fun testApplyDefaultConstraints_SmallClock_SplitShade() = kosmos.testScope.runTest { with(kosmos) { Loading @@ -238,6 +286,32 @@ class ClockSectionTest : SysuiTestCase() { } @Test @EnableFlags(com.android.systemui.shared.Flags.FLAG_CLOCK_REACTIVE_VARIANTS) fun testApplyDefaultConstraints_SmallClock_SplitShade_ReactiveVariantsOn() = kosmos.testScope.runTest { with(kosmos) { val isShadeLayoutWide by collectLastValue(shadeRepository.isShadeLayoutWide) val isLargeClockVisible by collectLastValue(keyguardClockViewModel.isLargeClockVisible) shadeRepository.setShadeLayoutWide(true) keyguardClockInteractor.setClockSize(ClockSize.SMALL) notificationsKeyguardInteractor.setNotificationsFullyHidden(true) keyguardSmartspaceInteractor.setBcSmartspaceVisibility(VISIBLE) fakeConfigurationController.notifyConfigurationChanged() advanceUntilIdle() val cs = ConstraintSet() underTest.applyDefaultConstraints(cs) assertLargeClockTop(cs, LARGE_CLOCK_TOP_WITHOUT_SMARTSPACE + ENHANCED_SMART_SPACE_HEIGHT) assertSmallClockTop(cs) } } @Test @DisableFlags(com.android.systemui.shared.Flags.FLAG_CLOCK_REACTIVE_VARIANTS) fun testApplyDefaultConstraints_SmallClock_NonSplitShade() = kosmos.testScope.runTest { with(kosmos) { Loading @@ -259,6 +333,30 @@ class ClockSectionTest : SysuiTestCase() { } } @Test @EnableFlags(com.android.systemui.shared.Flags.FLAG_CLOCK_REACTIVE_VARIANTS) fun testApplyDefaultConstraints_SmallClock_NonSplitShade_ReactiveVariantsOn() = kosmos.testScope.runTest { with(kosmos) { val isShadeLayoutWide by collectLastValue(shadeRepository.isShadeLayoutWide) val isLargeClockVisible by collectLastValue(keyguardClockViewModel.isLargeClockVisible) shadeRepository.setShadeLayoutWide(false) keyguardClockInteractor.setClockSize(ClockSize.SMALL) notificationsKeyguardInteractor.setNotificationsFullyHidden(true) keyguardSmartspaceInteractor.setBcSmartspaceVisibility(VISIBLE) fakeConfigurationController.notifyConfigurationChanged() advanceUntilIdle() val cs = ConstraintSet() underTest.applyDefaultConstraints(cs) assertLargeClockTop(cs, LARGE_CLOCK_TOP_WITHOUT_SMARTSPACE + ENHANCED_SMART_SPACE_HEIGHT) assertSmallClockTop(cs) } } @Test fun testSmartspaceVisible_weatherClockDateAndIconsBarrierBottomBelowBCSmartspace() = kosmos.testScope.runTest { Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/ui/view/layout/sections/SmartspaceSectionTest.kt +15 −2 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.systemui.keyguard.ui.view.layout.sections import android.platform.test.annotations.DisableFlags import android.view.View import android.widget.LinearLayout import androidx.constraintlayout.widget.ConstraintLayout Loading @@ -31,6 +32,7 @@ import com.android.systemui.keyguard.KeyguardUnlockAnimationController import com.android.systemui.keyguard.domain.interactor.KeyguardBlueprintInteractor import com.android.systemui.keyguard.domain.interactor.KeyguardSmartspaceInteractor import com.android.systemui.keyguard.ui.viewmodel.KeyguardClockViewModel import com.android.systemui.keyguard.ui.viewmodel.KeyguardRootViewModel import com.android.systemui.keyguard.ui.viewmodel.KeyguardSmartspaceViewModel import com.android.systemui.res.R import com.android.systemui.shared.R as sharedR Loading @@ -48,6 +50,7 @@ import org.mockito.MockitoAnnotations @RunWith(AndroidJUnit4::class) @SmallTest @DisableFlags(com.android.systemui.shared.Flags.FLAG_CLOCK_REACTIVE_VARIANTS) class SmartspaceSectionTest : SysuiTestCase() { private lateinit var underTest: SmartspaceSection @Mock private lateinit var keyguardClockViewModel: KeyguardClockViewModel Loading @@ -56,6 +59,7 @@ class SmartspaceSectionTest : SysuiTestCase() { @Mock private lateinit var keyguardUnlockAnimationController: KeyguardUnlockAnimationController @Mock private lateinit var keyguardSmartspaceInteractor: KeyguardSmartspaceInteractor @Mock private lateinit var blueprintInteractor: Lazy<KeyguardBlueprintInteractor> @Mock private lateinit var keyguardRootViewModel: KeyguardRootViewModel private val smartspaceView = View(mContext).also { it.id = sharedR.id.bc_smartspace_view } private val weatherView = View(mContext).also { it.id = sharedR.id.weather_smartspace_view } Loading @@ -80,13 +84,14 @@ class SmartspaceSectionTest : SysuiTestCase() { lockscreenSmartspaceController, keyguardUnlockAnimationController, blueprintInteractor, keyguardRootViewModel, ) constraintLayout = ConstraintLayout(mContext) whenever(lockscreenSmartspaceController.buildAndConnectView(any())) .thenReturn(smartspaceView) whenever(lockscreenSmartspaceController.buildAndConnectWeatherView(any())) whenever(lockscreenSmartspaceController.buildAndConnectWeatherView(any(), any())) .thenReturn(weatherView) whenever(lockscreenSmartspaceController.buildAndConnectDateView(any())).thenReturn(dateView) whenever(lockscreenSmartspaceController.buildAndConnectDateView(any(), any())).thenReturn(dateView) whenever(keyguardClockViewModel.hasCustomWeatherDataDisplay) .thenReturn(hasCustomWeatherDataDisplay) whenever(keyguardClockViewModel.clockShouldBeCentered).thenReturn(clockShouldBeCentered) Loading @@ -97,6 +102,7 @@ class SmartspaceSectionTest : SysuiTestCase() { } @Test @DisableFlags(com.android.systemui.shared.Flags.FLAG_CLOCK_REACTIVE_VARIANTS) fun testAddViews_notSmartspaceEnabled() { whenever(keyguardSmartspaceViewModel.isSmartspaceEnabled).thenReturn(false) val constraintLayout = ConstraintLayout(mContext) Loading @@ -107,6 +113,7 @@ class SmartspaceSectionTest : SysuiTestCase() { } @Test @DisableFlags(com.android.systemui.shared.Flags.FLAG_CLOCK_REACTIVE_VARIANTS) fun testAddViews_smartspaceEnabled_dateWeatherDecoupled() { whenever(keyguardSmartspaceViewModel.isDateWeatherDecoupled).thenReturn(true) underTest.addViews(constraintLayout) Loading @@ -125,6 +132,7 @@ class SmartspaceSectionTest : SysuiTestCase() { } @Test @DisableFlags(com.android.systemui.shared.Flags.FLAG_CLOCK_REACTIVE_VARIANTS) fun testConstraintsWhenShadeLayoutIsNotWide() { underTest.addViews(constraintLayout) underTest.applyConstraints(constraintSet) Loading @@ -134,6 +142,7 @@ class SmartspaceSectionTest : SysuiTestCase() { } @Test @DisableFlags(com.android.systemui.shared.Flags.FLAG_CLOCK_REACTIVE_VARIANTS) fun testConstraintsWhenShadeLayoutIsWide() { isShadeLayoutWide.value = true Loading @@ -145,6 +154,7 @@ class SmartspaceSectionTest : SysuiTestCase() { } @Test @DisableFlags(com.android.systemui.shared.Flags.FLAG_CLOCK_REACTIVE_VARIANTS) fun testConstraintsWhenNotHasCustomWeatherDataDisplay() { whenever(keyguardSmartspaceViewModel.isDateWeatherDecoupled).thenReturn(true) underTest.addViews(constraintLayout) Loading @@ -159,6 +169,7 @@ class SmartspaceSectionTest : SysuiTestCase() { } @Test @DisableFlags(com.android.systemui.shared.Flags.FLAG_CLOCK_REACTIVE_VARIANTS) fun testConstraintsWhenHasCustomWeatherDataDisplay() { hasCustomWeatherDataDisplay.value = true underTest.addViews(constraintLayout) Loading @@ -169,6 +180,7 @@ class SmartspaceSectionTest : SysuiTestCase() { } @Test @DisableFlags(com.android.systemui.shared.Flags.FLAG_CLOCK_REACTIVE_VARIANTS) fun testNormalDateWeatherVisibility() { isWeatherVisibleFlow.value = true underTest.addViews(constraintLayout) Loading @@ -182,6 +194,7 @@ class SmartspaceSectionTest : SysuiTestCase() { } @Test @DisableFlags(com.android.systemui.shared.Flags.FLAG_CLOCK_REACTIVE_VARIANTS) fun testCustomDateWeatherVisibility() { hasCustomWeatherDataDisplay.value = true underTest.addViews(constraintLayout) Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/lockscreen/LockscreenSmartspaceControllerTest.kt +2 −2 Original line number Diff line number Diff line Loading @@ -846,7 +846,7 @@ class LockscreenSmartspaceControllerTest : SysuiTestCase() { } private fun connectSession() { val dateView = controller.buildAndConnectDateView(fakeParent) val dateView = controller.buildAndConnectDateView(fakeParent, false) dateSmartspaceView = dateView as SmartspaceView fakeParent.addView(dateView) controller.stateChangeListener.onViewAttachedToWindow(dateView) Loading @@ -860,7 +860,7 @@ class LockscreenSmartspaceControllerTest : SysuiTestCase() { verify(dateSmartspaceView).setPrimaryTextColor(anyInt()) verify(dateSmartspaceView).setDozeAmount(0.5f) val weatherView = controller.buildAndConnectWeatherView(fakeParent) val weatherView = controller.buildAndConnectWeatherView(fakeParent, false) weatherSmartspaceView = weatherView as SmartspaceView fakeParent.addView(weatherView) controller.stateChangeListener.onViewAttachedToWindow(weatherView) Loading
packages/SystemUI/plugin/bcsmartspace/src/com/android/systemui/plugins/BcSmartspaceDataPlugin.java +4 −0 Original line number Diff line number Diff line Loading @@ -85,6 +85,10 @@ public interface BcSmartspaceDataPlugin extends Plugin { throw new UnsupportedOperationException("Not implemented by " + getClass()); } default SmartspaceView getLargeClockView(ViewGroup parent) { throw new UnsupportedOperationException("Not implemented by " + getClass()); } /** * As the smartspace view becomes available, allow listeners to receive an event. */ Loading