mirror of
https://github.com/kavishdevar/librepods.git
synced 2026-05-22 16:59:11 +00:00
android: fix crash in reading call control settings
This commit is contained in:
@@ -240,7 +240,7 @@ fun AirPodsSettingsScreen(viewModel: AirPodsViewModel, navController: NavControl
|
|||||||
item(key = "spacer_call") { Spacer(modifier = Modifier.height(16.dp)) }
|
item(key = "spacer_call") { Spacer(modifier = Modifier.height(16.dp)) }
|
||||||
item(key = "call_control") {
|
item(key = "call_control") {
|
||||||
val bytes = state.controlStates[AACPManager.Companion.ControlCommandIdentifiers.CALL_MANAGEMENT_CONFIG]?.take(2)?.toByteArray() ?: byteArrayOf(0x00, 0x00)
|
val bytes = state.controlStates[AACPManager.Companion.ControlCommandIdentifiers.CALL_MANAGEMENT_CONFIG]?.take(2)?.toByteArray() ?: byteArrayOf(0x00, 0x00)
|
||||||
val flipped = bytes[1] == 0x02.toByte()
|
val flipped = try { bytes[1] == 0x02.toByte() } catch (e: Exception) { false }
|
||||||
CallControlSettings(
|
CallControlSettings(
|
||||||
hazeState = hazeState,
|
hazeState = hazeState,
|
||||||
flipped = flipped,
|
flipped = flipped,
|
||||||
|
|||||||
Reference in New Issue
Block a user