add no-op comments to empty methods

This commit is contained in:
davotoula
2026-04-29 08:43:59 +02:00
parent 250378b657
commit 3332d8b530
6 changed files with 78 additions and 25 deletions
@@ -93,5 +93,7 @@ class MockWritingAssistant : WritingAssistant {
.replace("wont ", "won't ")
.replace("i ", "I ")
override fun close() {}
override fun close() {
// no-op: mock holds no native handles or background workers to release.
}
}
@@ -113,7 +113,9 @@ class CallAudioManager(
override fun onAccuracyChanged(
sensor: Sensor?,
accuracy: Int,
) {}
) {
// no-op: proximity is a binary near/far signal; accuracy changes don't affect routing.
}
}
fun startRinging() {
@@ -74,7 +74,9 @@ class WebRtcCallSession(
candidate?.let { this@WebRtcCallSession.onIceCandidate(it) }
}
override fun onIceCandidatesRemoved(candidates: Array<out IceCandidate>?) {}
override fun onIceCandidatesRemoved(candidates: Array<out IceCandidate>?) {
// no-op: removed candidates are diagnostic only; ICE state transitions handle reconnects.
}
override fun onSignalingChange(state: PeerConnection.SignalingState?) {
Log.d(TAG) { "Signaling state changed: $state" }
@@ -137,9 +139,13 @@ class WebRtcCallSession(
stream?.videoTracks?.firstOrNull()?.let { onRemoteVideoTrack(it) }
}
override fun onRemoveStream(stream: MediaStream?) {}
override fun onRemoveStream(stream: MediaStream?) {
// no-op: Plan-B legacy callback. UNIFIED_PLAN delivers track-level events via onAddTrack instead.
}
override fun onDataChannel(channel: DataChannel?) {}
override fun onDataChannel(channel: DataChannel?) {
// no-op: this session uses audio/video tracks only; data channels are not negotiated.
}
override fun onRenegotiationNeeded() {
Log.d(TAG) { "Renegotiation needed" }
@@ -209,9 +215,13 @@ class WebRtcCallSession(
error?.let { onError("Create offer failed: $it") }
}
override fun onSetSuccess() {}
override fun onSetSuccess() {
// no-op: createOffer fires only onCreate*; setLocalDescription uses loggingSdpObserver.
}
override fun onSetFailure(error: String?) {}
override fun onSetFailure(error: String?) {
// no-op: createOffer fires only onCreate*; setLocalDescription uses loggingSdpObserver.
}
},
constraints,
)
@@ -239,9 +249,13 @@ class WebRtcCallSession(
error?.let { onError("Create answer failed: $it") }
}
override fun onSetSuccess() {}
override fun onSetSuccess() {
// no-op: createAnswer fires only onCreate*; setLocalDescription uses loggingSdpObserver.
}
override fun onSetFailure(error: String?) {}
override fun onSetFailure(error: String?) {
// no-op: createAnswer fires only onCreate*; setLocalDescription uses loggingSdpObserver.
}
},
constraints,
)
@@ -251,9 +265,13 @@ class WebRtcCallSession(
Log.d(TAG) { "setRemoteDescription type=${sdp.type} sdpLength=${sdp.description.length}" }
peerConnection?.setRemoteDescription(
object : SdpObserver {
override fun onCreateSuccess(sdp: SessionDescription?) {}
override fun onCreateSuccess(sdp: SessionDescription?) {
// no-op: setRemoteDescription fires only onSet*.
}
override fun onCreateFailure(error: String?) {}
override fun onCreateFailure(error: String?) {
// no-op: setRemoteDescription fires only onSet*.
}
override fun onSetSuccess() {
Log.d(TAG) { "setRemoteDescription SUCCESS (type=${sdp.type})" }
@@ -301,9 +319,13 @@ class WebRtcCallSession(
onDisconnected()
}
override fun onSetSuccess() {}
override fun onSetSuccess() {
// no-op: createOffer fires only onCreate*; setLocalDescription uses loggingSdpObserver.
}
override fun onSetFailure(error: String?) {}
override fun onSetFailure(error: String?) {
// no-op: createOffer fires only onCreate*; setLocalDescription uses loggingSdpObserver.
}
},
constraints,
)
@@ -328,9 +350,13 @@ class WebRtcCallSession(
val rollbackSdp = SessionDescription(SessionDescription.Type.ROLLBACK, "")
peerConnection?.setLocalDescription(
object : SdpObserver {
override fun onCreateSuccess(sdp: SessionDescription?) {}
override fun onCreateSuccess(sdp: SessionDescription?) {
// no-op: setLocalDescription fires only onSet*.
}
override fun onCreateFailure(error: String?) {}
override fun onCreateFailure(error: String?) {
// no-op: setLocalDescription fires only onSet*.
}
override fun onSetSuccess() {
Log.d(TAG) { "Rollback SUCCESS" }
@@ -39,21 +39,33 @@ class EmptyNav : INav {
override fun openDrawer() = runBlocking { drawerState.open() }
// All navigation methods are intentionally no-op; this is a stub for previews and tests
override fun nav(route: Route) {}
override fun nav(route: Route) {
// no-op: EmptyNav is a preview/test stub with no navigation host.
}
override fun nav(computeRoute: suspend () -> Route?) {}
override fun nav(computeRoute: suspend () -> Route?) {
// no-op: EmptyNav is a preview/test stub with no navigation host.
}
override fun newStack(route: Route) {}
override fun newStack(route: Route) {
// no-op: EmptyNav is a preview/test stub with no back stack to reset.
}
override fun navBottomBar(route: Route) {}
override fun navBottomBar(route: Route) {
// no-op: EmptyNav is a preview/test stub with no bottom-bar host.
}
@Composable
override fun canPop(): Boolean = false
override fun popBack() {}
override fun popBack() {
// no-op: EmptyNav is a preview/test stub with no back stack to pop.
}
override fun <T : Route> popUpTo(
route: Route,
klass: KClass<T>,
) {}
) {
// no-op: EmptyNav is a preview/test stub with no back stack.
}
}
@@ -179,12 +179,16 @@ interface EventHandler<T : IEvent> {
event: T,
eventNote: Note,
publicNote: Note,
) {}
) {
// no-op default: handlers that only care about deletes (or only adds) skip overriding this.
}
suspend fun delete(
event: T,
eventNote: Note,
) {}
) {
// no-op default: handlers that only care about adds (or only deletes) skip overriding this.
}
}
class ChatHandler(
@@ -98,9 +98,16 @@ fun RelayUrlEditFieldPreview() {
override val results: Flow<List<BasicRelaySetupInfo>> =
MutableStateFlow(suggestions)
override fun processInput(input: String) {}
override fun processInput(input: String) {
// No-op: this anonymous IRelaySuggestionState is preview-only and
// serves the static suggestions flow above. Live input filtering
// would only matter in an interactive run, which a @Preview never
// reaches.
}
override fun reset() {}
override fun reset() {
// No-op: see processInput above.
}
}
}