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

Commit 33f91905 authored by George Lin's avatar George Lin Committed by Android (Google) Code Review
Browse files

Merge "Fix clock logging" into main

parents 9ef12bb6 b0b6145a
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()

    val _previewingClockStyleOptionIndex = MutableStateFlow<Int>(0)
@@ -318,6 +318,7 @@ constructor(
                        fun() {
                            _previewingClockStyleOptionIndex.value = index
                            overridingClock.value = this
                            overridingClockPresetIndexedStyle.value = null
                        }
                    }
                },
@@ -553,9 +554,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 ||
@@ -581,7 +580,10 @@ constructor(
                        axisSettings = clockAxisStyle,
                    )
                    if (isClockEdited) {
                        logger.logClockApplied(clockId = clockId)
                        logger.logClockApplied(
                            clockId = clockId,
                            useClockCustomization = isClockAxisStyleEdited,
                        )
                    }
                    if (isClockSizeEdited) {
                        logger.logClockSizeApplied(
Loading