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

Commit c7b0b7b6 authored by Julia Tuttle's avatar Julia Tuttle Committed by Android (Google) Code Review
Browse files

Merge "Log onPanelExpansionChanged events" into main

parents b7f523cd 1b93a922
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)
                headsUpManager.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,