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

Skip to content
Commit 323a8f0d authored by Fabian Kozynski's avatar Fabian Kozynski
Browse files

Refresh to non null state for new tiles on creation

When a new tile (QSTileViewModel + QSTileViewModelAdapter) is created,
we launch a collection to have a first state. The problem is that
when we moved from SharedFlow (without initial state) to StateFlow
(with `null` initial state), calling `first` just returns `null` and
stops the collection. Instead, continue collecting until we have a non
null state. This has a couple of effects:

* Non null state in dumps if QS has never been opened (or has just been
  opened).
* This translates in tiles already showing UI state on first open as
  opposed to appearing blank.
* Also, it should reduce the number of updates to UI on first opening
  the shade.

Test: manual
Test: atest com.android.systemui.qs
Test: atest CtsTileServiceTestCases
Fixes: 356621310
Fixes: 346392367
Flag: com.android.systemui.qs_new_tiles

Change-Id: Id2a86d183e01e828b5c273ff7864dd6a0e44dd80
parent a9f30c2a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment