forked from Blendman974/faceclaw
Add experimental option to end EvenHub session when the screen is off for power saving
This commit is contained in:
1 parent
7455775390
commit
e5649e9782
8 files changed
+315
-12
No files matched your search
@@ -88,6 +88,18 @@ export type RawInputEvent =
|
||||
eventSource: number;
|
||||
systemExitReasonCode: number;
|
||||
frameId: number;
|
||||
}
|
||||
| {
|
||||
/**
|
||||
* Stock display-lifecycle wake observed after a ring or arm double tap
|
||||
* while Faceclaw's EvenHub page is suspended.
|
||||
*/
|
||||
kind: "display-wake";
|
||||
containerName: string;
|
||||
eventType: number;
|
||||
eventSource: number;
|
||||
systemExitReasonCode: number;
|
||||
frameId: number;
|
||||
};
|
||||
|
||||
function nonNegativeNumber(value: number): number {
|
||||
@@ -467,6 +479,22 @@ export class FaceclawCommunicatorBridge {
|
||||
return this.enqueueJavaCall(() => Boolean(this.communicator.sendShutdown(exitMode)));
|
||||
}
|
||||
|
||||
/**
|
||||
* End only the EvenHub page/session, leaving both arm BLE connections and
|
||||
* their async notification subscriptions alive.
|
||||
*/
|
||||
async suspendEvenHubSession(): Promise<boolean> {
|
||||
return this.enqueueJavaCall(() => Boolean(this.communicator.suspendEvenHubSession()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Re-enable the EvenHub page lifecycle. The retained compositor frame is
|
||||
* sent after the layout and image path have been recreated.
|
||||
*/
|
||||
async resumeEvenHubSession(): Promise<boolean> {
|
||||
return this.enqueueJavaCall(() => Boolean(this.communicator.resumeEvenHubSession()));
|
||||
}
|
||||
|
||||
/** Play a CFW mode-5 kind-4 tone sequence (complete wire payload). */
|
||||
async playBuzzerSequence(payload: Uint8Array): Promise<void> {
|
||||
const snapshot = new Uint8Array(payload);
|
||||
|
||||
Reference in new issue
Block a user