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

Skip to content
Commit 3a2fcbc6 authored by Lyn's avatar Lyn
Browse files

Batch and throttle appear rate of heads up notifications

New class AvalancheController delays heads up notification
appearance during avalanche by intercepting BaseHeadsUpManager events
that handle HUN drawing and removal scheduling:
- showNotification
- updateNotification
- removeEntry
- unpinAll
- removeAutoRemovalCallbacks
- scheduleAutoRemovalCallback

AvalancheController saves these events as a list of runnables per
HeadsUpEntry that run when the HeadsUpEntry is shown.

BaseHeadsUpManager.HeadsUpEntry
- implements hashCode and equals for key-based lookup
- calculateFinishTime uses 1s removal timeout during avalanche

HeadsUpManagerPhone injects AvalancheController into BaseHeadsUpManager.

Bug: 315362456
Test: atest SystemUiRoboTests:AvalancheControllerTest
Test: adb shell device_config override systemui com.android.systemui.notification_throttle_hun true
      send multiple HUNs in fast succession
      => HUNs appear 1s after each other in batches
      => Only top-priority HUN per batch is shown

Flag: ACONFIG notification_throttle_hun DEVELOPMENT
Change-Id: I7d97e137609fdee854e5b72013759773070777c8
parent c5c5bc55
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment