Skip to content

Your phone, on your command. Gotcha is world's first fully on-device AI copilot for Android that turns natural language into real device actions — safely.

debug(wakeword): make the release-build cost of the telemetry explicit

Durganshu Mishra5a2d7d5007af
diff --git a/app/src/main/java/com/gotcha/service/WakeWordDetector.kt b/app/src/main/java/com/gotcha/service/WakeWordDetector.kt
index f441c94..a40edcc 100644
--- a/app/src/main/java/com/gotcha/service/WakeWordDetector.kt
+++ b/app/src/main/java/com/gotcha/service/WakeWordDetector.kt
@@ -337,7 +337,14 @@ class WakeWordDetector(
continue
}
- telemetry?.onRead(WakeWordGate.rmsDb(block, count))
+ // Spelled out rather than `telemetry?.onRead(rmsDb(...))`. Both
+ // skip the RMS scan in release — a safe call does not evaluate
+ // its arguments when the receiver is null — but that is a
+ // subtlety one refactor away from being lost, and this is a
+ // per-frame path in an always-on listener.
+ if (telemetry != null) {
+ telemetry.onRead(WakeWordGate.rmsDb(block, count))
+ }
var detected = false
synchronized(stateLock) {