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

Commit 7bb22aeb authored by Andrew Xu's avatar Andrew Xu
Browse files

Use LaunchedEffectWithLifecycle to request QS overlay focus

This CL uses LaunchedEffectWithLifecycle rather than LaunchedEffect to
handle the edge case that the QS shade overlay is composed at all times.

Bug: 443126358
Flag: EXEMPT bugfix
Change-Id: Ia9a0d26d4264b16135c32c24b0175909ae78d169
parent ba973a2d
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -39,7 +39,6 @@ import androidx.compose.material3.IconButton
import androidx.compose.material3.IconButtonDefaults
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.ReadOnlyComposable
import androidx.compose.runtime.derivedStateOf
import androidx.compose.runtime.getValue
@@ -283,7 +282,7 @@ private fun ContentScope.QuickSettingsContainer(

    val focusRequester = remember { FocusRequester() }

    LaunchedEffect(focusRequester) {
    LaunchedEffectWithLifecycle(focusRequester) {
        // Request focus on the `QuickSettingsContainer` without user interaction so that the user
        // can press the tab key once to enter the Quick Settings area. Without this line, the user
        // has to tab through unrelated views of the higher view hierarchy level.