Fix broken wakeword handling

This commit is contained in:
James Babcock committed 2026-08-01 14:37:30 -07:00
1 parent e8bb6e7778
commit 02c09ef889
3 files changed
+20 -7

No files matched your search

@@ -73,9 +73,10 @@ public class FaceclawBleCommunicator implements FaceclawBleListener, Runnable {
private volatile boolean firmwareDebugFlagsEnabled;
private int firmwareDebugFlagsLastSent = -1;
private boolean startupProbePending;
// Desired ownership of CFW's fail-open idle-wake lease. This survives a
// transport reconnect; the lease itself is volatile firmware state and is
// re-acquired once both arms are ready.
// Desired ownership of CFW's fail-open stock-wake lease (dashboard launch
// and Even AI foreground takeover). This survives a transport reconnect;
// the lease itself is volatile firmware state and is re-acquired once both
// arms are ready.
private boolean faceclawWakeLeaseEnabled;
private long lastFaceclawWakeLeaseQueuedAtMs;
private int faceclawWakeControlGeneration;
@@ -290,7 +291,8 @@ public class FaceclawBleCommunicator implements FaceclawBleListener, Runnable {
/**
* Acquire/renew or release CFW's volatile wake-takeover lease on both
* arms. Delivery (not a protocol ACK) is awaited so a caller can ensure
* the fail-open firmware policy is installed before suspending EvenHub.
* the fail-open firmware policy is installed before relying on wakeword
* interception or suspending EvenHub.
*/
public boolean setFaceclawWakeLeaseEnabled(boolean enabled) {
int generation;
+12 -1
View File
@@ -410,7 +410,14 @@ class DashboardController {
}
private desiredFaceclawWakeLeaseState(): boolean {
return suspendEvenHubWhenScreenOffSetting.get() && this.faceclawWakeLeaseSupported;
// The same firmware lease owns two stock wake paths: deferred dashboard
// launch while EvenHub is suspended, and suppression of the stock Even AI
// foreground app when Faceclaw handles the glasses wakeword. Without the
// latter, Even AI displaces EvenHub before our first wake frame can ACK.
return (
this.faceclawWakeLeaseSupported &&
(suspendEvenHubWhenScreenOffSetting.get() || wakeWordActionSetting.get() !== "off")
);
}
private async syncFaceclawWakeLease(
@@ -766,6 +773,10 @@ class DashboardController {
// A transport reconnect starts with a live EvenHub lifecycle again;
// if the shell is asleep, begin a fresh five-second grace period.
this.evenHubSessionSuspended = false;
// Firmware leases are volatile, and the Java transport may have been
// rebuilt underneath this long-lived controller. Do not let a cached
// TypeScript value suppress re-acquisition on the new session.
this.faceclawWakeLeaseState = null;
// Push the CFW firmware-debug-flags overlay preference; Java emits the
// mode-7 control message once the dashboard container is warmed up.
this.pushFirmwareDebugFlags();
+2 -2
View File
@@ -514,8 +514,8 @@ export class FaceclawCommunicatorBridge {
}
/**
* Own CFW's fail-open idle-wake policy while the experimental screen-off
* suspension mode is enabled. Returns after both arm writes complete.
* Own CFW's fail-open stock-wake policy while Faceclaw handles wakewords or
* suspends EvenHub with the screen off. Returns after both arm writes complete.
*/
async setFaceclawWakeLeaseEnabled(enabled: boolean): Promise<boolean> {
return this.enqueueJavaCall(() =>