diff options
| author | 2024-07-04 12:32:40 +0200 | |
|---|---|---|
| committer | 2024-07-04 12:32:40 +0200 | |
| commit | b79bbb517a1b7fb9ee05751b0bb22d8c9292f55b (patch) | |
| tree | d2538f770fd976add516d493e897bcd158846782 | |
| parent | 73d5e7b8605b90b9af400580d87c74fc4a0042b3 (diff) | |
Fix incorrect flagging of flow change.
I used apply instead of let, which meant that, since flowOn and
stateIn/shareIn don't actually change the object, but instead wrap it
and return something else, the apply wasn't doing anything at all :(
Flag: com.android.settingslib.flags.volume_panel_broadcast_fix
Test: v2/android-crystalball-eng/health/microbench/systemui/main/systemui-statusbar-2-jank-suite
Fix: 348810424
Bug: 347707024
Change-Id: I2f8ddf45ebe32a4c8deca9a079734daef66d4b21
| -rw-r--r-- | packages/SettingsLib/src/com/android/settingslib/statusbar/notification/data/repository/ZenModeRepository.kt | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/packages/SettingsLib/src/com/android/settingslib/statusbar/notification/data/repository/ZenModeRepository.kt b/packages/SettingsLib/src/com/android/settingslib/statusbar/notification/data/repository/ZenModeRepository.kt index 4d25237757ea..29527646b89f 100644 --- a/packages/SettingsLib/src/com/android/settingslib/statusbar/notification/data/repository/ZenModeRepository.kt +++ b/packages/SettingsLib/src/com/android/settingslib/statusbar/notification/data/repository/ZenModeRepository.kt @@ -73,12 +73,12 @@ class ZenModeRepositoryImpl( awaitClose { context.unregisterReceiver(receiver) } } - .apply { + .let { if (Flags.volumePanelBroadcastFix()) { - flowOn(backgroundCoroutineContext) - stateIn(scope, SharingStarted.WhileSubscribed(), null) + it.flowOn(backgroundCoroutineContext) + .stateIn(scope, SharingStarted.WhileSubscribed(), null) } else { - shareIn( + it.shareIn( started = SharingStarted.WhileSubscribed(), scope = scope, ) |