fix: preserve camera permission intent and distinguish unknown reply expression

This commit is contained in:
zenord
2026-10-12 11:33:36 +08:00
parent d43c7d4e80
commit b521d368a5
26 changed files with 544 additions and 101 deletions
+3 -3
View File
@@ -8,11 +8,11 @@ fun main() {
}
listOf("other" to 1, "neutral" to 2, "happy" to 0, "sad" to 3).forEach { (kind, strength) ->
val parsed = checkNotNull(com.gorios.lanvoice.dialogue.ReplyEmotion.fromWire(7L, 10L, kind, strength, "model"))
check(parsed.label == "中立" && parsed.source == com.gorios.lanvoice.dialogue.EmotionSource.FALLBACK)
check(parsed.label == "表达未判定(格式回退)" && parsed.source == com.gorios.lanvoice.dialogue.EmotionSource.FALLBACK)
}
check(com.gorios.lanvoice.dialogue.ReplyEmotion.fromWire(null, 1, "happy", 2, "model") == null)
check(com.gorios.lanvoice.dialogue.ReplyEmotion.fromWire(1, 1, "happy", true, "model")?.label == "中立")
check(com.gorios.lanvoice.dialogue.ReplyEmotion.fromWire(1, 1, "happy", 2.0, "model")?.label == "中立")
check(com.gorios.lanvoice.dialogue.ReplyEmotion.fromWire(1, 1, "happy", true, "model")?.label == "表达未判定(格式回退)")
check(com.gorios.lanvoice.dialogue.ReplyEmotion.fromWire(1, 1, "happy", 2.0, "model")?.label == "表达未判定(格式回退)")
val pcm = ByteArray(640) { (it % 256).toByte() }
val uplink = DialogueProtocol.uplink(pcm, 0x81234567L, 0xffffffffL)