Loading packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/data/repository/KeyguardRepositoryImplTest.kt +12 −0 Original line number Diff line number Diff line Loading @@ -138,6 +138,18 @@ class KeyguardRepositoryImplTest : SysuiTestCase() { assertThat(underTest.bottomAreaAlpha.value).isEqualTo(1f) } @Test fun topClippingBounds() = testScope.runTest { assertThat(underTest.topClippingBounds.value).isNull() underTest.topClippingBounds.value = 50 assertThat(underTest.topClippingBounds.value).isEqualTo(50) underTest.topClippingBounds.value = 500 assertThat(underTest.topClippingBounds.value).isEqualTo(500) } @Test fun clockPosition() = testScope.runTest { Loading packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardRootViewModelTest.kt +16 −3 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import com.android.systemui.Flags.FLAG_NEW_AOD_TRANSITION import com.android.systemui.SysuiTestCase import com.android.systemui.coroutines.collectLastValue import com.android.systemui.deviceentry.data.repository.fakeDeviceEntryRepository import com.android.systemui.keyguard.data.repository.fakeKeyguardRepository import com.android.systemui.keyguard.data.repository.fakeKeyguardTransitionRepository import com.android.systemui.keyguard.shared.model.KeyguardState import com.android.systemui.keyguard.shared.model.TransitionState Loading Loading @@ -54,13 +55,12 @@ class KeyguardRootViewModelTest : SysuiTestCase() { private val kosmos = testKosmos() private val testScope = kosmos.testScope private val keyguardTransitionRepository = kosmos.fakeKeyguardTransitionRepository private val keyguardRepository = kosmos.fakeKeyguardRepository private val screenOffAnimationController = kosmos.screenOffAnimationController private val deviceEntryRepository = kosmos.fakeDeviceEntryRepository private val notificationsKeyguardInteractor = kosmos.notificationsKeyguardInteractor private val dozeParameters = kosmos.dozeParameters private val underTest by lazy { kosmos.keyguardRootViewModel } private val underTest by lazy { kosmos.keyguardRootViewModel } @Before fun setUp() { Loading Loading @@ -206,6 +206,19 @@ class KeyguardRootViewModelTest : SysuiTestCase() { assertThat(isVisible?.isAnimating).isEqualTo(false) } @Test fun topClippingBounds() = testScope.runTest { val topClippingBounds by collectLastValue(underTest.topClippingBounds) assertThat(topClippingBounds).isNull() keyguardRepository.topClippingBounds.value = 50 assertThat(topClippingBounds).isEqualTo(50) keyguardRepository.topClippingBounds.value = 1000 assertThat(topClippingBounds).isEqualTo(1000) } @Test fun alpha_glanceableHubOpen_isZero() = testScope.runTest { Loading packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitch.java +6 −2 Original line number Diff line number Diff line Loading @@ -477,9 +477,13 @@ public class KeyguardClockSwitch extends RelativeLayout { public void dump(PrintWriter pw, String[] args) { pw.println("KeyguardClockSwitch:"); pw.println(" mSmallClockFrame = " + mSmallClockFrame); if (mSmallClockFrame != null) { pw.println(" mSmallClockFrame.alpha = " + mSmallClockFrame.getAlpha()); } pw.println(" mLargeClockFrame = " + mLargeClockFrame); if (mLargeClockFrame != null) { pw.println(" mLargeClockFrame.alpha = " + mLargeClockFrame.getAlpha()); } pw.println(" mStatusArea = " + mStatusArea); pw.println(" mDisplayedClockSize = " + mDisplayedClockSize); } Loading packages/SystemUI/src/com/android/systemui/keyguard/data/repository/KeyguardRepository.kt +5 −0 Original line number Diff line number Diff line Loading @@ -132,6 +132,9 @@ interface KeyguardRepository { */ val isDozing: StateFlow<Boolean> /** Keyguard can be clipped at the top as the shade is dragged */ val topClippingBounds: MutableStateFlow<Int?> /** * Observable for whether the device is dreaming. * Loading Loading @@ -326,6 +329,8 @@ constructor( private val _clockShouldBeCentered = MutableStateFlow(true) override val clockShouldBeCentered: Flow<Boolean> = _clockShouldBeCentered.asStateFlow() override val topClippingBounds = MutableStateFlow<Int?>(null) override val isKeyguardShowing: Flow<Boolean> = conflatedCallbackFlow { val callback = Loading packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardInteractor.kt +12 −0 Original line number Diff line number Diff line Loading @@ -171,6 +171,14 @@ constructor( /** Whether the keyguard is going away. */ val isKeyguardGoingAway: Flow<Boolean> = repository.isKeyguardGoingAway /** Keyguard can be clipped at the top as the shade is dragged */ val topClippingBounds: Flow<Int?> = combine(configurationInteractor.onAnyConfigurationChange, repository.topClippingBounds) { _, topClippingBounds -> topClippingBounds } /** Last point that [KeyguardRootView] view was tapped */ val lastRootViewTapPosition: Flow<Point?> = repository.lastRootViewTapPosition.asStateFlow() Loading Loading @@ -328,6 +336,10 @@ constructor( repository.keyguardDoneAnimationsFinished() } fun setTopClippingBounds(top: Int?) { repository.topClippingBounds.value = top } companion object { private const val TAG = "KeyguardInteractor" } Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/data/repository/KeyguardRepositoryImplTest.kt +12 −0 Original line number Diff line number Diff line Loading @@ -138,6 +138,18 @@ class KeyguardRepositoryImplTest : SysuiTestCase() { assertThat(underTest.bottomAreaAlpha.value).isEqualTo(1f) } @Test fun topClippingBounds() = testScope.runTest { assertThat(underTest.topClippingBounds.value).isNull() underTest.topClippingBounds.value = 50 assertThat(underTest.topClippingBounds.value).isEqualTo(50) underTest.topClippingBounds.value = 500 assertThat(underTest.topClippingBounds.value).isEqualTo(500) } @Test fun clockPosition() = testScope.runTest { Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardRootViewModelTest.kt +16 −3 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import com.android.systemui.Flags.FLAG_NEW_AOD_TRANSITION import com.android.systemui.SysuiTestCase import com.android.systemui.coroutines.collectLastValue import com.android.systemui.deviceentry.data.repository.fakeDeviceEntryRepository import com.android.systemui.keyguard.data.repository.fakeKeyguardRepository import com.android.systemui.keyguard.data.repository.fakeKeyguardTransitionRepository import com.android.systemui.keyguard.shared.model.KeyguardState import com.android.systemui.keyguard.shared.model.TransitionState Loading Loading @@ -54,13 +55,12 @@ class KeyguardRootViewModelTest : SysuiTestCase() { private val kosmos = testKosmos() private val testScope = kosmos.testScope private val keyguardTransitionRepository = kosmos.fakeKeyguardTransitionRepository private val keyguardRepository = kosmos.fakeKeyguardRepository private val screenOffAnimationController = kosmos.screenOffAnimationController private val deviceEntryRepository = kosmos.fakeDeviceEntryRepository private val notificationsKeyguardInteractor = kosmos.notificationsKeyguardInteractor private val dozeParameters = kosmos.dozeParameters private val underTest by lazy { kosmos.keyguardRootViewModel } private val underTest by lazy { kosmos.keyguardRootViewModel } @Before fun setUp() { Loading Loading @@ -206,6 +206,19 @@ class KeyguardRootViewModelTest : SysuiTestCase() { assertThat(isVisible?.isAnimating).isEqualTo(false) } @Test fun topClippingBounds() = testScope.runTest { val topClippingBounds by collectLastValue(underTest.topClippingBounds) assertThat(topClippingBounds).isNull() keyguardRepository.topClippingBounds.value = 50 assertThat(topClippingBounds).isEqualTo(50) keyguardRepository.topClippingBounds.value = 1000 assertThat(topClippingBounds).isEqualTo(1000) } @Test fun alpha_glanceableHubOpen_isZero() = testScope.runTest { Loading
packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitch.java +6 −2 Original line number Diff line number Diff line Loading @@ -477,9 +477,13 @@ public class KeyguardClockSwitch extends RelativeLayout { public void dump(PrintWriter pw, String[] args) { pw.println("KeyguardClockSwitch:"); pw.println(" mSmallClockFrame = " + mSmallClockFrame); if (mSmallClockFrame != null) { pw.println(" mSmallClockFrame.alpha = " + mSmallClockFrame.getAlpha()); } pw.println(" mLargeClockFrame = " + mLargeClockFrame); if (mLargeClockFrame != null) { pw.println(" mLargeClockFrame.alpha = " + mLargeClockFrame.getAlpha()); } pw.println(" mStatusArea = " + mStatusArea); pw.println(" mDisplayedClockSize = " + mDisplayedClockSize); } Loading
packages/SystemUI/src/com/android/systemui/keyguard/data/repository/KeyguardRepository.kt +5 −0 Original line number Diff line number Diff line Loading @@ -132,6 +132,9 @@ interface KeyguardRepository { */ val isDozing: StateFlow<Boolean> /** Keyguard can be clipped at the top as the shade is dragged */ val topClippingBounds: MutableStateFlow<Int?> /** * Observable for whether the device is dreaming. * Loading Loading @@ -326,6 +329,8 @@ constructor( private val _clockShouldBeCentered = MutableStateFlow(true) override val clockShouldBeCentered: Flow<Boolean> = _clockShouldBeCentered.asStateFlow() override val topClippingBounds = MutableStateFlow<Int?>(null) override val isKeyguardShowing: Flow<Boolean> = conflatedCallbackFlow { val callback = Loading
packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardInteractor.kt +12 −0 Original line number Diff line number Diff line Loading @@ -171,6 +171,14 @@ constructor( /** Whether the keyguard is going away. */ val isKeyguardGoingAway: Flow<Boolean> = repository.isKeyguardGoingAway /** Keyguard can be clipped at the top as the shade is dragged */ val topClippingBounds: Flow<Int?> = combine(configurationInteractor.onAnyConfigurationChange, repository.topClippingBounds) { _, topClippingBounds -> topClippingBounds } /** Last point that [KeyguardRootView] view was tapped */ val lastRootViewTapPosition: Flow<Point?> = repository.lastRootViewTapPosition.asStateFlow() Loading Loading @@ -328,6 +336,10 @@ constructor( repository.keyguardDoneAnimationsFinished() } fun setTopClippingBounds(top: Int?) { repository.topClippingBounds.value = top } companion object { private const val TAG = "KeyguardInteractor" } Loading