Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f085bd6c authored by Bhavuk Jain's avatar Bhavuk Jain
Browse files

Added changes for logging curated photos time

This CL aims at adding changes for logging curated photos fetching and
rendering time. It also adds a new action that will help to distinguish
whether it was a user photo or a default photo.

Bug: 410816249
Flag: com.android.systemui.shared.new_customization_picker_ui
Test: Tested by building and installing picker, checking if logs are
printed or not

Change-Id: Id1b972bfa0fbd7ab13450f12f7bf2d3862b697f2
parent c4ca5909
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -17,10 +17,12 @@ package com.android.customization.module.logging

import android.app.WallpaperManager
import android.content.Intent
import android.stats.style.StyleEnums
import android.stats.style.StyleEnums.APP_LAUNCHED
import android.stats.style.StyleEnums.CLOCK_APPLIED
import android.stats.style.StyleEnums.CLOCK_COLOR_APPLIED
import android.stats.style.StyleEnums.CLOCK_SIZE_APPLIED
import android.stats.style.StyleEnums.CURATED_PHOTOS_RENDER_COMPLETE
import android.stats.style.StyleEnums.DARK_THEME_APPLIED
import android.stats.style.StyleEnums.ENTER_SCREEN
import android.stats.style.StyleEnums.GRID_APPLIED
@@ -73,6 +75,7 @@ import com.android.wallpaper.module.logging.UserEventLogger.SetWallpaperEntryPoi
import com.android.wallpaper.module.logging.UserEventLogger.WallpaperDestination
import com.android.wallpaper.picker.customization.ui.util.CustomizationOptionUtil.CustomizationOption
import com.android.wallpaper.util.LaunchSourceUtils
import io.grpc.Status
import javax.inject.Inject
import javax.inject.Singleton

@@ -270,6 +273,25 @@ constructor(
            .log()
    }

    // We use the field toggle on to denote whether the event corresponds to a user selected photo
    // or a default wallpaper
    override fun logCuratedPhotosRendered(timeElapsedMillis: Long, userPhoto: Boolean) {
        sysUiStatsLoggerFactory
            .get(CURATED_PHOTOS_RENDER_COMPLETE)
            .setAppSessionId(appSessionId.getId())
            .setTimeElapsed(timeElapsedMillis)
            .setToggleOn(userPhoto)
            .log()
    }

    override fun logCuratedPhotosFetched(timeElapsedMillis: Long, status: Status) {
        sysUiStatsLoggerFactory
            .get(StyleEnums.CURATED_PHOTOS_FETCH_END)
            .setAppSessionId(appSessionId.getId())
            .setTimeElapsed(timeElapsedMillis)
            .log()
    }

    override fun logEnterScreen(@CustomizationPickerScreen screen: Int) {
        sysUiStatsLoggerFactory
            .get(ENTER_SCREEN)