android: assume off listening mode is available when the control command is not available

This commit is contained in:
Kavish Devar
2026-04-03 20:28:52 +05:30
parent 8469ce4984
commit 0087b871a1

View File

@@ -88,12 +88,12 @@ fun NoiseControlSettings(
val context = LocalContext.current
val offListeningModeConfigValue = service.aacpManager.controlCommandStatusList.find {
it.identifier == AACPManager.Companion.ControlCommandIdentifiers.ALLOW_OFF_OPTION
}?.value?.takeIf { it.isNotEmpty() }?.get(0) == 1.toByte()
}?.value?.takeIf { it.isNotEmpty() }?.get(0) != 2.toByte()
val offListeningMode = remember { mutableStateOf(offListeningModeConfigValue) }
val offListeningModeListener = object: AACPManager.ControlCommandListener {
override fun onControlCommandReceived(controlCommand: AACPManager.ControlCommand) {
offListeningMode.value = controlCommand.value[0] == 1.toByte()
offListeningMode.value = controlCommand.value[0] != 2.toByte()
}
}