summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Pan <johnpan@google.com>2022-04-12 15:52:35 +0800
committerJohn Pan <johnpan@google.com>2022-04-13 20:13:31 +0800
commit292fba02af57e5e9004be1865ef824790948c084 (patch)
tree2e2db0c170d2309fb9684b176957ea5b236be327
parent7b55f1f36aefecb7f1218a81e6d76747e57f16d1 (diff)
downloadThemePicker-292fba02af57e5e9004be1865ef824790948c084.tar.gz
Add logging for color variants
Bug: 223304277 Test: Manual Change-Id: I65e9b4368538b3447e199e834c0d424d797d9667
-rw-r--r--src/com/android/customization/model/color/ColorSectionController.java2
-rw-r--r--src/com/android/customization/module/StatsLogUserEventLogger.java42
-rw-r--r--src/com/android/customization/module/ThemesUserEventLogger.java5
-rw-r--r--tests/src/com/android/customization/testing/TestThemesUserEventLogger.java3
4 files changed, 28 insertions, 24 deletions
diff --git a/src/com/android/customization/model/color/ColorSectionController.java b/src/com/android/customization/model/color/ColorSectionController.java
index afd5ebfa..4c163e65 100644
--- a/src/com/android/customization/model/color/ColorSectionController.java
+++ b/src/com/android/customization/model/color/ColorSectionController.java
@@ -346,7 +346,7 @@ public class ColorSectionController implements CustomizationSectionController<Co
public void onSuccess() {
mColorSectionView.announceForAccessibility(
mColorSectionView.getContext().getString(R.string.color_changed));
- mEventLogger.logColorApplied(getColorAction(colorOption), colorOption.getIndex());
+ mEventLogger.logColorApplied(getColorAction(colorOption), colorOption);
}
@Override
diff --git a/src/com/android/customization/module/StatsLogUserEventLogger.java b/src/com/android/customization/module/StatsLogUserEventLogger.java
index 751edf3e..216395d3 100644
--- a/src/com/android/customization/module/StatsLogUserEventLogger.java
+++ b/src/com/android/customization/module/StatsLogUserEventLogger.java
@@ -46,6 +46,7 @@ import android.text.TextUtils;
import androidx.annotation.Nullable;
import com.android.customization.model.clock.Clockface;
+import com.android.customization.model.color.ColorOption;
import com.android.customization.model.grid.GridOption;
import com.android.customization.model.theme.ThemeBundle;
import com.android.systemui.shared.system.SysUiStatsLog;
@@ -79,31 +80,31 @@ public class StatsLogUserEventLogger extends NoOpUserEventLogger implements Them
public void logAppLaunched(Intent launchSource) {
SysUiStatsLog.write(STYLE_UI_CHANGED, STYLE_UICHANGED__ACTION__APP_LAUNCHED,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, getAppLaunchSource(launchSource), 0, 0,
- 0, 0, 0, 0, 0);
+ 0, 0, 0, 0, 0, 0);
}
@Override
public void logResumed(boolean provisioned, boolean wallpaper) {
SysUiStatsLog.write(STYLE_UI_CHANGED, StyleEnums.ONRESUME,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
}
@Override
public void logStopped() {
SysUiStatsLog.write(STYLE_UI_CHANGED, StyleEnums.ONSTOP,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
}
@Override
public void logActionClicked(String collectionId, int actionLabelResId) {
SysUiStatsLog.write(STYLE_UI_CHANGED, StyleEnums.WALLPAPER_EXPLORE, 0, 0, 0, 0, 0,
- getIdHashCode(collectionId), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ getIdHashCode(collectionId), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
}
@Override
public void logIndividualWallpaperSelected(String collectionId) {
SysUiStatsLog.write(STYLE_UI_CHANGED, StyleEnums.WALLPAPER_SELECT, 0, 0, 0, 0, 0,
- getIdHashCode(collectionId), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ getIdHashCode(collectionId), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
}
@Override
@@ -111,7 +112,7 @@ public class StatsLogUserEventLogger extends NoOpUserEventLogger implements Them
SysUiStatsLog.write(STYLE_UI_CHANGED, StyleEnums.WALLPAPER_OPEN_CATEGORY,
0, 0, 0, 0, 0,
getIdHashCode(collectionId),
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
}
@Override
@@ -120,7 +121,7 @@ public class StatsLogUserEventLogger extends NoOpUserEventLogger implements Them
0, 0, 0, 0, 0,
getIdHashCode(collectionId),
getIdHashCode(wallpaperId),
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
}
@Override
@@ -130,7 +131,7 @@ public class StatsLogUserEventLogger extends NoOpUserEventLogger implements Them
0, 0, 0, 0, 0,
getIdHashCode(collectionId),
getIdHashCode(wallpaperId),
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
}
@Override
@@ -154,7 +155,8 @@ public class StatsLogUserEventLogger extends NoOpUserEventLogger implements Them
getIdHashCode(lockWallpaperId),
mPreferences.getFirstLaunchDateSinceSetup(),
mPreferences.getFirstWallpaperApplyDateSinceSetup(),
- mPreferences.getAppLaunchCount());
+ mPreferences.getAppLaunchCount(),
+ 0);
}
@Override
@@ -165,14 +167,14 @@ public class StatsLogUserEventLogger extends NoOpUserEventLogger implements Them
getIdHashCode(collectionId),
getIdHashCode(wallpaperId),
0, 0, 0, 0, 0, effects != null ? effects.hashCode() : 0,
- 0, 0, 0, 0, 0);
+ 0, 0, 0, 0, 0, 0);
}
@Override
public void logEffectApply(String effect, @EffectStatus int status) {
SysUiStatsLog.write(STYLE_UI_CHANGED, StyleEnums.WALLPAPER_EFFECT_APPLIED,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, status, effect != null ? effect.hashCode() : 0,
- 0, 0, 0, 0, 0);
+ 0, 0, 0, 0, 0, 0);
}
@Nullable
@@ -187,7 +189,7 @@ public class StatsLogUserEventLogger extends NoOpUserEventLogger implements Them
Objects.hashCode(getThemePackage(theme, OVERLAY_CATEGORY_COLOR)),
Objects.hashCode(getThemePackage(theme,OVERLAY_CATEGORY_FONT)),
Objects.hashCode(getThemePackage(theme, OVERLAY_CATEGORY_SHAPE)),
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
}
@Override
@@ -196,15 +198,15 @@ public class StatsLogUserEventLogger extends NoOpUserEventLogger implements Them
Objects.hashCode(getThemePackage(theme, OVERLAY_CATEGORY_COLOR)),
Objects.hashCode(getThemePackage(theme,OVERLAY_CATEGORY_FONT)),
Objects.hashCode(getThemePackage(theme, OVERLAY_CATEGORY_SHAPE)),
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
}
@Override
- public void logColorApplied(int action, int colorIndex) {
+ public void logColorApplied(int action, ColorOption colorOption) {
SysUiStatsLog.write(STYLE_UI_CHANGED, action,
0, 0, 0, 0, 0, 0, 0,
- colorIndex,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ colorOption.getIndex(),
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, colorOption.getStyle().ordinal() + 1);
}
@Override
@@ -212,7 +214,7 @@ public class StatsLogUserEventLogger extends NoOpUserEventLogger implements Them
SysUiStatsLog.write(STYLE_UI_CHANGED, StyleEnums.PICKER_SELECT,
0, 0, 0,
Objects.hashCode(clock.getId()),
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
}
@Override
@@ -220,7 +222,7 @@ public class StatsLogUserEventLogger extends NoOpUserEventLogger implements Them
SysUiStatsLog.write(STYLE_UI_CHANGED, StyleEnums.PICKER_APPLIED,
0, 0, 0,
Objects.hashCode(clock.getId()),
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
}
@Override
@@ -228,7 +230,7 @@ public class StatsLogUserEventLogger extends NoOpUserEventLogger implements Them
SysUiStatsLog.write(STYLE_UI_CHANGED, StyleEnums.PICKER_SELECT,
0, 0, 0, 0,
grid.cols,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
}
@Override
@@ -236,7 +238,7 @@ public class StatsLogUserEventLogger extends NoOpUserEventLogger implements Them
SysUiStatsLog.write(STYLE_UI_CHANGED, StyleEnums.PICKER_APPLIED,
0, 0, 0, 0,
grid.cols,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
}
private int getAppLaunchSource(Intent launchSource) {
diff --git a/src/com/android/customization/module/ThemesUserEventLogger.java b/src/com/android/customization/module/ThemesUserEventLogger.java
index ae262902..3e5bb545 100644
--- a/src/com/android/customization/module/ThemesUserEventLogger.java
+++ b/src/com/android/customization/module/ThemesUserEventLogger.java
@@ -16,6 +16,7 @@
package com.android.customization.module;
import com.android.customization.model.clock.Clockface;
+import com.android.customization.model.color.ColorOption;
import com.android.customization.model.grid.GridOption;
import com.android.customization.model.theme.ThemeBundle;
import com.android.wallpaper.module.UserEventLogger;
@@ -33,9 +34,9 @@ public interface ThemesUserEventLogger extends UserEventLogger {
* Logs the color usage while color is applied.
*
* @param action color applied action.
- * @param colorIndex color applied index.
+ * @param colorOption applied color option.
*/
- void logColorApplied(int action, int colorIndex);
+ void logColorApplied(int action, ColorOption colorOption);
void logClockSelected(Clockface clock);
diff --git a/tests/src/com/android/customization/testing/TestThemesUserEventLogger.java b/tests/src/com/android/customization/testing/TestThemesUserEventLogger.java
index 9969e6e8..9250a868 100644
--- a/tests/src/com/android/customization/testing/TestThemesUserEventLogger.java
+++ b/tests/src/com/android/customization/testing/TestThemesUserEventLogger.java
@@ -1,6 +1,7 @@
package com.android.customization.testing;
import com.android.customization.model.clock.Clockface;
+import com.android.customization.model.color.ColorOption;
import com.android.customization.model.grid.GridOption;
import com.android.customization.model.theme.ThemeBundle;
import com.android.customization.module.ThemesUserEventLogger;
@@ -22,7 +23,7 @@ public class TestThemesUserEventLogger extends TestUserEventLogger
}
@Override
- public void logColorApplied(int action, int colorIndex) {
+ public void logColorApplied(int action, ColorOption colorOption) {
// Do nothing.
}