fix: fence voice turns and playback; add opt-in face context
This commit is contained in:
@@ -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 }
|
||||
Reference in New Issue
Block a user