diff --git a/android/truapi-host/README.md b/android/truapi-host/README.md index 8b50acc2..3cf98bb4 100644 --- a/android/truapi-host/README.md +++ b/android/truapi-host/README.md @@ -335,7 +335,20 @@ core.notifyChainClosed(chainConnectionId) // following `loadUrl` replaces, so the product would lose the endpoint. Scope // it to the product origin. The page reads `window.__truapi_localhost.url` and // passes it to `@parity/truapi`'s `createWebSocketProvider`. -val bootstrap = LocalhostBridgeBootstrap.script(endpoint.port, endpoint.token) +// A peek, never a prompt — see LocalhostBridgeBootstrap.script. Baked in as a +// literal because the container enforces it inside the product's own realm, +// where an async permission request would be forgeable. A fresh grant therefore +// only takes effect once the web view reloads. +// +// Read this as a policy value, not a gate: Android injects no lockdown +// container, so nothing consumes the decision and WebRTC is reachable on +// Android whatever the status says. Pass what the core returns anyway — a +// literal `true` compiles and would silently keep that open once the container +// does land (#334 scopes the gate to iOS). +val webRtcAllowed = core.permissionAuthorizationStatus( + PermissionAuthorizationRequest.Remote(RemotePermissionRequest(RemotePermission.WebRtc)) +) == PermissionAuthorizationStatus.AUTHORIZED +val bootstrap = LocalhostBridgeBootstrap.script(endpoint.port, endpoint.token, webRtcAllowed) main.post { val productUrl = "https://your-product.example/" if (WebViewFeature.isFeatureSupported(WebViewFeature.DOCUMENT_START_SCRIPT)) { diff --git a/android/truapi-host/src/main/kotlin/io/parity/truapi/TrUAPIHost.kt b/android/truapi-host/src/main/kotlin/io/parity/truapi/TrUAPIHost.kt index 410b61cd..b2400398 100644 --- a/android/truapi-host/src/main/kotlin/io/parity/truapi/TrUAPIHost.kt +++ b/android/truapi-host/src/main/kotlin/io/parity/truapi/TrUAPIHost.kt @@ -629,15 +629,41 @@ private class ChatCallbackAdapter(private val bridge: ChatHostBridge) : NativeCh object LocalhostBridgeBootstrap { /** * Returns a `