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

Commit 1b93a922 authored by Julia Tuttle's avatar Julia Tuttle
Browse files

Log onPanelExpansionChanged events

Bug: 347731926
Test: manual: run, fiddle with panel, check NotifLockscreenLog
Flag: EXEMPT small logging change
Change-Id: I35407107d7807b017f8b9795d0f03ca6b7c817cf
parent d5417c34
Loading
Loading
Loading
Loading
+18 −4
Original line number Diff line number Diff line
@@ -469,10 +469,24 @@ constructor(
        get() = state

    override fun onPanelExpansionChanged(event: ShadeExpansionChangeEvent) {
        val collapsedEnough = event.fraction <= 0.9f
        if (collapsedEnough != this.collapsedEnoughToHide) {
            val couldShowPulsingHuns = canShowPulsingHuns
            this.collapsedEnoughToHide = collapsedEnough
        val fraction = event.fraction

        val wasCollapsedEnoughToHide = collapsedEnoughToHide
        val isCollapsedEnoughToHide = fraction <= 0.9f

        if (isCollapsedEnoughToHide != wasCollapsedEnoughToHide) {
            val couldShowPulsingHuns = this.canShowPulsingHuns
            this.collapsedEnoughToHide = isCollapsedEnoughToHide
            val canShowPulsingHuns = this.canShowPulsingHuns

            logger.logOnPanelExpansionChanged(
                fraction,
                wasCollapsedEnoughToHide,
                isCollapsedEnoughToHide,
                couldShowPulsingHuns,
                canShowPulsingHuns
            )

            if (couldShowPulsingHuns && !canShowPulsingHuns) {
                updateNotificationVisibility(animate = true, increaseSpeed = true)
                mHeadsUpManager.releaseAllImmediately()
+25 −0
Original line number Diff line number Diff line
@@ -182,6 +182,31 @@ constructor(@NotificationLockscreenLog private val buffer: LogBuffer) {
        )
    }

    fun logOnPanelExpansionChanged(
        fraction: Float,
        wasCollapsedEnoughToHide: Boolean,
        isCollapsedEnoughToHide: Boolean,
        couldShowPulsingHuns: Boolean,
        canShowPulsingHuns: Boolean
    ) {
        buffer.log(
            TAG,
            DEBUG,
            {
                double1 = fraction.toDouble()
                bool1 = wasCollapsedEnoughToHide
                bool2 = isCollapsedEnoughToHide
                bool3 = couldShowPulsingHuns
                bool4 = canShowPulsingHuns
            },
            {
                "onPanelExpansionChanged($double1):" +
                    " collapsedEnoughToHide: $bool1 -> $bool2," +
                    " canShowPulsingHuns: $bool3 -> $bool4"
            }
        )
    }

    fun logSetWakingUp(wakingUp: Boolean, requestDelayedAnimation: Boolean) {
        buffer.log(
            TAG,