fix: fence voice turns and playback; add opt-in face context

This commit is contained in:
zenord
2026-10-11 20:50:11 +08:00
parent 885bb3f2db
commit 9b428fb76f
46 changed files with 2306 additions and 32 deletions
+22
View File
@@ -0,0 +1,22 @@
package android.os
class Looper {
companion object {
private val main = Looper()
@JvmStatic fun getMainLooper() = main
@JvmStatic fun myLooper() = main
}
}
// Deterministic FIFO main-thread queue; no Android device/real sockets in this test.
class Handler(val looper: Looper) {
companion object {
val queue = java.util.concurrent.ConcurrentLinkedQueue<Runnable>()
val delayed = mutableListOf<Runnable>()
fun drain() { while (true) (queue.poll() ?: return).run() }
}
fun post(action: Runnable): Boolean { queue.add(action); return true }
fun postDelayed(action: Runnable, delay: Long): Boolean { delayed.add(action); return true }
fun removeCallbacks(action: Runnable) { delayed.remove(action); queue.remove(action) }
}
object SystemClock { fun elapsedRealtime() = System.nanoTime() / 1_000_000 }