Add a wake-lock when the G2 screen is on

This commit is contained in:
James Babcock committed 2026-07-03 13:03:03 -07:00
1 parent 6632ada3c3
commit 116e8891e7
4 files changed
+45

No files matched your search

+7
View File
@@ -13,6 +13,7 @@ import { voiceControlBridge } from "../native/voice-control";
import { G2_LENS_HEIGHT, G2_LENS_WIDTH, GrayImage } from "../graphics/image";
import {
applyDashboardScreenTimeout,
dashboardState,
drawDashboard,
noteDashboardPhoneTextInput,
openAndroidNotificationFromSleep,
@@ -561,9 +562,15 @@ class DashboardController {
this.updateDisplayPreviewFromImage(image);
}
if (this.communicator) {
if (dashboardState.screenOn) {
await this.communicator.setG2ScreenOn(true);
}
console.log("submitDashboardImage");
await this.communicator.submitDashboardImage(image.to8bppBuffer(), image.width, image.height, fingerprint, paintMs);
await this.communicator.waitForNextFrameMetrics(FRAME_TRANSMIT_BACKPRESSURE_TIMEOUT_MS);
if (!dashboardState.screenOn) {
await this.communicator.setG2ScreenOn(false);
}
if (updatePreviewAfterTransmit) {
await this.updateConnectedDisplayPreviewFromImage(image);
}
+4
View File
@@ -225,6 +225,10 @@ export class FaceclawCommunicatorBridge {
await this.enqueueJavaCall(() => this.communicator.start());
}
async setG2ScreenOn(screenOn: boolean): Promise<void> {
await this.enqueueJavaCall(() => this.communicator.setG2ScreenOn(Boolean(screenOn)));
}
async submitDashboardImage(image8bpp: Uint8Array, width: number, height: number, fingerprint: string, paintMs = -1): Promise<void> {
const snapshot = new Uint8Array(image8bpp);
await this.enqueueJavaCall(() => {