diff --git a/App_Resources/Android/src/main/java/com/faceclaw/app/FaceclawBleManager.kt b/App_Resources/Android/src/main/java/com/faceclaw/app/FaceclawBleManager.kt index 16b842a5..3782e821 100644 --- a/App_Resources/Android/src/main/java/com/faceclaw/app/FaceclawBleManager.kt +++ b/App_Resources/Android/src/main/java/com/faceclaw/app/FaceclawBleManager.kt @@ -231,16 +231,17 @@ class FaceclawBleManager(context: Context) { fun connect(address: String?, timeoutMs: Int): Boolean = connect(address, timeoutMs, false) /** - * autoConnect=true is used for the ring and both glasses arms. The ring specifically - * needs it (Even's own vendor app connects the ring with Android's autoConnect flag - * set, confirmed via its own BLE debug log, "connect() - device: ..., - * auto: true"). A live test showed a ring-only direct connection dying almost - * exactly 5 seconds in, repeatedly, with nothing else competing for it, and the - * glasses arms showed the same "less patiently supervised" direct-connect drop. - * Direct connect (false) is faster to establish but Android supervises it less - * patiently. autoConnect=true can take much longer to actually complete (Android - * manages it as a background reconnect, not an immediate attempt), so it needs its - * own longer timeout. Like [connect], waits on an attempt already pending. + * EXPERIMENTAL (2026-09-11): the ring specifically needs autoConnect=true. + * Even's own vendor app connects the ring with Android's autoConnect flag + * set (confirmed via its own BLE debug log, "connect() - device: ..., + * auto: true"), while every other faceclaw connection (both glasses arms) + * uses autoConnect=false. Direct connect (false) is faster to establish + * but Android supervises it less patiently; a live test showed the + * ring-only direct connection dying almost exactly 5 seconds in, + * repeatedly, with nothing else competing for it. autoConnect=true can + * take much longer to actually complete (Android manages it as a + * background reconnect, not an immediate attempt), so this needs its own + * longer timeout. Like [connect], waits on an attempt already pending. */ fun connect(address: String?, timeoutMs: Int, autoConnect: Boolean): Boolean { val key = requireAddress(address) diff --git a/app/g2/dashboard-controller.ts b/app/g2/dashboard-controller.ts index 934be105..6e441fdf 100644 --- a/app/g2/dashboard-controller.ts +++ b/app/g2/dashboard-controller.ts @@ -120,7 +120,6 @@ export type DashboardSnapshot = { * glasses, and this says which harmless thing is actually going on. */ displayPreviewMessage: string; - silentModeFeedback: string; activeTextSettingId: string | null; activeTextEditorTitle: string; activeTextSettingTitle: string; @@ -296,9 +295,6 @@ class DashboardController { /** The screen area displayPreview shows (Preview scaling), or null for the whole panel. */ private displayPreviewCrop: ScreenRect | null = null; private silentMode = false; - private silentModeFeedback = ""; - private silentModeFeedbackGeneration = 0; - private silentModeFeedbackTimer: ReturnType | null = null; // Brightness value last pushed to the glasses; see pushBrightness. private lastPushedBrightness: string | null = null; private lastPushedHeadUp: string | null = null; @@ -1221,7 +1217,6 @@ class DashboardController { status: this.status, displayPreview: this.displayPreview, displayPreviewMessage: this.displayPreviewMessage(), - silentModeFeedback: this.silentModeFeedback, activeTextSettingId: primaryTextSetting?.id ?? null, activeTextEditorTitle: this.activeTextEditorTitle, activeTextSettingTitle: primaryTextSetting?.editorTitle ?? "", @@ -1260,43 +1255,6 @@ class DashboardController { * charging and silent mode both make the display unavailable while BLE stays * up, and a battery that just ran out simply stops answering. */ - private handleSilentMode(silent: boolean): void { - if (this.silentMode === silent) return; - this.silentMode = silent; - const generation = ++this.silentModeFeedbackGeneration; - if (this.silentModeFeedbackTimer !== null) clearTimeout(this.silentModeFeedbackTimer); - this.silentModeFeedbackTimer = null; - this.silentModeFeedback = silent - ? "Silent mode enabled — hold both touchpads to exit" - : "Silent mode disabled"; - if (!silent) { - void this.showSilentModeExit(generation).catch(error => { - this.appendLog(`silent-mode exit feedback failed: ${this.formatError(error)}`); - }); - this.silentModeFeedbackTimer = setTimeout(() => { - this.silentModeFeedbackTimer = null; - this.silentModeFeedback = ""; - this.emit(); - }, 5000); - } - this.emit(); - } - - private async showSilentModeExit(generation: number): Promise { - if (this.phase !== "connected" || this.silentMode || this.glassesLocked) return; - // The firmware powered the lenses down, and Faceclaw may have gone to - // sleep/suspended EvenHub meanwhile. Reusing the ordinary wake barrier is - // essential: rendering an alert into the retained surface alone is invisible. - this.cancelEvenHubSuspendTimer(); - shell.wake("sidebar"); - const ready = await this.ensureEvenHubSessionActive(); - if (!ready || generation !== this.silentModeFeedbackGeneration || this.silentMode || - this.phase !== "connected" || this.glassesLocked) return; - shell.showAlert("Silent mode disabled"); - shell.foregroundWindow()?.requestRender(); - this.requestShellRender(); - } - private displayPreviewMessage(): string { if (this.phase === "charging") { return chargingPreviewMessage(this.glassesDisplayState()); @@ -1731,7 +1689,9 @@ class DashboardController { }); }); this.offSilentMode = communicator.onSilentMode((silent) => { - this.handleSilentMode(silent); + if (this.silentMode === silent) return; + this.silentMode = silent; + this.emit(); }); this.offWearState = communicator.onWearState((wearing) => { this.handleWearState(wearing); @@ -3129,10 +3089,6 @@ class DashboardController { // Kept across "connecting": silent mode blocks app launches, so it can // itself cause the reconnect churn, and Java re-reports it either way. this.silentMode = false; - this.silentModeFeedbackGeneration++; - if (this.silentModeFeedbackTimer !== null) clearTimeout(this.silentModeFeedbackTimer); - this.silentModeFeedbackTimer = null; - this.silentModeFeedback = ""; } this.emit(); } diff --git a/app/phone-ui/main-page.xml b/app/phone-ui/main-page.xml index 10833a6a..29c12f08 100644 --- a/app/phone-ui/main-page.xml +++ b/app/phone-ui/main-page.xml @@ -74,9 +74,6 @@ class="ble-bandwidth-indicator" horizontalAlignment="center" verticalAlignment="bottom" /> -