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

Commit b79bbb51 authored by Ioana Alexandru's avatar Ioana Alexandru
Browse files

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
parent 73d5e7b8
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -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,
                    )