diff options
| author | 2024-07-31 19:58:16 +0000 | |
|---|---|---|
| committer | 2024-07-31 20:02:43 +0000 | |
| commit | 323a8f0dd047060a5dfa3a4e03fac5a8d56c1e09 (patch) | |
| tree | 5cf7a066ca3935cff37aa997e5df4eb7c03930cf /api/api_test.go | |
| parent | a9f30c2ab8f047272a1180212ad8e4001c02b3d9 (diff) | |
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
Diffstat (limited to 'api/api_test.go')
0 files changed, 0 insertions, 0 deletions