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

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

Fix clock logging

Log the flag when we use clock customization

Test: Manually tested
Bug: 419063311
Flag: com.android.systemui.shared.new_customization_picker_ui
Change-Id: I87a9727a3ed4eabee4d9ea7b0c9c4daf5778309a
parent 1b6aab6e
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -27,7 +27,11 @@ interface ThemesUserEventLogger : UserEventLogger {

    fun logGridApplied(grid: GridOptionModel)

    fun logClockApplied(clockId: String)
    /**
     * @param useClockCustomization When setting style, if we use further clock customization like
     *   width, weight and round corners for the font.
     */
    fun logClockApplied(clockId: String, useClockCustomization: Boolean)

    fun logClockColorApplied(seedColor: Int)

+2 −1
Original line number Diff line number Diff line
@@ -234,11 +234,12 @@ constructor(
            .log()
    }

    override fun logClockApplied(clockId: String) {
    override fun logClockApplied(clockId: String, useClockCustomization: Boolean) {
        sysUiStatsLoggerFactory
            .get(CLOCK_APPLIED)
            .setAppSessionId(appSessionId.getId())
            .setClockPackageHash(getIdHashCode(clockId))
            .setUseClockCustomization(useClockCustomization)
            .log()
    }

+1 −1
Original line number Diff line number Diff line
@@ -102,7 +102,7 @@ constructor(
        selectedColorId: String?,
        @IntRange(from = 0, to = 100) colorToneProgress: Int?,
        @ColorInt seedColor: Int?,
        axisSettings: ClockAxisStyle,
        axisSettings: ClockAxisStyle?,
    ) {
        setClockOption(
            ClockSnapshotModel(
+1 −1
Original line number Diff line number Diff line
@@ -141,7 +141,7 @@ class ClockCarouselViewModel(
        setSelectedClockJob =
            viewModelScope.launch(backgroundDispatcher) {
                interactor.setSelectedClock(clockId)
                logger.logClockApplied(clockId)
                logger.logClockApplied(clockId, false)
            }
    }

+7 −5
Original line number Diff line number Diff line
@@ -151,7 +151,7 @@ constructor(
            }
            .distinctUntilChanged()

    val _previewingClockColorOptionIndex = MutableStateFlow<Int>(0)
    private val _previewingClockColorOptionIndex = MutableStateFlow<Int>(0)
    val previewingClockColorOptionIndex = _previewingClockColorOptionIndex.asStateFlow()

    // Represents show and hide of the clock view provided by the picker side.
@@ -312,6 +312,7 @@ constructor(
                    } else {
                        fun() {
                            overridingClock.value = this
                            overridingClockPresetIndexedStyle.value = null
                        }
                    }
                },
@@ -547,9 +548,7 @@ constructor(
            val size: ClockSize = array[6] as ClockSize
            val previewingColorId: String = array[7] as String
            val previewingColorSliderProgress: Int = array[8] as Int
            val clockAxisStyle: ClockAxisStyle =
                (array[9] as? IndexedStyle)?.style ?: ClockAxisStyle()

            val clockAxisStyle: ClockAxisStyle? = (array[9] as? IndexedStyle)?.style
            val isEdited =
                isClockEdited ||
                    isClockAxisStyleEdited ||
@@ -575,7 +574,10 @@ constructor(
                        axisSettings = clockAxisStyle,
                    )
                    if (isClockEdited) {
                        logger.logClockApplied(clockId = clockId)
                        logger.logClockApplied(
                            clockId = clockId,
                            useClockCustomization = isClockAxisStyleEdited,
                        )
                    }
                    if (isClockSizeEdited) {
                        logger.logClockSizeApplied(
Loading