Add explicit device instrumentation for call codec verification

This commit is contained in:
evgeny committed 2026-10-14 22:46:10 +02:00
1 parent ba2a66341a
commit 9becdac331
2 files changed
+23

No files matched your search

@@ -0,0 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<instrumentation android:name="com.utun.chat.data.CallVideoProbe"
android:targetPackage="com.utun.chat" android:label="Call video codec probe" />
</manifest>
@@ -0,0 +1,19 @@
package com.utun.chat.data
import android.app.Instrumentation
import android.os.Bundle
/** Запускается только явно через adb am instrument; камера и реальные звонки не затрагиваются. */
class CallVideoProbe : Instrumentation() {
override fun onCreate(arguments: Bundle?) { super.onCreate(arguments); start() }
override fun onStart() {
try {
val codecs = CallVideoCodec.probe()
check(codecs.isNotEmpty()) { "No conforming encoder/decoder pair" }
finish(0, Bundle().apply { putString("codecs", codecs.toString()) })
} catch (e: Exception) {
android.util.Log.e("CallVideoProbe", "probe failed", e)
finish(1, Bundle().apply { putString("error", e.toString()) })
}
}
}