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

Commit 91044ef2 authored by Josh's avatar Josh
Browse files

A11y now announces error messages when customizing a shortcut

Test: Manual - with talkback on, try to customize a shortcut using a
combination that's already in use. ensure talkback announces error
message
Flag: com.android.systemui.keyboard_shortcut_helper_shortcut_customizer
Fix: 390304655

Change-Id: I37f90fb8577ec988bfa14939893c3c26e2fcb602
parent 779a56f0
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -57,6 +57,10 @@ import androidx.compose.ui.input.key.onPreviewKeyEvent
import androidx.compose.ui.input.key.type
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.LiveRegionMode
import androidx.compose.ui.semantics.contentDescription
import androidx.compose.ui.semantics.liveRegion
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
@@ -242,7 +246,10 @@ private fun ErrorMessageContainer(errorMessage: String) {
                lineHeight = 20.sp,
                fontWeight = FontWeight.W500,
                color = MaterialTheme.colorScheme.error,
                modifier = Modifier.padding(start = 24.dp).width(252.dp),
                modifier = Modifier.padding(start = 24.dp).width(252.dp).semantics {
                    contentDescription = errorMessage
                    liveRegion = LiveRegionMode.Polite
                },
            )
        }
    }