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

Commit 1dad49ed authored by Ibrahim Yilmaz's avatar Ibrahim Yilmaz
Browse files

KeyguardMediaController: Log Active Container on refreshMedia

This CL logs active media before and after applying visibility change on refreshMediaPosition.

Bug: 298213983
Test: BR
Flag: None
Change-Id: I6c5c869e1b0ce6c9736f7c71f7faa7c06d0817f7
parent 60b391c5
Loading
Loading
Loading
Loading
+13 −7
Original line number Diff line number Diff line
@@ -230,18 +230,12 @@ constructor(
        val currentAllowMediaPlayerOnLockScreen = allowMediaPlayerOnLockScreen
        val useSplitShade = useSplitShade
        val shouldBeVisibleForSplitShade = shouldBeVisibleForSplitShade()

        visible =
            isMediaHostVisible &&
                isBypassNotEnabled &&
                keyguardOrUserSwitcher &&
                currentAllowMediaPlayerOnLockScreen &&
                shouldBeVisibleForSplitShade
        if (visible) {
            showMediaPlayer()
        } else {
            hideMediaPlayer()
        }
        logger.logRefreshMediaPosition(
            reason = reason,
            visible = visible,
@@ -251,8 +245,17 @@ constructor(
            mediaHostVisible = isMediaHostVisible,
            bypassNotEnabled = isBypassNotEnabled,
            currentAllowMediaPlayerOnLockScreen = currentAllowMediaPlayerOnLockScreen,
            shouldBeVisibleForSplitShade = shouldBeVisibleForSplitShade
            shouldBeVisibleForSplitShade = shouldBeVisibleForSplitShade,
        )
        val currActiveContainer = activeContainer

        logger.logActiveMediaContainer("before refreshMediaPosition", currActiveContainer)
        if (visible) {
            showMediaPlayer()
        } else {
            hideMediaPlayer()
        }
        logger.logActiveMediaContainer("after refreshMediaPosition", currActiveContainer)

        lastUsedStatusBarState = currentState
    }
@@ -325,4 +328,7 @@ constructor(
            }
        }
    }

    private val activeContainer: ViewGroup? =
        if (useSplitShade) splitShadeContainer else singlePaneContainer
}
+16 −2
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.systemui.media.controls.ui

import android.view.ViewGroup
import com.android.systemui.log.LogBuffer
import com.android.systemui.log.core.LogLevel.DEBUG
import com.android.systemui.log.dagger.KeyguardMediaControllerLog
@@ -36,8 +37,8 @@ constructor(@KeyguardMediaControllerLog private val logBuffer: LogBuffer) {
        mediaHostVisible: Boolean,
        bypassNotEnabled: Boolean,
        currentAllowMediaPlayerOnLockScreen: Boolean,
        shouldBeVisibleForSplitShade: Boolean
    ) =
        shouldBeVisibleForSplitShade: Boolean,
    ) {
        logBuffer.log(
            TAG,
            DEBUG,
@@ -63,6 +64,19 @@ constructor(@KeyguardMediaControllerLog private val logBuffer: LogBuffer) {
                    "shouldBeVisibleForSplitShade=$str3)"
            }
        )
    }

    fun logActiveMediaContainer(reason: String, activeContainer: ViewGroup?) {
        logBuffer.log(
            TAG,
            DEBUG,
            {
                str1 = reason
                str2 = activeContainer.toString()
            },
            { "activeMediaContainerVisibility(reason=$str1, activeContainer=$str2)" }
        )
    }

    private companion object {
        private const val TAG = "KeyguardMediaControllerLog"