UserRepository: Drop usages of runBlocking
- This CL makes the initialization of _userSwitcherSettings
non-blocking. Previously, the initialValue for the StateFlow
was retrieved using `runBlocking { getSettings() }`. While
functional, runBlocking will block the current thread until the
suspending getSettings() call completes.
- The `onStart { emit(Unit) }` operator ensures that getSettings()
is still executed immediately and asynchronously, pushing the
actual settings to the StateFlow shortly after.
Bug: 423462317
Flag: com.android.systemui.do_not_use_run_blocking
Test: atest UserRepositoryImplTest
Change-Id: Ib90302ac3bed8e0067031bbf18b43b0eca06eafd
Loading
Please register or sign in to comment