Loading src/com/android/customization/module/logging/SysUiStatsLogger.kt +6 −0 Original line number Diff line number Diff line Loading @@ -60,6 +60,7 @@ class SysUiStatsLogger(val action: Int) { private var toggleOn = false private var shortcut = "" private var shortcutSlotId = "" private var lockEffectIdHash = 0 fun setColorPackageHash(colorPackageHash: Int) = apply { this.colorPackageHash = colorPackageHash Loading Loading @@ -151,6 +152,10 @@ class SysUiStatsLogger(val action: Int) { fun setShortcutSlotId(shortcutSlotId: String) = apply { this.shortcutSlotId = shortcutSlotId } fun setLockEffectIdHash(lockEffectIdHash: Int) = apply { this.lockEffectIdHash = lockEffectIdHash } fun log() { SysUiStatsLog.write( STYLE_UI_CHANGED, Loading Loading @@ -185,6 +190,7 @@ class SysUiStatsLogger(val action: Int) { toggleOn, shortcut, shortcutSlotId, lockEffectIdHash, ) } } src/com/android/customization/module/logging/ThemesUserEventLoggerImpl.kt +9 −2 Original line number Diff line number Diff line Loading @@ -75,9 +75,10 @@ constructor( SysUiStatsLogger(SNAPSHOT) .setWallpaperCategoryHash(preferences.getHomeCategoryHash()) .setWallpaperIdHash(preferences.getHomeWallpaperIdHash()) .setEffectIdHash(preferences.getHomeWallpaperEffectsIdHash()) .setLockWallpaperCategoryHash(preferences.getLockCategoryHash()) .setLockWallpaperIdHash(preferences.getLockWallpaperIdHash()) .setEffectIdHash(preferences.getHomeWallpaperEffectsIdHash()) .setLockEffectIdHash(preferences.getLockWallpaperEffectsIdHash()) .setColorSource(colorManager.currentColorSourceForLogging) .setColorVariant(colorManager.currentStyleForLogging) .setSeedColor(colorManager.currentSeedColorForLogging) Loading Loading @@ -110,9 +111,10 @@ constructor( .setAppSessionId(appSessionId.getId()) .setWallpaperCategoryHash(if (isHomeWallpaperSet) categoryHash else 0) .setWallpaperIdHash(if (isHomeWallpaperSet) wallpaperIdHash else 0) .setEffectIdHash(if (isHomeWallpaperSet) getIdHashCode(effects) else 0) .setLockWallpaperCategoryHash(if (isLockWallpaperSet) categoryHash else 0) .setLockWallpaperIdHash(if (isLockWallpaperSet) wallpaperIdHash else 0) .setEffectIdHash(getIdHashCode(effects)) .setLockEffectIdHash(if (isLockWallpaperSet) getIdHashCode(effects) else 0) .setSetWallpaperEntryPoint(setWallpaperEntryPoint) .setWallpaperDestination(destination) .log() Loading Loading @@ -293,6 +295,11 @@ constructor( return getIdHashCode(getHomeWallpaperEffects()) } /** If not set, the output hash is 0. */ private fun WallpaperPreferences.getLockWallpaperEffectsIdHash(): Int { return getIdHashCode(getLockWallpaperEffects()) } private fun getIdHashCode(id: String?): Int { return id?.hashCode() ?: 0 } Loading Loading
src/com/android/customization/module/logging/SysUiStatsLogger.kt +6 −0 Original line number Diff line number Diff line Loading @@ -60,6 +60,7 @@ class SysUiStatsLogger(val action: Int) { private var toggleOn = false private var shortcut = "" private var shortcutSlotId = "" private var lockEffectIdHash = 0 fun setColorPackageHash(colorPackageHash: Int) = apply { this.colorPackageHash = colorPackageHash Loading Loading @@ -151,6 +152,10 @@ class SysUiStatsLogger(val action: Int) { fun setShortcutSlotId(shortcutSlotId: String) = apply { this.shortcutSlotId = shortcutSlotId } fun setLockEffectIdHash(lockEffectIdHash: Int) = apply { this.lockEffectIdHash = lockEffectIdHash } fun log() { SysUiStatsLog.write( STYLE_UI_CHANGED, Loading Loading @@ -185,6 +190,7 @@ class SysUiStatsLogger(val action: Int) { toggleOn, shortcut, shortcutSlotId, lockEffectIdHash, ) } }
src/com/android/customization/module/logging/ThemesUserEventLoggerImpl.kt +9 −2 Original line number Diff line number Diff line Loading @@ -75,9 +75,10 @@ constructor( SysUiStatsLogger(SNAPSHOT) .setWallpaperCategoryHash(preferences.getHomeCategoryHash()) .setWallpaperIdHash(preferences.getHomeWallpaperIdHash()) .setEffectIdHash(preferences.getHomeWallpaperEffectsIdHash()) .setLockWallpaperCategoryHash(preferences.getLockCategoryHash()) .setLockWallpaperIdHash(preferences.getLockWallpaperIdHash()) .setEffectIdHash(preferences.getHomeWallpaperEffectsIdHash()) .setLockEffectIdHash(preferences.getLockWallpaperEffectsIdHash()) .setColorSource(colorManager.currentColorSourceForLogging) .setColorVariant(colorManager.currentStyleForLogging) .setSeedColor(colorManager.currentSeedColorForLogging) Loading Loading @@ -110,9 +111,10 @@ constructor( .setAppSessionId(appSessionId.getId()) .setWallpaperCategoryHash(if (isHomeWallpaperSet) categoryHash else 0) .setWallpaperIdHash(if (isHomeWallpaperSet) wallpaperIdHash else 0) .setEffectIdHash(if (isHomeWallpaperSet) getIdHashCode(effects) else 0) .setLockWallpaperCategoryHash(if (isLockWallpaperSet) categoryHash else 0) .setLockWallpaperIdHash(if (isLockWallpaperSet) wallpaperIdHash else 0) .setEffectIdHash(getIdHashCode(effects)) .setLockEffectIdHash(if (isLockWallpaperSet) getIdHashCode(effects) else 0) .setSetWallpaperEntryPoint(setWallpaperEntryPoint) .setWallpaperDestination(destination) .log() Loading Loading @@ -293,6 +295,11 @@ constructor( return getIdHashCode(getHomeWallpaperEffects()) } /** If not set, the output hash is 0. */ private fun WallpaperPreferences.getLockWallpaperEffectsIdHash(): Int { return getIdHashCode(getLockWallpaperEffects()) } private fun getIdHashCode(id: String?): Int { return id?.hashCode() ?: 0 } Loading