Merge "Modify theme color applied log" into main
diff --git a/src/com/android/customization/module/logging/ThemesUserEventLogger.kt b/src/com/android/customization/module/logging/ThemesUserEventLogger.kt
index 1210343..087bef4 100644
--- a/src/com/android/customization/module/logging/ThemesUserEventLogger.kt
+++ b/src/com/android/customization/module/logging/ThemesUserEventLogger.kt
@@ -17,14 +17,13 @@
 
 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)
 
@@ -43,6 +42,15 @@
     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,
         StyleEnums.CLOCK_SIZE_SMALL,
diff --git a/src/com/android/customization/module/logging/ThemesUserEventLoggerImpl.kt b/src/com/android/customization/module/logging/ThemesUserEventLoggerImpl.kt
index 8eee709..78b5ca7 100644
--- a/src/com/android/customization/module/logging/ThemesUserEventLoggerImpl.kt
+++ b/src/com/android/customization/module/logging/ThemesUserEventLoggerImpl.kt
@@ -19,9 +19,9 @@
 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 @@
         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()
     }
 
diff --git a/tests/common/src/com/android/customization/module/logging/TestThemesUserEventLogger.kt b/tests/common/src/com/android/customization/module/logging/TestThemesUserEventLogger.kt
index b2835f4..a8989c5 100644
--- a/tests/common/src/com/android/customization/module/logging/TestThemesUserEventLogger.kt
+++ b/tests/common/src/com/android/customization/module/logging/TestThemesUserEventLogger.kt
@@ -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) {}