docs(embed): explain intentionally-empty method bodies for Sonar S1186

This commit is contained in:
davotoula
2026-07-01 10:11:24 +02:00
parent 0adee41711
commit 15338dffcc
4 changed files with 39 additions and 13 deletions
@@ -39,10 +39,14 @@ interface EmbeddedSurfaceController {
fun attachView(view: SandboxedSdkView)
/** The session became the visible tab. */
fun onShown() {}
fun onShown() {
// Optional hook: default no-op. Controllers that don't pause/resume applet JS need no action.
}
/** The session is warm but off-screen; a controller may pause its applet here. */
fun onHidden() {}
fun onHidden() {
// Optional hook: default no-op. Controllers that don't pause/resume applet JS need no action.
}
/** Permanently close the session (unbind the service); used on eviction. */
fun teardown()
@@ -59,5 +63,7 @@ interface EmbeddedSurfaceController {
var onLoadStatusChanged: ((EmbeddedLoadStatus) -> Unit)?
/** Re-attempt the load from scratch (the overlay's Retry); default no-op. */
fun retry() {}
fun retry() {
// Default no-op: only controllers that report a real load state (and thus can fail) override this.
}
}
@@ -85,14 +85,18 @@ class RemoteImeView(
start: Int,
count: Int,
after: Int,
) {}
) {
// No-op: TextWatcher requires this override, but only afterTextChanged drives our flush.
}
override fun onTextChanged(
s: CharSequence?,
start: Int,
before: Int,
count: Int,
) {}
) {
// No-op: TextWatcher requires this override, but only afterTextChanged drives our flush.
}
override fun afterTextChanged(s: Editable?) {
if (!applyingRemote) onEdited?.invoke()
@@ -81,7 +81,9 @@ private class BrowserSession(
override val signalOptions: Set<String> = emptySet()
override fun notifySessionRendered(supportedSignalOptions: Set<String>) {}
override fun notifySessionRendered(supportedSignalOptions: Set<String>) {
// No-op: signalOptions is empty, so there are no supported signals to report back on.
}
override fun notifyResized(
width: Int,
@@ -91,11 +93,17 @@ private class BrowserSession(
webView.requestLayout()
}
override fun notifyZOrderChanged(isZOrderOnTop: Boolean) {}
override fun notifyZOrderChanged(isZOrderOnTop: Boolean) {
// No-op: the WebView's z-order within the SurfaceControlViewHost surface is fixed.
}
override fun notifyConfigurationChanged(configuration: Configuration) {}
override fun notifyConfigurationChanged(configuration: Configuration) {
// No-op: the WebView handles configuration changes itself; the session needs no extra action.
}
override fun notifyUiChanged(uiContainerInfo: Bundle) {}
override fun notifyUiChanged(uiContainerInfo: Bundle) {
// No-op: no host-side reaction is needed to UI-container geometry updates.
}
override fun close() {
// The library may call close() off the main thread; WebView.destroy() (and the tabs mutation)
@@ -82,7 +82,9 @@ private class HostSession(
override val signalOptions: Set<String> = emptySet()
override fun notifySessionRendered(supportedSignalOptions: Set<String>) {}
override fun notifySessionRendered(supportedSignalOptions: Set<String>) {
// No-op: signalOptions is empty, so there are no supported signals to report back on.
}
override fun notifyResized(
width: Int,
@@ -92,11 +94,17 @@ private class HostSession(
webView.requestLayout()
}
override fun notifyZOrderChanged(isZOrderOnTop: Boolean) {}
override fun notifyZOrderChanged(isZOrderOnTop: Boolean) {
// No-op: the WebView's z-order within the SurfaceControlViewHost surface is fixed.
}
override fun notifyConfigurationChanged(configuration: Configuration) {}
override fun notifyConfigurationChanged(configuration: Configuration) {
// No-op: the WebView handles configuration changes itself; the session needs no extra action.
}
override fun notifyUiChanged(uiContainerInfo: Bundle) {}
override fun notifyUiChanged(uiContainerInfo: Bundle) {
// No-op: no host-side reaction is needed to UI-container geometry updates.
}
override fun close() {
// The library may call close() off the main thread; WebView.destroy() (and the tabs mutation)