Loading src/com/android/customization/module/logging/SysUiStatsLogger.kt +1 −1 Original line number Diff line number Diff line Loading @@ -15,9 +15,9 @@ */ package com.android.customization.module.logging import com.android.customization.module.logging.ThemesUserEventLogger.AppIconStyle import com.android.customization.module.logging.ThemesUserEventLogger.ClockSize import com.android.customization.module.logging.ThemesUserEventLogger.ColorSource import com.android.wallpaper.module.logging.UserEventLogger.AppIconStyle import com.android.wallpaper.module.logging.UserEventLogger.CustomizationPickerScreen import com.android.wallpaper.module.logging.UserEventLogger.DatePreference import com.android.wallpaper.module.logging.UserEventLogger.EffectStatus Loading src/com/android/customization/module/logging/SysUiStatsLoggerImpl.kt +1 −1 Original line number Diff line number Diff line Loading @@ -25,11 +25,11 @@ import android.stats.style.StyleEnums.LOCATION_PREFERENCE_UNSPECIFIED import android.stats.style.StyleEnums.SCREEN_UNSPECIFIED import android.stats.style.StyleEnums.SET_WALLPAPER_ENTRY_POINT_UNSPECIFIED import android.stats.style.StyleEnums.WALLPAPER_DESTINATION_UNSPECIFIED import com.android.customization.module.logging.ThemesUserEventLogger.AppIconStyle import com.android.customization.module.logging.ThemesUserEventLogger.ClockSize import com.android.customization.module.logging.ThemesUserEventLogger.ColorSource import com.android.systemui.shared.system.SysUiStatsLog import com.android.systemui.shared.system.SysUiStatsLog.STYLE_UI_CHANGED import com.android.wallpaper.module.logging.UserEventLogger.AppIconStyle import com.android.wallpaper.module.logging.UserEventLogger.CustomizationPickerScreen import com.android.wallpaper.module.logging.UserEventLogger.DatePreference import com.android.wallpaper.module.logging.UserEventLogger.EffectStatus Loading src/com/android/customization/module/logging/ThemesUserEventLogger.kt +10 −0 Original line number Diff line number Diff line Loading @@ -39,6 +39,8 @@ interface ThemesUserEventLogger : UserEventLogger { fun logThemedIconApplied(useThemeIcon: Boolean) fun logIconStyleApplied(iconStyle: Int) fun logLockScreenNotificationApplied(showLockScreenNotifications: Boolean) fun logShortcutApplied(shortcut: String, shortcutSlotId: String) Loading @@ -64,6 +66,14 @@ interface ThemesUserEventLogger : UserEventLogger { @Retention(AnnotationRetention.SOURCE) annotation class ClockSize @IntDef( StyleEnums.APP_ICON_STYLE_UNSPECIFIED, StyleEnums.APP_ICON_STYLE_THEMED, StyleEnums.APP_ICON_STYLE_EXTENDIBLE_THEME, ) @Retention(AnnotationRetention.SOURCE) annotation class AppIconStyle companion object { const val NULL_SEED_COLOR = 0 } Loading src/com/android/customization/module/logging/ThemesUserEventLoggerImpl.kt +14 −12 Original line number Diff line number Diff line Loading @@ -17,8 +17,6 @@ package com.android.customization.module.logging import android.app.WallpaperManager import android.content.Intent import android.stats.style.StyleEnums.APP_ICON_STYLE_THEMED import android.stats.style.StyleEnums.APP_ICON_STYLE_UNSPECIFIED import android.stats.style.StyleEnums.APP_LAUNCHED import android.stats.style.StyleEnums.CLOCK_APPLIED import android.stats.style.StyleEnums.CLOCK_COLOR_APPLIED Loading Loading @@ -68,6 +66,7 @@ import com.android.customization.model.color.ColorCustomizationManager import com.android.customization.model.grid.GridOptionModel import com.android.customization.model.grid.ShapeGridManager import com.android.customization.model.grid.ShapeOptionModel import com.android.customization.module.logging.ThemesUserEventLogger.AppIconStyle import com.android.customization.module.logging.ThemesUserEventLogger.ClockSize import com.android.customization.module.logging.ThemesUserEventLogger.ColorSource import com.android.customization.picker.clock.data.repository.ClockPickerRepository Loading @@ -91,6 +90,7 @@ import com.android.wallpaper.util.LaunchSourceUtils import io.grpc.Status import javax.inject.Inject import javax.inject.Singleton import kotlin.time.Duration.Companion.milliseconds import kotlinx.coroutines.flow.first import kotlinx.coroutines.withTimeoutOrNull Loading Loading @@ -124,7 +124,7 @@ constructor( .setColorVariant(colorManager.currentStyleForLogging) .setSeedColor(colorManager.currentSeedColorForLogging) .setShapePackageHash(shapeGridManager.getSelectedShapeIdHash()) .setAppIconStyle(iconStyleRepository.getAppIconStyle()) .setAppIconStyle(iconStyleRepository.getIconStyleForLogging()) .setLauncherGrid(shapeGridManager.getSelectedGridInt()) .setClockPackageHash(selectedClockLoggingData.clockIdHash) .setClockSeedColor(selectedClockLoggingData.clockSeedColor) Loading Loading @@ -269,6 +269,14 @@ constructor( .log() } override fun logIconStyleApplied(@AppIconStyle iconStyle: Int) { sysUiStatsLoggerFactory .get(THEMED_ICON_APPLIED) .setAppSessionId(appSessionId.getId()) .setAppIconStyle(iconStyle) .log() } override fun logLockScreenNotificationApplied(showLockScreenNotifications: Boolean) { sysUiStatsLoggerFactory .get(LOCK_SCREEN_NOTIFICATION_APPLIED) Loading Loading @@ -436,24 +444,18 @@ constructor( return selectedGrid?.getLauncherGridInt() ?: 0 } private suspend fun IconStyleRepository.getAppIconStyle(): Int { val isThemedIconActivated = withTimeoutOrNull(TIMEOUT_MILLIS) { isThemedIconActivated.first() } ?: false return if (isThemedIconActivated) APP_ICON_STYLE_THEMED else APP_ICON_STYLE_UNSPECIFIED } private suspend fun ClockPickerRepository.getSelectedClockLoggingData(): SelectedClockLoggingData { val selectedClock = try { withTimeoutOrNull(TIMEOUT_MILLIS) { selectedClock.first() } withTimeoutOrNull(TIMEOUT) { selectedClock.first() } } catch (e: Exception) { Log.e(TAG, "Fail to get selected clock. Skip logging selected clock.", e) null } val selectedClockSize = try { withTimeoutOrNull(TIMEOUT_MILLIS) { selectedClockSize.first() } withTimeoutOrNull(TIMEOUT) { selectedClockSize.first() } } catch (e: Exception) { Log.e(TAG, "Fail to get selected clock size. Skip logging selected clock size.", e) null Loading Loading @@ -490,6 +492,6 @@ constructor( companion object { private const val TAG = "ThemesUserEventLoggerImpl" private const val TIMEOUT_MILLIS = 5000L val TIMEOUT = 5000.milliseconds } } src/com/android/customization/picker/icon/data/repository/IconStyleRepository.kt +2 −0 Original line number Diff line number Diff line Loading @@ -42,4 +42,6 @@ interface IconStyleRepository { * @return True if the icon style was set successfully and data was updated, false otherwise. */ suspend fun setIconStyle(iconStyle: IconStyle): Boolean suspend fun getIconStyleForLogging(): Int } Loading
src/com/android/customization/module/logging/SysUiStatsLogger.kt +1 −1 Original line number Diff line number Diff line Loading @@ -15,9 +15,9 @@ */ package com.android.customization.module.logging import com.android.customization.module.logging.ThemesUserEventLogger.AppIconStyle import com.android.customization.module.logging.ThemesUserEventLogger.ClockSize import com.android.customization.module.logging.ThemesUserEventLogger.ColorSource import com.android.wallpaper.module.logging.UserEventLogger.AppIconStyle import com.android.wallpaper.module.logging.UserEventLogger.CustomizationPickerScreen import com.android.wallpaper.module.logging.UserEventLogger.DatePreference import com.android.wallpaper.module.logging.UserEventLogger.EffectStatus Loading
src/com/android/customization/module/logging/SysUiStatsLoggerImpl.kt +1 −1 Original line number Diff line number Diff line Loading @@ -25,11 +25,11 @@ import android.stats.style.StyleEnums.LOCATION_PREFERENCE_UNSPECIFIED import android.stats.style.StyleEnums.SCREEN_UNSPECIFIED import android.stats.style.StyleEnums.SET_WALLPAPER_ENTRY_POINT_UNSPECIFIED import android.stats.style.StyleEnums.WALLPAPER_DESTINATION_UNSPECIFIED import com.android.customization.module.logging.ThemesUserEventLogger.AppIconStyle import com.android.customization.module.logging.ThemesUserEventLogger.ClockSize import com.android.customization.module.logging.ThemesUserEventLogger.ColorSource import com.android.systemui.shared.system.SysUiStatsLog import com.android.systemui.shared.system.SysUiStatsLog.STYLE_UI_CHANGED import com.android.wallpaper.module.logging.UserEventLogger.AppIconStyle import com.android.wallpaper.module.logging.UserEventLogger.CustomizationPickerScreen import com.android.wallpaper.module.logging.UserEventLogger.DatePreference import com.android.wallpaper.module.logging.UserEventLogger.EffectStatus Loading
src/com/android/customization/module/logging/ThemesUserEventLogger.kt +10 −0 Original line number Diff line number Diff line Loading @@ -39,6 +39,8 @@ interface ThemesUserEventLogger : UserEventLogger { fun logThemedIconApplied(useThemeIcon: Boolean) fun logIconStyleApplied(iconStyle: Int) fun logLockScreenNotificationApplied(showLockScreenNotifications: Boolean) fun logShortcutApplied(shortcut: String, shortcutSlotId: String) Loading @@ -64,6 +66,14 @@ interface ThemesUserEventLogger : UserEventLogger { @Retention(AnnotationRetention.SOURCE) annotation class ClockSize @IntDef( StyleEnums.APP_ICON_STYLE_UNSPECIFIED, StyleEnums.APP_ICON_STYLE_THEMED, StyleEnums.APP_ICON_STYLE_EXTENDIBLE_THEME, ) @Retention(AnnotationRetention.SOURCE) annotation class AppIconStyle companion object { const val NULL_SEED_COLOR = 0 } Loading
src/com/android/customization/module/logging/ThemesUserEventLoggerImpl.kt +14 −12 Original line number Diff line number Diff line Loading @@ -17,8 +17,6 @@ package com.android.customization.module.logging import android.app.WallpaperManager import android.content.Intent import android.stats.style.StyleEnums.APP_ICON_STYLE_THEMED import android.stats.style.StyleEnums.APP_ICON_STYLE_UNSPECIFIED import android.stats.style.StyleEnums.APP_LAUNCHED import android.stats.style.StyleEnums.CLOCK_APPLIED import android.stats.style.StyleEnums.CLOCK_COLOR_APPLIED Loading Loading @@ -68,6 +66,7 @@ import com.android.customization.model.color.ColorCustomizationManager import com.android.customization.model.grid.GridOptionModel import com.android.customization.model.grid.ShapeGridManager import com.android.customization.model.grid.ShapeOptionModel import com.android.customization.module.logging.ThemesUserEventLogger.AppIconStyle import com.android.customization.module.logging.ThemesUserEventLogger.ClockSize import com.android.customization.module.logging.ThemesUserEventLogger.ColorSource import com.android.customization.picker.clock.data.repository.ClockPickerRepository Loading @@ -91,6 +90,7 @@ import com.android.wallpaper.util.LaunchSourceUtils import io.grpc.Status import javax.inject.Inject import javax.inject.Singleton import kotlin.time.Duration.Companion.milliseconds import kotlinx.coroutines.flow.first import kotlinx.coroutines.withTimeoutOrNull Loading Loading @@ -124,7 +124,7 @@ constructor( .setColorVariant(colorManager.currentStyleForLogging) .setSeedColor(colorManager.currentSeedColorForLogging) .setShapePackageHash(shapeGridManager.getSelectedShapeIdHash()) .setAppIconStyle(iconStyleRepository.getAppIconStyle()) .setAppIconStyle(iconStyleRepository.getIconStyleForLogging()) .setLauncherGrid(shapeGridManager.getSelectedGridInt()) .setClockPackageHash(selectedClockLoggingData.clockIdHash) .setClockSeedColor(selectedClockLoggingData.clockSeedColor) Loading Loading @@ -269,6 +269,14 @@ constructor( .log() } override fun logIconStyleApplied(@AppIconStyle iconStyle: Int) { sysUiStatsLoggerFactory .get(THEMED_ICON_APPLIED) .setAppSessionId(appSessionId.getId()) .setAppIconStyle(iconStyle) .log() } override fun logLockScreenNotificationApplied(showLockScreenNotifications: Boolean) { sysUiStatsLoggerFactory .get(LOCK_SCREEN_NOTIFICATION_APPLIED) Loading Loading @@ -436,24 +444,18 @@ constructor( return selectedGrid?.getLauncherGridInt() ?: 0 } private suspend fun IconStyleRepository.getAppIconStyle(): Int { val isThemedIconActivated = withTimeoutOrNull(TIMEOUT_MILLIS) { isThemedIconActivated.first() } ?: false return if (isThemedIconActivated) APP_ICON_STYLE_THEMED else APP_ICON_STYLE_UNSPECIFIED } private suspend fun ClockPickerRepository.getSelectedClockLoggingData(): SelectedClockLoggingData { val selectedClock = try { withTimeoutOrNull(TIMEOUT_MILLIS) { selectedClock.first() } withTimeoutOrNull(TIMEOUT) { selectedClock.first() } } catch (e: Exception) { Log.e(TAG, "Fail to get selected clock. Skip logging selected clock.", e) null } val selectedClockSize = try { withTimeoutOrNull(TIMEOUT_MILLIS) { selectedClockSize.first() } withTimeoutOrNull(TIMEOUT) { selectedClockSize.first() } } catch (e: Exception) { Log.e(TAG, "Fail to get selected clock size. Skip logging selected clock size.", e) null Loading Loading @@ -490,6 +492,6 @@ constructor( companion object { private const val TAG = "ThemesUserEventLoggerImpl" private const val TIMEOUT_MILLIS = 5000L val TIMEOUT = 5000.milliseconds } }
src/com/android/customization/picker/icon/data/repository/IconStyleRepository.kt +2 −0 Original line number Diff line number Diff line Loading @@ -42,4 +42,6 @@ interface IconStyleRepository { * @return True if the icon style was set successfully and data was updated, false otherwise. */ suspend fun setIconStyle(iconStyle: IconStyle): Boolean suspend fun getIconStyleForLogging(): Int }