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

Commit b3b1113a authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 10923648 from dfa0a60a to 24Q1-release

Change-Id: Ic6da75575f1496937d16acb5fa3d480d81266af2
parents 878ea960 dfa0a60a
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -17,14 +17,13 @@ package com.android.customization.module.logging

import android.stats.style.StyleEnums
import androidx.annotation.IntDef
import com.android.customization.model.color.ColorOption
import com.android.customization.model.grid.GridOption
import com.android.wallpaper.module.logging.UserEventLogger

/** Extension of [UserEventLogger] that adds ThemePicker specific events. */
interface ThemesUserEventLogger : UserEventLogger {

    fun logThemeColorApplied(colorOption: ColorOption)
    fun logThemeColorApplied(@ColorSource source: Int, variant: Int, seedColor: Int)

    fun logGridApplied(grid: GridOption)

@@ -42,6 +41,15 @@ interface ThemesUserEventLogger : UserEventLogger {

    fun logDarkThemeApplied(useDarkTheme: Boolean)

    @IntDef(
        StyleEnums.COLOR_SOURCE_UNSPECIFIED,
        StyleEnums.COLOR_SOURCE_HOME_SCREEN_WALLPAPER,
        StyleEnums.COLOR_SOURCE_LOCK_SCREEN_WALLPAPER,
        StyleEnums.COLOR_SOURCE_PRESET_COLOR,
    )
    @Retention(AnnotationRetention.SOURCE)
    annotation class ColorSource

    @IntDef(
        StyleEnums.CLOCK_SIZE_UNSPECIFIED,
        StyleEnums.CLOCK_SIZE_DYNAMIC,
+9 −4
Original line number Diff line number Diff line
@@ -19,9 +19,9 @@ import android.app.WallpaperManager
import android.content.Intent
import android.stats.style.StyleEnums
import android.text.TextUtils
import com.android.customization.model.color.ColorOption
import com.android.customization.model.grid.GridOption
import com.android.customization.module.logging.ThemesUserEventLogger.ClockSize
import com.android.customization.module.logging.ThemesUserEventLogger.ColorSource
import com.android.systemui.shared.system.SysUiStatsLog
import com.android.wallpaper.module.WallpaperPersister.DEST_BOTH
import com.android.wallpaper.module.WallpaperPersister.DEST_HOME_SCREEN
@@ -115,10 +115,15 @@ class ThemesUserEventLoggerImpl(private val preferences: WallpaperPreferences) :
        SysUiStatsLogger(StyleEnums.WALLPAPER_EXPLORE).log()
    }

    override fun logThemeColorApplied(colorOption: ColorOption) {
    override fun logThemeColorApplied(
        @ColorSource source: Int,
        variant: Int,
        seedColor: Int,
    ) {
        SysUiStatsLogger(StyleEnums.THEME_COLOR_APPLIED)
            .setColorPreference(colorOption.index)
            .setColorVariant(colorOption.style.ordinal + 1)
            .setColorSource(source)
            .setColorVariant(variant)
            .setSeedColor(seedColor)
            .log()
    }

+2 −2
Original line number Diff line number Diff line
@@ -15,14 +15,14 @@
 */
package com.android.customization.module.logging

import com.android.customization.model.color.ColorOption
import com.android.customization.model.grid.GridOption
import com.android.customization.module.logging.ThemesUserEventLogger.ColorSource
import com.android.wallpaper.module.logging.TestUserEventLogger

/** Test implementation of [ThemesUserEventLogger]. */
class TestThemesUserEventLogger : TestUserEventLogger(), ThemesUserEventLogger {

    override fun logThemeColorApplied(colorOption: ColorOption) {}
    override fun logThemeColorApplied(@ColorSource source: Int, variant: Int, seedColor: Int) {}

    override fun logGridApplied(grid: GridOption) {}