From 286c52f8c2b817d9e0328208fe12ff355a006fb2 Mon Sep 17 00:00:00 2001 From: Kunhung Li Date: Tue, 21 May 2019 20:10:43 +0800 Subject: [PATCH] Add live wallpaper metrics to atoms.proto Resue StyleUIChanged message to append live wallpaper events. Test: make statsd_testdrive && statsd_testdrive 179 Bug: 133209268 Bug: 127745228 Change-Id: I864d8e35bd071f7bcd2249ef20446a42a680dc6d --- cmds/statsd/src/atoms.proto | 4 +++- core/proto/android/stats/style/style_enums.proto | 12 ++++++++++++ .../systemui/shared/system/StatsLogCompat.java | 9 ++++++--- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/cmds/statsd/src/atoms.proto b/cmds/statsd/src/atoms.proto index 24df8838e1006..1f32d746dcd82 100644 --- a/cmds/statsd/src/atoms.proto +++ b/cmds/statsd/src/atoms.proto @@ -269,7 +269,7 @@ message Atom { AssistGestureProgressReported assist_gesture_progress_reported = 176; TouchGestureClassified touch_gesture_classified = 177; HiddenApiUsed hidden_api_used = 178 [(allow_from_any_uid) = true]; - StyleUIChanged style_ui_changed = 179; + StyleUIChanged style_ui_changed = 179 [(log_from_module) = "style"]; PrivacyIndicatorsInteracted privacy_indicators_interacted = 180 [(log_from_module) = "permissioncontroller"]; AppInstallOnExternalStorageReported app_install_on_external_storage_reported = 181; @@ -2487,6 +2487,8 @@ message StyleUIChanged { optional int32 launcher_grid = 6; optional int32 wallpaper_category_hash = 7; optional int32 wallpaper_id_hash = 8; + optional int32 color_preference = 9; + optional android.stats.style.LocationPreference location_preference = 10; } /** diff --git a/core/proto/android/stats/style/style_enums.proto b/core/proto/android/stats/style/style_enums.proto index b0e4391efd00a..5b64d1ef5d4f1 100644 --- a/core/proto/android/stats/style/style_enums.proto +++ b/core/proto/android/stats/style/style_enums.proto @@ -30,5 +30,17 @@ enum Action { WALLPAPER_EXPLORE = 8; WALLPAPER_DOWNLOAD = 9; WALLPAPER_REMOVE = 10; + LIVE_WALLPAPER_DOWNLOAD_SUCCESS = 11; + LIVE_WALLPAPER_DOWNLOAD_FAILED = 12; + LIVE_WALLPAPER_DOWNLOAD_CANCELLED = 13; + LIVE_WALLPAPER_DELETE_SUCCESS = 14; + LIVE_WALLPAPER_DELETE_FAILED = 15; + LIVE_WALLPAPER_APPLIED = 16; } +enum LocationPreference { + LOCATION_PREFERENCE_UNSPECIFIED = 0; + LOCATION_UNAVAILABLE = 1; + LOCATION_CURRENT = 2; + LOCATION_MANUAL = 3; +} diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/system/StatsLogCompat.java b/packages/SystemUI/shared/src/com/android/systemui/shared/system/StatsLogCompat.java index d17725f1e2192..59ed1117182c3 100644 --- a/packages/SystemUI/shared/src/com/android/systemui/shared/system/StatsLogCompat.java +++ b/packages/SystemUI/shared/src/com/android/systemui/shared/system/StatsLogCompat.java @@ -36,13 +36,16 @@ public class StatsLogCompat { /** * StatsLog.write(StatsLog.STYLE_EVENT, action, colorPackageHash, * fontPackageHash, shapePackageHash, clockPackageHash, - * launcherGrid, wallpaperCategoryHash, wallpaperIdHash); + * launcherGrid, wallpaperCategoryHash, wallpaperIdHash, + * colorPreference, locationPreference); */ public static void write(int action, int colorPackageHash, int fontPackageHash, int shapePackageHash, int clockPackageHash, - int launcherGrid, int wallpaperCategoryHash, int wallpaperIdHash) { + int launcherGrid, int wallpaperCategoryHash, int wallpaperIdHash, + int colorPreference, int locationPreference) { StatsLog.write(179, action, colorPackageHash, fontPackageHash, shapePackageHash, clockPackageHash, - launcherGrid, wallpaperCategoryHash, wallpaperIdHash); + launcherGrid, wallpaperCategoryHash, wallpaperIdHash, + colorPreference, locationPreference); } }