diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/browser/EmbeddedBrowserController.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/browser/EmbeddedBrowserController.kt index 928c1b298e..b374235e23 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/browser/EmbeddedBrowserController.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/browser/EmbeddedBrowserController.kt @@ -31,8 +31,11 @@ import android.os.IBinder import android.os.Looper import android.os.Message import android.os.Messenger +import android.util.Log import androidx.annotation.RequiresApi import androidx.privacysandbox.ui.client.SandboxedUiAdapterFactory +import androidx.privacysandbox.ui.client.view.SandboxedSdkUiSessionState +import androidx.privacysandbox.ui.client.view.SandboxedSdkUiSessionStateChangedListener import androidx.privacysandbox.ui.client.view.SandboxedSdkView import androidx.privacysandbox.ui.core.SandboxedUiAdapter import com.vitorpamplona.amethyst.napplethost.NappletBrowserContract @@ -98,6 +101,14 @@ class EmbeddedBrowserController( // Paint the surface placeholder in the app's theme background so there's no white flash before // the remote WebView delivers its first frame. view.setBackgroundColor(backgroundColor) + // DIAGNOSTIC (scrolling): log the surface session lifecycle so we can see if it reaches Active. + view.addStateChangedListener( + object : SandboxedSdkUiSessionStateChangedListener { + override fun onStateChanged(state: SandboxedSdkUiSessionState) { + Log.w("BrowserSurfaceDiag", "DIAG session state: $state") + } + }, + ) pendingAdapter?.let { view.setAdapter(it) pendingAdapter = null diff --git a/nappletHost/src/main/kotlin/com/vitorpamplona/amethyst/napplethost/NappletBrowserService.kt b/nappletHost/src/main/kotlin/com/vitorpamplona/amethyst/napplethost/NappletBrowserService.kt index 56f3566cda..4ed48584bc 100644 --- a/nappletHost/src/main/kotlin/com/vitorpamplona/amethyst/napplethost/NappletBrowserService.kt +++ b/nappletHost/src/main/kotlin/com/vitorpamplona/amethyst/napplethost/NappletBrowserService.kt @@ -161,6 +161,12 @@ class NappletBrowserService : Service() { configureWebView(wv) // Theme the pre-load background so a blank/loading page shows Amethyst's background, not white. wv.setBackgroundColor(bgColor) + // DIAGNOSTIC (scrolling): log whether touch input crosses the SurfaceControlViewHost boundary to + // the remote WebView at all. Returns false so it never consumes — the WebView still scrolls. + wv.setOnTouchListener { _, event -> + Log.w(TAG, "DIAG browser WebView touch action=${event.actionMasked} x=${event.x} y=${event.y}") + false + } wv.dropSystemBarInsets() applyWebViewProxy(if (useTor) proxyPort else -1) val shim = readContractAsset(NappletWebContract.SHIM_JS_PATH).decodeToString()