Add color logging function
- logColorApplied()
Bug: 186193935
Test: build & statsd_testdrive 179
Change-Id: I650d9f836b4c40fecc2f82d03ff0d01777fb421b
diff --git a/src/com/android/customization/module/StatsLogUserEventLogger.java b/src/com/android/customization/module/StatsLogUserEventLogger.java
index 0270c01..fecf19b 100644
--- a/src/com/android/customization/module/StatsLogUserEventLogger.java
+++ b/src/com/android/customization/module/StatsLogUserEventLogger.java
@@ -149,6 +149,14 @@
}
@Override
+ public void logColorApplied(int action, int colorIndex) {
+ SysUiStatsLog.write(STYLE_UI_CHANGED, action,
+ 0, 0, 0, 0, 0, 0, 0,
+ colorIndex,
+ 0, 0, 0);
+ }
+
+ @Override
public void logClockSelected(Clockface clock) {
SysUiStatsLog.write(STYLE_UI_CHANGED, StyleEnums.PICKER_SELECT,
0, 0, 0,
diff --git a/src/com/android/customization/module/ThemesUserEventLogger.java b/src/com/android/customization/module/ThemesUserEventLogger.java
index cacbc64..ae26290 100644
--- a/src/com/android/customization/module/ThemesUserEventLogger.java
+++ b/src/com/android/customization/module/ThemesUserEventLogger.java
@@ -29,6 +29,14 @@
void logThemeApplied(ThemeBundle theme, boolean isCustomTheme);
+ /**
+ * Logs the color usage while color is applied.
+ *
+ * @param action color applied action.
+ * @param colorIndex color applied index.
+ */
+ void logColorApplied(int action, int colorIndex);
+
void logClockSelected(Clockface clock);
void logClockApplied(Clockface clock);
diff --git a/tests/src/com/android/customization/testing/TestThemesUserEventLogger.java b/tests/src/com/android/customization/testing/TestThemesUserEventLogger.java
index 3600192..9969e6e 100644
--- a/tests/src/com/android/customization/testing/TestThemesUserEventLogger.java
+++ b/tests/src/com/android/customization/testing/TestThemesUserEventLogger.java
@@ -22,6 +22,11 @@
}
@Override
+ public void logColorApplied(int action, int colorIndex) {
+ // Do nothing.
+ }
+
+ @Override
public void logClockSelected(Clockface clock) {
// Do nothing.
}