Loading src/com/android/customization/module/ThemePickerInjector.kt +2 −2 Original line number Diff line number Diff line Loading @@ -36,8 +36,8 @@ import com.android.customization.model.themedicon.ThemedIconSwitchProvider import com.android.customization.model.themedicon.data.repository.ThemeIconRepository import com.android.customization.model.themedicon.domain.interactor.ThemedIconInteractor import com.android.customization.model.themedicon.domain.interactor.ThemedIconSnapshotRestorer import com.android.customization.module.logging.StatsLogUserEventLogger import com.android.customization.module.logging.ThemesUserEventLogger import com.android.customization.module.logging.ThemesUserEventLoggerImpl import com.android.customization.picker.clock.data.repository.ClockPickerRepositoryImpl import com.android.customization.picker.clock.data.repository.ClockRegistryProvider import com.android.customization.picker.clock.domain.interactor.ClockPickerInteractor Loading Loading @@ -169,7 +169,7 @@ internal constructor( @Synchronized override fun getUserEventLogger(context: Context): ThemesUserEventLogger { return userEventLogger as? ThemesUserEventLogger ?: StatsLogUserEventLogger(getPreferences(context.applicationContext)).also { ?: ThemesUserEventLoggerImpl(getPreferences(context.applicationContext)).also { userEventLogger = it } } Loading src/com/android/customization/module/SysUiStatsLogger.kt→src/com/android/customization/module/logging/SysUiStatsLogger.kt +20 −36 Original line number Diff line number Diff line Loading @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.customization.module package com.android.customization.module.logging import com.android.systemui.shared.system.SysUiStatsLog import com.android.systemui.shared.system.SysUiStatsLog.STYLE_UICHANGED__CLOCK_SIZE__CLOCK_SIZE_UNSPECIFIED Loading @@ -38,9 +38,11 @@ class SysUiStatsLogger(val action: Int) { private var wallpaperCategoryHash = 0 private var wallpaperIdHash = 0 private var colorPreference = 0 private var locationPreference = STYLE_UICHANGED__LOCATION_PREFERENCE__LOCATION_PREFERENCE_UNSPECIFIED private var locationPreference = STYLE_UICHANGED__LOCATION_PREFERENCE__LOCATION_PREFERENCE_UNSPECIFIED private var datePreference = STYLE_UICHANGED__DATE_PREFERENCE__DATE_PREFERENCE_UNSPECIFIED private var launchedPreference = STYLE_UICHANGED__LAUNCHED_PREFERENCE__LAUNCHED_PREFERENCE_UNSPECIFIED private var launchedPreference = STYLE_UICHANGED__LAUNCHED_PREFERENCE__LAUNCHED_PREFERENCE_UNSPECIFIED private var effectPreference = STYLE_UICHANGED__EFFECT_PREFERENCE__EFFECT_PREFERENCE_UNSPECIFIED private var effectIdHash = 0 private var lockWallpaperCategoryHash = 0 Loading @@ -52,8 +54,10 @@ class SysUiStatsLogger(val action: Int) { private var timeElapsedMillis = 0L private var effectResultCode = -1 private var sessionId = 0 private var setWallpaperEntryPoint = STYLE_UICHANGED__SET_WALLPAPER_ENTRY_POINT__SET_WALLPAPER_ENTRY_POINT_UNSPECIFIED private var wallpaperDestination = STYLE_UICHANGED__WALLPAPER_DESTINATION__WALLPAPER_DESTINATION_UNSPECIFIED private var setWallpaperEntryPoint = STYLE_UICHANGED__SET_WALLPAPER_ENTRY_POINT__SET_WALLPAPER_ENTRY_POINT_UNSPECIFIED private var wallpaperDestination = STYLE_UICHANGED__WALLPAPER_DESTINATION__WALLPAPER_DESTINATION_UNSPECIFIED private var colorSource = STYLE_UICHANGED__COLOR_SOURCE__COLOR_SOURCE_UNSPECIFIED private var seedColor = 0 private var clockSize = STYLE_UICHANGED__CLOCK_SIZE__CLOCK_SIZE_UNSPECIFIED Loading @@ -65,9 +69,7 @@ class SysUiStatsLogger(val action: Int) { this.colorPackageHash = colorPackageHash } fun setFontPackageHash(fontPackageHash: Int) = apply { this.fontPackageHash = fontPackageHash } fun setFontPackageHash(fontPackageHash: Int) = apply { this.fontPackageHash = fontPackageHash } fun setShapePackageHash(shapePackageHash: Int) = apply { this.shapePackageHash = shapePackageHash Loading @@ -83,13 +85,9 @@ class SysUiStatsLogger(val action: Int) { this.wallpaperCategoryHash = wallpaperCategoryHash } fun setWallpaperIdHash(wallpaperIdHash: Int) = apply { this.wallpaperIdHash = wallpaperIdHash } fun setWallpaperIdHash(wallpaperIdHash: Int) = apply { this.wallpaperIdHash = wallpaperIdHash } fun setColorPreference(colorPreference: Int) = apply { this.colorPreference = colorPreference } fun setColorPreference(colorPreference: Int) = apply { this.colorPreference = colorPreference } fun setLocationPreference(locationPreference: Int) = apply { this.locationPreference = locationPreference Loading Loading @@ -135,9 +133,7 @@ class SysUiStatsLogger(val action: Int) { this.effectResultCode = effectResultCode } fun setSessionId(sessionId: Int) = apply { this.sessionId = sessionId } fun setSessionId(sessionId: Int) = apply { this.sessionId = sessionId } fun setSetWallpaperEntryPoint(@SetWallpaperEntryPoint setWallpaperEntryPoint: Int) = apply { this.setWallpaperEntryPoint = setWallpaperEntryPoint Loading @@ -147,29 +143,17 @@ class SysUiStatsLogger(val action: Int) { this.wallpaperDestination = wallpaperDestination } fun setColorSource(colorSource: Int) = apply { this.colorSource = colorSource } fun setColorSource(colorSource: Int) = apply { this.colorSource = colorSource } fun setSeedColor(seedColor: Int) = apply { this.seedColor = seedColor } fun setSeedColor(seedColor: Int) = apply { this.seedColor = seedColor } fun setClockSize(clockSize: Int) = apply { this.clockSize = clockSize } fun setClockSize(clockSize: Int) = apply { this.clockSize = clockSize } fun setToggleOn(toggleOn: Boolean) = apply { this.toggleOn = toggleOn } fun setToggleOn(toggleOn: Boolean) = apply { this.toggleOn = toggleOn } fun setShortcut(shortcut: String) = apply { this.shortcut = shortcut } fun setShortcut(shortcut: String) = apply { this.shortcut = shortcut } fun setShortcutSlotId(shortcutSlotId: String) = apply { this.shortcutSlotId = shortcutSlotId } fun setShortcutSlotId(shortcutSlotId: String) = apply { this.shortcutSlotId = shortcutSlotId } fun log() { SysUiStatsLog.write( Loading src/com/android/customization/module/logging/StatsLogUserEventLogger.kt→src/com/android/customization/module/logging/ThemesUserEventLoggerImpl.kt +2 −4 Original line number Diff line number Diff line Loading @@ -21,22 +21,20 @@ 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.SysUiStatsLogger import com.android.customization.module.logging.ThemesUserEventLogger.ClockSize import com.android.systemui.shared.system.SysUiStatsLog import com.android.wallpaper.module.WallpaperPersister.DEST_BOTH import com.android.wallpaper.module.WallpaperPersister.DEST_HOME_SCREEN import com.android.wallpaper.module.WallpaperPersister.DEST_LOCK_SCREEN import com.android.wallpaper.module.WallpaperPreferences import com.android.wallpaper.module.logging.NoOpUserEventLogger import com.android.wallpaper.module.logging.UserEventLogger.EffectStatus import com.android.wallpaper.module.logging.UserEventLogger.SetWallpaperEntryPoint import com.android.wallpaper.module.logging.UserEventLogger.WallpaperDestination import com.android.wallpaper.util.LaunchSourceUtils /** StatsLog-backed implementation of [ThemesUserEventLogger]. */ class StatsLogUserEventLogger(private val preferences: WallpaperPreferences) : NoOpUserEventLogger(), ThemesUserEventLogger { class ThemesUserEventLoggerImpl(private val preferences: WallpaperPreferences) : ThemesUserEventLogger { override fun logSnapshot() { SysUiStatsLogger(StyleEnums.SNAPSHOT) Loading tests/common/Android.bp +2 −2 Original line number Diff line number Diff line Loading @@ -25,8 +25,8 @@ android_library { defaults: ["ThemePicker_common_defaults"], srcs: [ "src/com/android/customization/testing/**/*.java", "src/com/android/customization/testing/**/*.kt", "src/**/*.java", "src/**/*.kt", ], static_libs: [ "WallpaperPicker2TestLib", Loading tests/common/src/com/android/customization/testing/TestThemesUserEventLogger.kt→tests/common/src/com/android/customization/module/logging/TestThemesUserEventLogger.kt +2 −3 Original line number Diff line number Diff line Loading @@ -13,12 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.customization.testing 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 import com.android.wallpaper.testing.TestUserEventLogger import com.android.wallpaper.module.logging.TestUserEventLogger /** Test implementation of [ThemesUserEventLogger]. */ class TestThemesUserEventLogger : TestUserEventLogger(), ThemesUserEventLogger { Loading Loading
src/com/android/customization/module/ThemePickerInjector.kt +2 −2 Original line number Diff line number Diff line Loading @@ -36,8 +36,8 @@ import com.android.customization.model.themedicon.ThemedIconSwitchProvider import com.android.customization.model.themedicon.data.repository.ThemeIconRepository import com.android.customization.model.themedicon.domain.interactor.ThemedIconInteractor import com.android.customization.model.themedicon.domain.interactor.ThemedIconSnapshotRestorer import com.android.customization.module.logging.StatsLogUserEventLogger import com.android.customization.module.logging.ThemesUserEventLogger import com.android.customization.module.logging.ThemesUserEventLoggerImpl import com.android.customization.picker.clock.data.repository.ClockPickerRepositoryImpl import com.android.customization.picker.clock.data.repository.ClockRegistryProvider import com.android.customization.picker.clock.domain.interactor.ClockPickerInteractor Loading Loading @@ -169,7 +169,7 @@ internal constructor( @Synchronized override fun getUserEventLogger(context: Context): ThemesUserEventLogger { return userEventLogger as? ThemesUserEventLogger ?: StatsLogUserEventLogger(getPreferences(context.applicationContext)).also { ?: ThemesUserEventLoggerImpl(getPreferences(context.applicationContext)).also { userEventLogger = it } } Loading
src/com/android/customization/module/SysUiStatsLogger.kt→src/com/android/customization/module/logging/SysUiStatsLogger.kt +20 −36 Original line number Diff line number Diff line Loading @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.customization.module package com.android.customization.module.logging import com.android.systemui.shared.system.SysUiStatsLog import com.android.systemui.shared.system.SysUiStatsLog.STYLE_UICHANGED__CLOCK_SIZE__CLOCK_SIZE_UNSPECIFIED Loading @@ -38,9 +38,11 @@ class SysUiStatsLogger(val action: Int) { private var wallpaperCategoryHash = 0 private var wallpaperIdHash = 0 private var colorPreference = 0 private var locationPreference = STYLE_UICHANGED__LOCATION_PREFERENCE__LOCATION_PREFERENCE_UNSPECIFIED private var locationPreference = STYLE_UICHANGED__LOCATION_PREFERENCE__LOCATION_PREFERENCE_UNSPECIFIED private var datePreference = STYLE_UICHANGED__DATE_PREFERENCE__DATE_PREFERENCE_UNSPECIFIED private var launchedPreference = STYLE_UICHANGED__LAUNCHED_PREFERENCE__LAUNCHED_PREFERENCE_UNSPECIFIED private var launchedPreference = STYLE_UICHANGED__LAUNCHED_PREFERENCE__LAUNCHED_PREFERENCE_UNSPECIFIED private var effectPreference = STYLE_UICHANGED__EFFECT_PREFERENCE__EFFECT_PREFERENCE_UNSPECIFIED private var effectIdHash = 0 private var lockWallpaperCategoryHash = 0 Loading @@ -52,8 +54,10 @@ class SysUiStatsLogger(val action: Int) { private var timeElapsedMillis = 0L private var effectResultCode = -1 private var sessionId = 0 private var setWallpaperEntryPoint = STYLE_UICHANGED__SET_WALLPAPER_ENTRY_POINT__SET_WALLPAPER_ENTRY_POINT_UNSPECIFIED private var wallpaperDestination = STYLE_UICHANGED__WALLPAPER_DESTINATION__WALLPAPER_DESTINATION_UNSPECIFIED private var setWallpaperEntryPoint = STYLE_UICHANGED__SET_WALLPAPER_ENTRY_POINT__SET_WALLPAPER_ENTRY_POINT_UNSPECIFIED private var wallpaperDestination = STYLE_UICHANGED__WALLPAPER_DESTINATION__WALLPAPER_DESTINATION_UNSPECIFIED private var colorSource = STYLE_UICHANGED__COLOR_SOURCE__COLOR_SOURCE_UNSPECIFIED private var seedColor = 0 private var clockSize = STYLE_UICHANGED__CLOCK_SIZE__CLOCK_SIZE_UNSPECIFIED Loading @@ -65,9 +69,7 @@ class SysUiStatsLogger(val action: Int) { this.colorPackageHash = colorPackageHash } fun setFontPackageHash(fontPackageHash: Int) = apply { this.fontPackageHash = fontPackageHash } fun setFontPackageHash(fontPackageHash: Int) = apply { this.fontPackageHash = fontPackageHash } fun setShapePackageHash(shapePackageHash: Int) = apply { this.shapePackageHash = shapePackageHash Loading @@ -83,13 +85,9 @@ class SysUiStatsLogger(val action: Int) { this.wallpaperCategoryHash = wallpaperCategoryHash } fun setWallpaperIdHash(wallpaperIdHash: Int) = apply { this.wallpaperIdHash = wallpaperIdHash } fun setWallpaperIdHash(wallpaperIdHash: Int) = apply { this.wallpaperIdHash = wallpaperIdHash } fun setColorPreference(colorPreference: Int) = apply { this.colorPreference = colorPreference } fun setColorPreference(colorPreference: Int) = apply { this.colorPreference = colorPreference } fun setLocationPreference(locationPreference: Int) = apply { this.locationPreference = locationPreference Loading Loading @@ -135,9 +133,7 @@ class SysUiStatsLogger(val action: Int) { this.effectResultCode = effectResultCode } fun setSessionId(sessionId: Int) = apply { this.sessionId = sessionId } fun setSessionId(sessionId: Int) = apply { this.sessionId = sessionId } fun setSetWallpaperEntryPoint(@SetWallpaperEntryPoint setWallpaperEntryPoint: Int) = apply { this.setWallpaperEntryPoint = setWallpaperEntryPoint Loading @@ -147,29 +143,17 @@ class SysUiStatsLogger(val action: Int) { this.wallpaperDestination = wallpaperDestination } fun setColorSource(colorSource: Int) = apply { this.colorSource = colorSource } fun setColorSource(colorSource: Int) = apply { this.colorSource = colorSource } fun setSeedColor(seedColor: Int) = apply { this.seedColor = seedColor } fun setSeedColor(seedColor: Int) = apply { this.seedColor = seedColor } fun setClockSize(clockSize: Int) = apply { this.clockSize = clockSize } fun setClockSize(clockSize: Int) = apply { this.clockSize = clockSize } fun setToggleOn(toggleOn: Boolean) = apply { this.toggleOn = toggleOn } fun setToggleOn(toggleOn: Boolean) = apply { this.toggleOn = toggleOn } fun setShortcut(shortcut: String) = apply { this.shortcut = shortcut } fun setShortcut(shortcut: String) = apply { this.shortcut = shortcut } fun setShortcutSlotId(shortcutSlotId: String) = apply { this.shortcutSlotId = shortcutSlotId } fun setShortcutSlotId(shortcutSlotId: String) = apply { this.shortcutSlotId = shortcutSlotId } fun log() { SysUiStatsLog.write( Loading
src/com/android/customization/module/logging/StatsLogUserEventLogger.kt→src/com/android/customization/module/logging/ThemesUserEventLoggerImpl.kt +2 −4 Original line number Diff line number Diff line Loading @@ -21,22 +21,20 @@ 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.SysUiStatsLogger import com.android.customization.module.logging.ThemesUserEventLogger.ClockSize import com.android.systemui.shared.system.SysUiStatsLog import com.android.wallpaper.module.WallpaperPersister.DEST_BOTH import com.android.wallpaper.module.WallpaperPersister.DEST_HOME_SCREEN import com.android.wallpaper.module.WallpaperPersister.DEST_LOCK_SCREEN import com.android.wallpaper.module.WallpaperPreferences import com.android.wallpaper.module.logging.NoOpUserEventLogger import com.android.wallpaper.module.logging.UserEventLogger.EffectStatus import com.android.wallpaper.module.logging.UserEventLogger.SetWallpaperEntryPoint import com.android.wallpaper.module.logging.UserEventLogger.WallpaperDestination import com.android.wallpaper.util.LaunchSourceUtils /** StatsLog-backed implementation of [ThemesUserEventLogger]. */ class StatsLogUserEventLogger(private val preferences: WallpaperPreferences) : NoOpUserEventLogger(), ThemesUserEventLogger { class ThemesUserEventLoggerImpl(private val preferences: WallpaperPreferences) : ThemesUserEventLogger { override fun logSnapshot() { SysUiStatsLogger(StyleEnums.SNAPSHOT) Loading
tests/common/Android.bp +2 −2 Original line number Diff line number Diff line Loading @@ -25,8 +25,8 @@ android_library { defaults: ["ThemePicker_common_defaults"], srcs: [ "src/com/android/customization/testing/**/*.java", "src/com/android/customization/testing/**/*.kt", "src/**/*.java", "src/**/*.kt", ], static_libs: [ "WallpaperPicker2TestLib", Loading
tests/common/src/com/android/customization/testing/TestThemesUserEventLogger.kt→tests/common/src/com/android/customization/module/logging/TestThemesUserEventLogger.kt +2 −3 Original line number Diff line number Diff line Loading @@ -13,12 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.customization.testing 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 import com.android.wallpaper.testing.TestUserEventLogger import com.android.wallpaper.module.logging.TestUserEventLogger /** Test implementation of [ThemesUserEventLogger]. */ class TestThemesUserEventLogger : TestUserEventLogger(), ThemesUserEventLogger { Loading