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

Commit 8e48c080 authored by Beth Thibodeau's avatar Beth Thibodeau
Browse files

Add more logging for carousel state

Log state of media players, transition progress when updating size, and
visibility of the carousel

Bug: 269600402
Test: verify new logs show in dumpsys
Change-Id: Ia7aaabb229fbff2918c942cb84bb6f6c13ebf367
parent 767ab1e8
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -225,8 +225,10 @@ constructor(
        object : KeyguardUpdateMonitorCallback() {
            override fun onStrongAuthStateChanged(userId: Int) {
                if (keyguardUpdateMonitor.isUserInLockdown(userId)) {
                    debugLogger.logCarouselHidden()
                    hideMediaCarousel()
                } else if (keyguardUpdateMonitor.isUserUnlocked(userId)) {
                    debugLogger.logCarouselVisible()
                    showMediaCarousel()
                }
            }
@@ -298,7 +300,7 @@ constructor(
                    receivedSmartspaceCardLatency: Int,
                    isSsReactivated: Boolean
                ) {
                    debugLogger.logMediaLoaded(key)
                    debugLogger.logMediaLoaded(key, data.active)
                    if (addOrUpdatePlayer(key, oldKey, data, isSsReactivated)) {
                        // Log card received if a new resumable media card is added
                        MediaPlayerData.getMediaPlayer(key)?.let {
+14 −2
Original line number Diff line number Diff line
@@ -42,8 +42,16 @@ constructor(@MediaCarouselControllerLog private val buffer: LogBuffer) {
            }
        )

    fun logMediaLoaded(key: String) =
        buffer.log(TAG, LogLevel.DEBUG, { str1 = key }, { "add player $str1" })
    fun logMediaLoaded(key: String, active: Boolean) =
        buffer.log(
            TAG,
            LogLevel.DEBUG,
            {
                str1 = key
                bool1 = active
            },
            { "add player $str1, active: $bool1" }
        )

    fun logMediaRemoved(key: String) =
        buffer.log(TAG, LogLevel.DEBUG, { str1 = key }, { "removing player $str1" })
@@ -69,6 +77,10 @@ constructor(@MediaCarouselControllerLog private val buffer: LogBuffer) {
            },
            { "removing recommendation $str1, immediate=$bool1" }
        )

    fun logCarouselHidden() = buffer.log(TAG, LogLevel.DEBUG, {}, { "hiding carousel" })

    fun logCarouselVisible() = buffer.log(TAG, LogLevel.DEBUG, {}, { "showing carousel" })
}

private const val TAG = "MediaCarouselCtlrLog"
+5 −1
Original line number Diff line number Diff line
@@ -602,7 +602,11 @@ constructor(
                        tmpState
                    )
            }
            logger.logMediaSize("setCurrentState", result.width, result.height)
            logger.logMediaSize(
                "setCurrentState (progress $transitionProgress)",
                result.width,
                result.height
            )
            layoutController.setState(
                result,
                applyImmediately,