diff --git a/tools/chatgui-android/router-tests/src/main/kotlin/android/content/HostIntents.kt b/tools/chatgui-android/router-tests/src/main/kotlin/android/content/HostIntents.kt index e99404c3..6e684aca 100644 --- a/tools/chatgui-android/router-tests/src/main/kotlin/android/content/HostIntents.kt +++ b/tools/chatgui-android/router-tests/src/main/kotlin/android/content/HostIntents.kt @@ -23,6 +23,8 @@ class Intent() { extras.putAll(other.extras) } fun addFlags(value: Int) = apply { flags = flags or value } + fun setAction(value: String) = apply { action = value } + fun setData(value: Uri) = apply { data = value } fun putExtra(name: String, value: Any) = apply { extras[name] = value } fun getLongExtra(name: String, default: Long): Long = extras[name] as? Long ?: default fun getBooleanExtra(name: String, default: Boolean): Boolean = extras[name] as? Boolean ?: default diff --git a/tools/chatgui-android/router-tests/src/main/kotlin/android/content/pm/ServiceInfo.kt b/tools/chatgui-android/router-tests/src/main/kotlin/android/content/pm/ServiceInfo.kt index 0871e2e6..db32962b 100644 --- a/tools/chatgui-android/router-tests/src/main/kotlin/android/content/pm/ServiceInfo.kt +++ b/tools/chatgui-android/router-tests/src/main/kotlin/android/content/pm/ServiceInfo.kt @@ -1,3 +1,7 @@ package android.content.pm -object ServiceInfo { const val FOREGROUND_SERVICE_TYPE_MICROPHONE = 128 } +object ServiceInfo { + const val FOREGROUND_SERVICE_TYPE_MICROPHONE = 128 + const val FOREGROUND_SERVICE_TYPE_PHONE_CALL = 4 + const val FOREGROUND_SERVICE_TYPE_CAMERA = 64 +} diff --git a/tools/chatgui-android/router-tests/src/main/kotlin/androidx/core/content/ContextCompat.kt b/tools/chatgui-android/router-tests/src/main/kotlin/androidx/core/content/ContextCompat.kt index a12c724b..fcf653b5 100644 --- a/tools/chatgui-android/router-tests/src/main/kotlin/androidx/core/content/ContextCompat.kt +++ b/tools/chatgui-android/router-tests/src/main/kotlin/androidx/core/content/ContextCompat.kt @@ -7,6 +7,10 @@ import java.util.concurrent.Executor /** Только host-тест: разрешение Context и main-очередь, без AndroidX runtime. */ object ContextCompat { + const val RECEIVER_NOT_EXPORTED = Context.RECEIVER_NOT_EXPORTED + fun startForegroundService(context: Context, intent: android.content.Intent) = context.startForegroundService(intent) + fun registerReceiver(context: Context, receiver: android.content.BroadcastReceiver, filter: android.content.IntentFilter, flags: Int) = + context.registerReceiver(receiver, filter, flags) fun checkSelfPermission(context: Context, permission: String): Int = context.checkSelfPermission(permission) fun getMainExecutor(context: Context): Executor = Executor { Handler(Looper.getMainLooper()).post(it) } }