Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b0b4d4c5 authored by George Lin's avatar George Lin
Browse files

Fix clock and smartspace missing initially

Test: Manully teseted. Unit test.
Bug: 416765447
Flag: com.android.systemui.shared.new_customization_picker_ui
Change-Id: I4dae54b5c0dcc0788e540c361353b9748f214a42
parent 944e5e7b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -577,7 +577,7 @@ constructor(private val defaultCustomizationOptionsBinder: DefaultCustomizationO
                    combine(
                            clockPickerViewModel.previewingClock,
                            clockPickerViewModel.previewingClockSize,
                            clockPickerViewModel.showClockControllerView,
                            clockPickerViewModel.showPickerClockControllerView,
                            ::Triple,
                        )
                        .collect { (clock, size, showClock) ->
+2 −2
Original line number Diff line number Diff line
@@ -151,7 +151,7 @@ constructor(

    // Represents show and hide of the clock view provided by the picker side.
    private val _showPickerClockControllerView: MutableStateFlow<Boolean> = MutableStateFlow(false)
    val showClockControllerView: Flow<Boolean> = _showPickerClockControllerView.asStateFlow()
    val showPickerClockControllerView: Flow<Boolean> = _showPickerClockControllerView.asStateFlow()

    /**
     * Set show or hide to [_showPickerClockControllerView]. We should set show when transition to
@@ -164,7 +164,7 @@ constructor(

    // Represents show and hide of the clock view and the smartspace at the keygard renderer side.
    private val _showKeyguardPreviewRendererSmartspace: MutableStateFlow<Boolean> =
        MutableStateFlow(false)
        MutableStateFlow(true)
    val showKeyguardPreviewRendererSmartspace: Flow<Boolean> =
        _showKeyguardPreviewRendererSmartspace.asStateFlow()

+16 −0
Original line number Diff line number Diff line
@@ -262,6 +262,22 @@ class ClockPickerViewModelTest {
        assertThat(option1OnClicked()).isNull()
    }

    @Test
    fun showPickerClockControllerView_false_by_default() = runTest {
        val showPickerClockControllerView =
            collectLastValue(underTest.showPickerClockControllerView)

        assertThat(showPickerClockControllerView()).isFalse()
    }

    @Test
    fun showKeyguardPreviewRendererSmartspace_true_by_default() = runTest {
        val showKeyguardPreviewRendererSmartspace =
            collectLastValue(underTest.showKeyguardPreviewRendererSmartspace)

        assertThat(showKeyguardPreviewRendererSmartspace()).isTrue()
    }

    //// Clock font
    @Test
    fun previewingClockPresetIndexedStyle_whenInitialState() = runTest {