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
Loading
Please register or sign in to comment