add no-op comments to empty methods
This commit is contained in:
+3
-1
@@ -93,5 +93,7 @@ class MockWritingAssistant : WritingAssistant {
|
|||||||
.replace("wont ", "won't ")
|
.replace("wont ", "won't ")
|
||||||
.replace("i ", "I ")
|
.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(
|
override fun onAccuracyChanged(
|
||||||
sensor: Sensor?,
|
sensor: Sensor?,
|
||||||
accuracy: Int,
|
accuracy: Int,
|
||||||
) {}
|
) {
|
||||||
|
// no-op: proximity is a binary near/far signal; accuracy changes don't affect routing.
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun startRinging() {
|
fun startRinging() {
|
||||||
|
|||||||
+39
-13
@@ -74,7 +74,9 @@ class WebRtcCallSession(
|
|||||||
candidate?.let { this@WebRtcCallSession.onIceCandidate(it) }
|
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?) {
|
override fun onSignalingChange(state: PeerConnection.SignalingState?) {
|
||||||
Log.d(TAG) { "Signaling state changed: $state" }
|
Log.d(TAG) { "Signaling state changed: $state" }
|
||||||
@@ -137,9 +139,13 @@ class WebRtcCallSession(
|
|||||||
stream?.videoTracks?.firstOrNull()?.let { onRemoteVideoTrack(it) }
|
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() {
|
override fun onRenegotiationNeeded() {
|
||||||
Log.d(TAG) { "Renegotiation needed" }
|
Log.d(TAG) { "Renegotiation needed" }
|
||||||
@@ -209,9 +215,13 @@ class WebRtcCallSession(
|
|||||||
error?.let { onError("Create offer failed: $it") }
|
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,
|
constraints,
|
||||||
)
|
)
|
||||||
@@ -239,9 +249,13 @@ class WebRtcCallSession(
|
|||||||
error?.let { onError("Create answer failed: $it") }
|
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,
|
constraints,
|
||||||
)
|
)
|
||||||
@@ -251,9 +265,13 @@ class WebRtcCallSession(
|
|||||||
Log.d(TAG) { "setRemoteDescription type=${sdp.type} sdpLength=${sdp.description.length}" }
|
Log.d(TAG) { "setRemoteDescription type=${sdp.type} sdpLength=${sdp.description.length}" }
|
||||||
peerConnection?.setRemoteDescription(
|
peerConnection?.setRemoteDescription(
|
||||||
object : SdpObserver {
|
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() {
|
override fun onSetSuccess() {
|
||||||
Log.d(TAG) { "setRemoteDescription SUCCESS (type=${sdp.type})" }
|
Log.d(TAG) { "setRemoteDescription SUCCESS (type=${sdp.type})" }
|
||||||
@@ -301,9 +319,13 @@ class WebRtcCallSession(
|
|||||||
onDisconnected()
|
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,
|
constraints,
|
||||||
)
|
)
|
||||||
@@ -328,9 +350,13 @@ class WebRtcCallSession(
|
|||||||
val rollbackSdp = SessionDescription(SessionDescription.Type.ROLLBACK, "")
|
val rollbackSdp = SessionDescription(SessionDescription.Type.ROLLBACK, "")
|
||||||
peerConnection?.setLocalDescription(
|
peerConnection?.setLocalDescription(
|
||||||
object : SdpObserver {
|
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() {
|
override fun onSetSuccess() {
|
||||||
Log.d(TAG) { "Rollback SUCCESS" }
|
Log.d(TAG) { "Rollback SUCCESS" }
|
||||||
|
|||||||
@@ -39,21 +39,33 @@ class EmptyNav : INav {
|
|||||||
override fun openDrawer() = runBlocking { drawerState.open() }
|
override fun openDrawer() = runBlocking { drawerState.open() }
|
||||||
|
|
||||||
// All navigation methods are intentionally no-op; this is a stub for previews and tests
|
// 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
|
@Composable
|
||||||
override fun canPop(): Boolean = false
|
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(
|
override fun <T : Route> popUpTo(
|
||||||
route: Route,
|
route: Route,
|
||||||
klass: KClass<T>,
|
klass: KClass<T>,
|
||||||
) {}
|
) {
|
||||||
|
// no-op: EmptyNav is a preview/test stub with no back stack.
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-2
@@ -179,12 +179,16 @@ interface EventHandler<T : IEvent> {
|
|||||||
event: T,
|
event: T,
|
||||||
eventNote: Note,
|
eventNote: Note,
|
||||||
publicNote: Note,
|
publicNote: Note,
|
||||||
) {}
|
) {
|
||||||
|
// no-op default: handlers that only care about deletes (or only adds) skip overriding this.
|
||||||
|
}
|
||||||
|
|
||||||
suspend fun delete(
|
suspend fun delete(
|
||||||
event: T,
|
event: T,
|
||||||
eventNote: Note,
|
eventNote: Note,
|
||||||
) {}
|
) {
|
||||||
|
// no-op default: handlers that only care about adds (or only deletes) skip overriding this.
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class ChatHandler(
|
class ChatHandler(
|
||||||
|
|||||||
+9
-2
@@ -98,9 +98,16 @@ fun RelayUrlEditFieldPreview() {
|
|||||||
override val results: Flow<List<BasicRelaySetupInfo>> =
|
override val results: Flow<List<BasicRelaySetupInfo>> =
|
||||||
MutableStateFlow(suggestions)
|
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.
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user