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

Commit 62cd9991 authored by Anton Potapov's avatar Anton Potapov
Browse files

Hide ANC popup when anc switching is unavailable

Flag: com.android.systemui.new_volume_panel
Test: manual on the phone with an ANC compatible headset
Fixes: 331319333
Fixes: 331316781
Change-Id: I2c7590a8239d43b90bc086d64f5a56334760d24e
parent ee2acbba
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -68,13 +68,17 @@ constructor(
    @Composable
    private fun Content(dialog: SystemUIDialog) {
        val isAvailable by viewModel.isAvailable.collectAsStateWithLifecycle(true)

        if (!isAvailable) {
            SideEffect { dialog.dismiss() }
            return
        }

        val slice by viewModel.popupSlice.collectAsStateWithLifecycle()
        if (!viewModel.isClickable(slice)) {
            SideEffect { dialog.dismiss() }
            return
        }

        SliceAndroidView(
            modifier = Modifier.fillMaxWidth(),
            slice = slice,