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

Commit 30f5b493 authored by Lyn Han's avatar Lyn Han Committed by Android (Google) Code Review
Browse files

Merge "Fix HUN hiding and collapsing when cycling out" into main

parents 7122ba0c 87d29a6c
Loading
Loading
Loading
Loading
+20 −11
Original line number Diff line number Diff line
@@ -30,7 +30,9 @@ import javax.inject.Inject
 * succession, by delaying visual listener side effects and removal handling from BaseHeadsUpManager
 */
@SysUISingleton
class AvalancheController @Inject constructor(
class AvalancheController
@Inject
constructor(
    dumpManager: DumpManager,
) : Dumpable {

@@ -79,7 +81,7 @@ class AvalancheController @Inject constructor(
        val fn = "[$label] => AvalancheController.update [${getKey(entry)}]"
        if (entry == null) {
            log { "Entry is NULL, stop update." }
            return;
            return
        }
        if (debug) {
            debugRunnableLabelMap[runnable] = label
@@ -142,9 +144,12 @@ class AvalancheController @Inject constructor(
        } else if (isShowing(entry)) {
            log { "$fn => [remove showing ${getKey(entry)}]" }
            previousHunKey = getKey(headsUpEntryShowing)

            // Show the next HUN before removing this one, so that we don't tell listeners
            // onHeadsUpPinnedModeChanged, which causes
            // NotificationPanelViewController.updateTouchableRegion to hide the window while the
            // HUN is animating out, resulting in a flicker.
            showNext()
            runnable.run()
            showNextAfterRemove()
        } else {
            log { "$fn => [removing untracked ${getKey(entry)}]" }
        }
@@ -247,7 +252,7 @@ class AvalancheController @Inject constructor(
        }
    }

    private fun showNextAfterRemove() {
    private fun showNext() {
        log { "SHOW NEXT" }
        headsUpEntryShowing = null

@@ -301,10 +306,14 @@ class AvalancheController @Inject constructor(
    }

    private fun logState(reason: String) {
        log { "\n================================================================================="}
        log {
            "\n================================================================================="
        }
        log { "STATE $reason" }
        log { getStateStr() }
        log { "=================================================================================\n"}
        log {
            "=================================================================================\n"
        }
    }

    private val dropSetStr: String