forked from Blendman974/faceclaw
Battery indicators and other places no longer say "G2" when a G1 or iO is paired
This commit is contained in:
1 parent
ac68ba5991
commit
e103b89510
21 files changed
+101
-46
No files matched your search
@@ -18,6 +18,7 @@ import {
|
|||||||
batteryIndicatorVisible,
|
batteryIndicatorVisible,
|
||||||
ConfigSettingBoolean,
|
ConfigSettingBoolean,
|
||||||
glassesBatteryVisibilitySetting,
|
glassesBatteryVisibilitySetting,
|
||||||
|
glassesModelName,
|
||||||
onAnySettingChanged,
|
onAnySettingChanged,
|
||||||
phoneBatteryVisibilitySetting,
|
phoneBatteryVisibilitySetting,
|
||||||
ringBatteryVisibilitySetting,
|
ringBatteryVisibilitySetting,
|
||||||
@@ -328,7 +329,7 @@ function collectBatteryItems(): BatteryItem[] {
|
|||||||
push(phoneBatteryVisibilitySetting.get(), "Phone", "phone", phone.battery, phone.charging);
|
push(phoneBatteryVisibilitySetting.get(), "Phone", "phone", phone.battery, phone.charging);
|
||||||
const levels = shell.getBatteryLevels();
|
const levels = shell.getBatteryLevels();
|
||||||
push(watchBatteryVisibilitySetting.get(), "Watch", "watch", levels.watch, levels.watchCharging);
|
push(watchBatteryVisibilitySetting.get(), "Watch", "watch", levels.watch, levels.watchCharging);
|
||||||
push(glassesBatteryVisibilitySetting.get(), "G2", "glasses", levels.headset, levels.headsetCharging);
|
push(glassesBatteryVisibilitySetting.get(), glassesModelName(), "glasses", levels.headset, levels.headsetCharging);
|
||||||
if (levels.ring !== null && Number.isInteger(levels.ring) && levels.ring >= 0 && levels.ring <= 100) {
|
if (levels.ring !== null && Number.isInteger(levels.ring) && levels.ring >= 0 && levels.ring <= 100) {
|
||||||
push(ringBatteryVisibilitySetting.get(), "R1", "ring", levels.ring, levels.ringCharging);
|
push(ringBatteryVisibilitySetting.get(), "R1", "ring", levels.ring, levels.ringCharging);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ import { loadPersistedOpenApps, savePersistedOpenApps } from "../ui/shell/open-a
|
|||||||
import { appViewportRect, isOnSwitcherEdge, screenHeight, screenWidth, sidebarStripVisible, type ScreenRect, type WindowHeightMode } from "../ui/shell/geometry";
|
import { appViewportRect, isOnSwitcherEdge, screenHeight, screenWidth, sidebarStripVisible, type ScreenRect, type WindowHeightMode } from "../ui/shell/geometry";
|
||||||
import { type ContinuousCaptureOptions, type LayerActions, type TextSettingsEditToggle, type TranscriptionChoice } from "../ui/layers";
|
import { type ContinuousCaptureOptions, type LayerActions, type TextSettingsEditToggle, type TranscriptionChoice } from "../ui/layers";
|
||||||
import { type KeyboardInputSession } from "../ui/shell/keyboard-input";
|
import { type KeyboardInputSession } from "../ui/shell/keyboard-input";
|
||||||
import { appSwitcherPositionSetting, glassesTypeSetting, statusBarPositionSetting, statusBarVisibilitySetting, windowBorderSetting, assistantAllowProactiveSetting, assistantBackendSetting, assistantBridgeHostSetting, assistantBridgePortSetting, assistantBridgeTokenSetting, getBrightnessPreferences, displayLayoutSetting, navigateDisplayLayoutSetting, terminalDisplayLayoutSetting, elevenLabsApiKeySetting, getStringSettingById, openAiApiKeySetting, nightscoutApiTokenSetting, firmwareDebugFlagsSetting, whisperServerApiKeySetting, whisperServerLanguageSetting, whisperServerModelSetting, whisperServerUrlSetting, lockScreenEnabledSetting, nightscoutSiteUrlSetting, onAnySettingChanged, previewColorSetting, effectiveRingConnectionMode, type RingConnectionMode, saveVoiceRecordingsSetting, sonioxApiKeySetting, screenTimeoutSetting, screenTimeoutSettingToMs, shouldPopUpNewNotification, suspendEvenHubWhenScreenOffSetting, voiceProviderSetting, wakeWordActionSetting, type ConfigSettingString } from "../ui/dashboard-settings";
|
import { appSwitcherPositionSetting, glassesModelName, glassesTypeSetting, statusBarPositionSetting, statusBarVisibilitySetting, windowBorderSetting, assistantAllowProactiveSetting, assistantBackendSetting, assistantBridgeHostSetting, assistantBridgePortSetting, assistantBridgeTokenSetting, getBrightnessPreferences, displayLayoutSetting, navigateDisplayLayoutSetting, terminalDisplayLayoutSetting, elevenLabsApiKeySetting, getStringSettingById, openAiApiKeySetting, nightscoutApiTokenSetting, firmwareDebugFlagsSetting, whisperServerApiKeySetting, whisperServerLanguageSetting, whisperServerModelSetting, whisperServerUrlSetting, lockScreenEnabledSetting, nightscoutSiteUrlSetting, onAnySettingChanged, previewColorSetting, effectiveRingConnectionMode, type RingConnectionMode, saveVoiceRecordingsSetting, sonioxApiKeySetting, screenTimeoutSetting, screenTimeoutSettingToMs, shouldPopUpNewNotification, suspendEvenHubWhenScreenOffSetting, voiceProviderSetting, wakeWordActionSetting, type ConfigSettingString } from "../ui/dashboard-settings";
|
||||||
import { isIgnoringBatteryOptimizations, requestIgnoreBatteryOptimizations } from "../native/battery-optimization";
|
import { isIgnoringBatteryOptimizations, requestIgnoreBatteryOptimizations } from "../native/battery-optimization";
|
||||||
import {
|
import {
|
||||||
getInstalledEvenHubAppById,
|
getInstalledEvenHubAppById,
|
||||||
@@ -1267,6 +1267,7 @@ class DashboardController {
|
|||||||
silentMode: this.silentMode,
|
silentMode: this.silentMode,
|
||||||
screenOn: shell.isScreenOn(),
|
screenOn: shell.isScreenOn(),
|
||||||
battery: this.lastHeadsetBattery,
|
battery: this.lastHeadsetBattery,
|
||||||
|
glassesModel: glassesModelName(),
|
||||||
caseBattery: batteries.case,
|
caseBattery: batteries.case,
|
||||||
caseCharging: batteries.caseCharging,
|
caseCharging: batteries.caseCharging,
|
||||||
foregroundTitle: shell.getForegroundApp()?.title ?? null,
|
foregroundTitle: shell.getForegroundApp()?.title ?? null,
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ export type GlassesDisplayState = {
|
|||||||
silentMode: boolean;
|
silentMode: boolean;
|
||||||
screenOn: boolean;
|
screenOn: boolean;
|
||||||
battery: number | null;
|
battery: number | null;
|
||||||
|
/** The paired glasses' model, e.g. "G2" (glassesModelName). */
|
||||||
|
glassesModel: string;
|
||||||
/**
|
/**
|
||||||
* The charging case's last-known level, and whether it is on USB (null
|
* The charging case's last-known level, and whether it is on USB (null
|
||||||
* while the glasses are out of the case). Shown only while charging, when
|
* while the glasses are out of the case). Shown only while charging, when
|
||||||
@@ -20,7 +22,7 @@ export function glassesDisplayLabel(state: GlassesDisplayState): string {
|
|||||||
// Charging wins over every session-local state: the glasses are in their
|
// Charging wins over every session-local state: the glasses are in their
|
||||||
// case, so neither the lock screen nor the foreground window is visible.
|
// case, so neither the lock screen nor the foreground window is visible.
|
||||||
if (state.phase === "charging") {
|
if (state.phase === "charging") {
|
||||||
return chargingDisplayLabel(state.battery);
|
return chargingDisplayLabel(state.battery, state.glassesModel);
|
||||||
}
|
}
|
||||||
// Preview mode has a live (simulated) screen despite the disconnected
|
// Preview mode has a live (simulated) screen despite the disconnected
|
||||||
// phase, so fall through to the screen-state/foreground labels.
|
// phase, so fall through to the screen-state/foreground labels.
|
||||||
@@ -63,8 +65,8 @@ export function glassesDisplayAsleep(state: GlassesDisplayState): boolean {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function chargingDisplayLabel(battery: number | null): string {
|
export function chargingDisplayLabel(battery: number | null, glassesModel: string): string {
|
||||||
return validBatteryLevel(battery) ? `Charging · G2 ${battery}%` : "Charging";
|
return validBatteryLevel(battery) ? `Charging: ${glassesModel} ${battery}%` : "Charging";
|
||||||
}
|
}
|
||||||
|
|
||||||
/** The shell's last-known battery levels (ShellChromeState["battery"]), as far as the phone shows them. */
|
/** The shell's last-known battery levels (ShellChromeState["battery"]), as far as the phone shows them. */
|
||||||
@@ -81,13 +83,13 @@ export type BatteryLevels = {
|
|||||||
* The phone Settings tab's battery row: each device whose level is known,
|
* The phone Settings tab's battery row: each device whose level is known,
|
||||||
* e.g. "G2 100% · Case 98% ⚡ · R1 72%" (⚡ = charging), or "" when none
|
* e.g. "G2 100% · Case 98% ⚡ · R1 72%" (⚡ = charging), or "" when none
|
||||||
* is. Levels are the last known ones (the case only reports while the glasses
|
* is. Levels are the last known ones (the case only reports while the glasses
|
||||||
* are docked), so ⚡ appears only while it is live: G2 and Case only with a
|
* are docked), so ⚡ appears only while it is live: the glasses and Case only
|
||||||
* link to the glasses (`glassesLinked`: connected or charging), and Case only
|
* with a link to the glasses (`glassesLinked`: connected or charging), and Case
|
||||||
* while they are docked (caseCharging is null otherwise).
|
* only while they are docked (caseCharging is null otherwise).
|
||||||
*/
|
*/
|
||||||
export function formatBatteryLine(levels: BatteryLevels, glassesLinked: boolean): string {
|
export function formatBatteryLine(levels: BatteryLevels, glassesLinked: boolean, glassesModel: string): string {
|
||||||
const devices: Array<[string, number | null, boolean | null]> = [
|
const devices: Array<[string, number | null, boolean | null]> = [
|
||||||
["G2", levels.headset, glassesLinked && levels.headsetCharging],
|
[glassesModel, levels.headset, glassesLinked && levels.headsetCharging],
|
||||||
["Case", levels.case, glassesLinked && levels.caseCharging],
|
["Case", levels.case, glassesLinked && levels.caseCharging],
|
||||||
["R1", levels.ring, levels.ringCharging],
|
["R1", levels.ring, levels.ringCharging],
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ import { type AppDefinition } from "../apps/app-definition";
|
|||||||
import { getInstalledEvenHubApps, installedEvenHubAppId } from "../apps/evenhub/installed-apps";
|
import { getInstalledEvenHubApps, installedEvenHubAppId } from "../apps/evenhub/installed-apps";
|
||||||
import { WEAR_PATHS, wearBridge, type WearMessage } from "../native/wear-bridge";
|
import { WEAR_PATHS, wearBridge, type WearMessage } from "../native/wear-bridge";
|
||||||
import {
|
import {
|
||||||
|
glassesModelName,
|
||||||
onAnySettingChanged,
|
onAnySettingChanged,
|
||||||
watchCanUnlockSetting,
|
watchCanUnlockSetting,
|
||||||
watchCrownClockwiseNextSetting,
|
watchCrownClockwiseNextSetting,
|
||||||
@@ -294,6 +295,7 @@ export class WearRemote {
|
|||||||
worn: state.glassesWorn,
|
worn: state.glassesWorn,
|
||||||
listening: voiceActivity.isActive(),
|
listening: voiceActivity.isActive(),
|
||||||
battery: state.lastHeadsetBattery,
|
battery: state.lastHeadsetBattery,
|
||||||
|
glassesModel: glassesModelName(),
|
||||||
charging: state.phase === "charging" || battery.headsetCharging === true,
|
charging: state.phase === "charging" || battery.headsetCharging === true,
|
||||||
caseBattery: battery.case,
|
caseBattery: battery.case,
|
||||||
caseCharging: battery.caseCharging,
|
caseCharging: battery.caseCharging,
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { IosPreviewController } from '../g2/ios-preview-controller'
|
|||||||
import { PhoneGestureRecognizer } from './phone-gestures'
|
import { PhoneGestureRecognizer } from './phone-gestures'
|
||||||
import { BleBandwidthMeter } from './ble-bandwidth-meter'
|
import { BleBandwidthMeter } from './ble-bandwidth-meter'
|
||||||
import { sampleBleTraffic } from '../native/ble-traffic'
|
import { sampleBleTraffic } from '../native/ble-traffic'
|
||||||
import { onAnySettingChanged, mirrorTouchSetting, showBleBandwidthSetting } from '../ui/dashboard-settings'
|
import { glassesModelName, onAnySettingChanged, mirrorTouchSetting, showBleBandwidthSetting } from '../ui/dashboard-settings'
|
||||||
import { loadDeviceAddresses } from '../g2/device-addresses'
|
import { loadDeviceAddresses } from '../g2/device-addresses'
|
||||||
import { deviceAddressError } from '../g2/ios-peripheral-identity'
|
import { deviceAddressError } from '../g2/ios-peripheral-identity'
|
||||||
import { formatBatteryLine } from '../g2/glasses-display-state'
|
import { formatBatteryLine } from '../g2/glasses-display-state'
|
||||||
@@ -75,7 +75,7 @@ export function createMainPage(): Page {
|
|||||||
// The Settings tab's battery row. iOS reports charging sessions as
|
// The Settings tab's battery row. iOS reports charging sessions as
|
||||||
// connected, so "connected" is the whole live-link condition here.
|
// connected, so "connected" is the whole live-link condition here.
|
||||||
let glassesLinked = false
|
let glassesLinked = false
|
||||||
const refreshBatteryLine = () => { model.batteryLine = formatBatteryLine(shell.getBatteryLevels(), glassesLinked) }
|
const refreshBatteryLine = () => { model.batteryLine = formatBatteryLine(shell.getBatteryLevels(), glassesLinked, glassesModelName()) }
|
||||||
const keyboardField = () => keyboardPanel.getViewById<TextView>('keyboardInputField')
|
const keyboardField = () => keyboardPanel.getViewById<TextView>('keyboardInputField')
|
||||||
const controller = new IosPreviewController((image, label) => {
|
const controller = new IosPreviewController((image, label) => {
|
||||||
mirror.imageSource = image; model.set('padFocusLine', label)
|
mirror.imageSource = image; model.set('padFocusLine', label)
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import {
|
|||||||
import { dashboardController, type MirrorTouchKind } from "../g2/dashboard-controller";
|
import { dashboardController, type MirrorTouchKind } from "../g2/dashboard-controller";
|
||||||
import { formatBatteryLine } from "../g2/glasses-display-state";
|
import { formatBatteryLine } from "../g2/glasses-display-state";
|
||||||
import {
|
import {
|
||||||
|
glassesModelName,
|
||||||
mirrorTouchSetting,
|
mirrorTouchSetting,
|
||||||
onAnySettingChanged,
|
onAnySettingChanged,
|
||||||
showBleBandwidthSetting,
|
showBleBandwidthSetting,
|
||||||
@@ -97,6 +98,7 @@ export class MainViewModel extends RemoteControlsViewModel {
|
|||||||
this.batteryLine = formatBatteryLine(
|
this.batteryLine = formatBatteryLine(
|
||||||
snapshot.batteries,
|
snapshot.batteries,
|
||||||
snapshot.phase === "connected" || snapshot.phase === "charging",
|
snapshot.phase === "connected" || snapshot.phase === "charging",
|
||||||
|
glassesModelName(),
|
||||||
);
|
);
|
||||||
this.activeTextSettingId = snapshot.activeTextSettingId;
|
this.activeTextSettingId = snapshot.activeTextSettingId;
|
||||||
this.activeTextEditorTitle = snapshot.activeTextEditorTitle;
|
this.activeTextEditorTitle = snapshot.activeTextEditorTitle;
|
||||||
|
|||||||
@@ -293,7 +293,7 @@ export class PairingViewModel extends Observable {
|
|||||||
}
|
}
|
||||||
if (this.selectedPair) {
|
if (this.selectedPair) {
|
||||||
const identity = this.selectedPair.identity;
|
const identity = this.selectedPair.identity;
|
||||||
const label = identity ? identity.displayName : "Even Realities G2";
|
const label = identity ? identity.displayName : this.selectedPair.g1Firmware ? "Even Realities G1" : "Even Realities G2";
|
||||||
parts.push(
|
parts.push(
|
||||||
`${label} · serial ${this.selectedPair.serial ?? "unknown"}\n` +
|
`${label} · serial ${this.selectedPair.serial ?? "unknown"}\n` +
|
||||||
`Left ${this.selectedPair.left?.address ?? "?"} · Right ${this.selectedPair.right?.address ?? "?"}`,
|
`Left ${this.selectedPair.left?.address ?? "?"} · Right ${this.selectedPair.right?.address ?? "?"}`,
|
||||||
|
|||||||
@@ -116,7 +116,7 @@
|
|||||||
color: #6a6a6a;
|
color: #6a6a6a;
|
||||||
margin-top: 4;
|
margin-top: 4;
|
||||||
}
|
}
|
||||||
/* The charging case's level under "Charging · G2 n%". */
|
/* The charging case's level under "Charging: G2 n%". */
|
||||||
.pad-detail {
|
.pad-detail {
|
||||||
font-size: 15;
|
font-size: 15;
|
||||||
color: #b0b0b0;
|
color: #b0b0b0;
|
||||||
|
|||||||
@@ -313,7 +313,7 @@ export const phoneBatteryVisibilitySetting = batteryVisibilitySetting(
|
|||||||
"phoneBatteryVisibility", "Phone", "display.battery.phoneVisibility",
|
"phoneBatteryVisibility", "Phone", "display.battery.phoneVisibility",
|
||||||
);
|
);
|
||||||
export const glassesBatteryVisibilitySetting = batteryVisibilitySetting(
|
export const glassesBatteryVisibilitySetting = batteryVisibilitySetting(
|
||||||
"glassesBatteryVisibility", "G2", "display.battery.glassesVisibility",
|
"glassesBatteryVisibility", "Glasses", "display.battery.glassesVisibility",
|
||||||
);
|
);
|
||||||
export const ringBatteryVisibilitySetting = batteryVisibilitySetting(
|
export const ringBatteryVisibilitySetting = batteryVisibilitySetting(
|
||||||
"ringBatteryVisibility", "R1", "display.battery.ringVisibility",
|
"ringBatteryVisibility", "R1", "display.battery.ringVisibility",
|
||||||
@@ -408,6 +408,13 @@ export function glassesHaveCompass(): boolean {
|
|||||||
return glassesTypeSetting.get() === "g2";
|
return glassesTypeSetting.get() === "g2";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const GLASSES_MODEL_NAMES: Record<GlassesType, string> = { g2: "G2", g1: "G1", "rayneo-io": "iO" };
|
||||||
|
|
||||||
|
/** The paired glasses' model without the brand, short enough for battery labels and a watch's one-line charging status. */
|
||||||
|
export function glassesModelName(): string {
|
||||||
|
return GLASSES_MODEL_NAMES[glassesTypeSetting.get()];
|
||||||
|
}
|
||||||
|
|
||||||
const APP_SWITCHER_POSITION_LABELS: Record<AppSwitcherPosition, string> = {
|
const APP_SWITCHER_POSITION_LABELS: Record<AppSwitcherPosition, string> = {
|
||||||
left: "Left",
|
left: "Left",
|
||||||
right: "Right",
|
right: "Right",
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ import {
|
|||||||
dataCollectionSetting,
|
dataCollectionSetting,
|
||||||
distanceUnitSetting,
|
distanceUnitSetting,
|
||||||
glassesBatteryVisibilitySetting,
|
glassesBatteryVisibilitySetting,
|
||||||
|
glassesModelName,
|
||||||
phoneBatteryVisibilitySetting,
|
phoneBatteryVisibilitySetting,
|
||||||
ringBatteryVisibilitySetting,
|
ringBatteryVisibilitySetting,
|
||||||
watchBatteryVisibilitySetting,
|
watchBatteryVisibilitySetting,
|
||||||
@@ -387,7 +388,8 @@ function batteryIndicatorsMenuItem(): MenuItem {
|
|||||||
enumSettingMenuItem(batteryDisplayModeSetting),
|
enumSettingMenuItem(batteryDisplayModeSetting),
|
||||||
enumSettingMenuItem(phoneBatteryVisibilitySetting),
|
enumSettingMenuItem(phoneBatteryVisibilitySetting),
|
||||||
enumSettingMenuItem(watchBatteryVisibilitySetting),
|
enumSettingMenuItem(watchBatteryVisibilitySetting),
|
||||||
enumSettingMenuItem(glassesBatteryVisibilitySetting),
|
// Named as the top bar names this indicator.
|
||||||
|
enumSettingMenuItem(glassesBatteryVisibilitySetting, { label: glassesModelName() }),
|
||||||
enumSettingMenuItem(ringBatteryVisibilitySetting),
|
enumSettingMenuItem(ringBatteryVisibilitySetting),
|
||||||
]);
|
]);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import {
|
|||||||
batteryDisplayModeSetting,
|
batteryDisplayModeSetting,
|
||||||
batteryIndicatorVisible,
|
batteryIndicatorVisible,
|
||||||
glassesBatteryVisibilitySetting,
|
glassesBatteryVisibilitySetting,
|
||||||
|
glassesModelName,
|
||||||
phoneBatteryVisibilitySetting,
|
phoneBatteryVisibilitySetting,
|
||||||
ringBatteryVisibilitySetting,
|
ringBatteryVisibilitySetting,
|
||||||
watchBatteryVisibilitySetting,
|
watchBatteryVisibilitySetting,
|
||||||
@@ -1089,7 +1090,7 @@ function batteryItems(state: ShellChromeState): BatteryItem[] {
|
|||||||
Boolean(state.battery.watchCharging));
|
Boolean(state.battery.watchCharging));
|
||||||
}
|
}
|
||||||
if (state.battery.headset !== null && Number.isFinite(state.battery.headset)) {
|
if (state.battery.headset !== null && Number.isFinite(state.battery.headset)) {
|
||||||
pushBatteryItem(items, glassesBatteryVisibilitySetting.get(), "G2", "glasses", state.battery.headset,
|
pushBatteryItem(items, glassesBatteryVisibilitySetting.get(), glassesModelName(), "glasses", state.battery.headset,
|
||||||
Boolean(state.battery.headsetCharging));
|
Boolean(state.battery.headsetCharging));
|
||||||
}
|
}
|
||||||
if (state.battery.ring !== null && Number.isInteger(state.battery.ring)
|
if (state.battery.ring !== null && Number.isInteger(state.battery.ring)
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ func padLine(state: PhoneState?, link: LinkStatus) -> StatusLine {
|
|||||||
if !state.remoteEnabled { return StatusLine(text: "Watch control off", tone: .problem) }
|
if !state.remoteEnabled { return StatusLine(text: "Watch control off", tone: .problem) }
|
||||||
if state.connected {
|
if state.connected {
|
||||||
if state.charging || state.phase == "charging" {
|
if state.charging || state.phase == "charging" {
|
||||||
return StatusLine(text: chargingLine(state.battery), tone: .busy, detail: caseLine(state))
|
return StatusLine(text: chargingLine(state), tone: .busy, detail: caseLine(state))
|
||||||
}
|
}
|
||||||
if state.silentMode { return StatusLine(text: "Silent mode", tone: .off) }
|
if state.silentMode { return StatusLine(text: "Silent mode", tone: .off) }
|
||||||
if state.locked { return StatusLine(text: "Locked", tone: .off) }
|
if state.locked { return StatusLine(text: "Locked", tone: .off) }
|
||||||
@@ -64,8 +64,8 @@ func padLine(state: PhoneState?, link: LinkStatus) -> StatusLine {
|
|||||||
return StatusLine(text: "Disconnected", tone: .off)
|
return StatusLine(text: "Disconnected", tone: .off)
|
||||||
}
|
}
|
||||||
|
|
||||||
private func chargingLine(_ battery: Int?) -> String {
|
private func chargingLine(_ state: PhoneState) -> String {
|
||||||
battery.map { "Charging · G2 \($0)%" } ?? "Charging"
|
state.battery.map { "Charging: \(state.glassesModel) \($0)%" } ?? "Charging"
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -103,8 +103,10 @@ struct PhoneState: Equatable {
|
|||||||
var locked = false
|
var locked = false
|
||||||
var worn: Bool?
|
var worn: Bool?
|
||||||
var listening = false
|
var listening = false
|
||||||
/** Current or last-known G2 charge percentage. */
|
/** The glasses' current or last-known charge percentage. */
|
||||||
var battery: Int?
|
var battery: Int?
|
||||||
|
/** The paired glasses' model, as the charging line names it. */
|
||||||
|
var glassesModel = "G2"
|
||||||
var charging = false
|
var charging = false
|
||||||
/** Last-known charging-case percentage; live only while the glasses are docked. */
|
/** Last-known charging-case percentage; live only while the glasses are docked. */
|
||||||
var caseBattery: Int?
|
var caseBattery: Int?
|
||||||
@@ -139,6 +141,7 @@ struct PhoneState: Equatable {
|
|||||||
state.worn = o["worn"] as? Bool
|
state.worn = o["worn"] as? Bool
|
||||||
state.listening = o["listening"] as? Bool ?? false
|
state.listening = o["listening"] as? Bool ?? false
|
||||||
state.battery = percent(o["battery"])
|
state.battery = percent(o["battery"])
|
||||||
|
state.glassesModel = o["glassesModel"] as? String ?? "G2"
|
||||||
state.charging = o["charging"] as? Bool ?? false
|
state.charging = o["charging"] as? Bool ?? false
|
||||||
state.caseBattery = percent(o["caseBattery"])
|
state.caseBattery = percent(o["caseBattery"])
|
||||||
state.caseCharging = o["caseCharging"] as? Bool
|
state.caseCharging = o["caseCharging"] as? Bool
|
||||||
|
|||||||
@@ -429,8 +429,9 @@ const shellScene = require('../.test-build/app/graphics/shell-scene.js');
|
|||||||
const displayList = require('../.test-build/app/graphics/display-list.js');
|
const displayList = require('../.test-build/app/graphics/display-list.js');
|
||||||
const notificationTypes = require('../.test-build/app/native/notification-types.js');
|
const notificationTypes = require('../.test-build/app/native/notification-types.js');
|
||||||
const ICON = notificationTypes.NOTIFICATION_ICON_SIZE;
|
const ICON = notificationTypes.NOTIFICATION_ICON_SIZE;
|
||||||
function chromeLayer(g, { notifications = 0, phoneBattery = null, windows = 1, trayIcons = [] } = {}) {
|
function chromeLayer(g, { notifications = 0, phoneBattery = null, windows = 1, trayIcons = [], glassesModel = 'G2' } = {}) {
|
||||||
const font = { lineHeight: 12, ascent: 10, measureText: (text) => text.length * 4,
|
const measuredText = [];
|
||||||
|
const font = { lineHeight: 12, ascent: 10, measureText: (text) => { measuredText.push(text); return text.length * 4; },
|
||||||
drawText: (image, x, y, text, value) => { for (let i = 0; i < text.length; i++) image.fillRect(x + i * 4, y + 2, 2, 6, value); } };
|
drawText: (image, x, y, text, value) => { for (let i = 0; i < text.length; i++) image.fillRect(x + i * 4, y + 2, 2, 6, value); } };
|
||||||
let nextKey = 100;
|
let nextKey = 100;
|
||||||
const requested = [];
|
const requested = [];
|
||||||
@@ -451,7 +452,7 @@ function chromeLayer(g, { notifications = 0, phoneBattery = null, windows = 1, t
|
|||||||
'../../native/phone-battery': { readPhoneBatteryState: () => ({ battery: phoneBattery, charging: false }) },
|
'../../native/phone-battery': { readPhoneBatteryState: () => ({ battery: phoneBattery, charging: false }) },
|
||||||
'../../util/render-freshness': { renderPassAllowsStaleData: () => false },
|
'../../util/render-freshness': { renderPassAllowsStaleData: () => false },
|
||||||
'../dashboard-settings': { batteryDisplayModeSetting: { get: () => 'icon' }, phoneBatteryVisibilitySetting: settings,
|
'../dashboard-settings': { batteryDisplayModeSetting: { get: () => 'icon' }, phoneBatteryVisibilitySetting: settings,
|
||||||
batteryIndicatorVisible: () => true },
|
glassesBatteryVisibilitySetting: settings, glassesModelName: () => glassesModel, batteryIndicatorVisible: () => true },
|
||||||
'../clock-format': { formatClockDate: () => 'Thu Oct 2', formatClockTime: () => '9:41' },
|
'../clock-format': { formatClockDate: () => 'Thu Oct 2', formatClockTime: () => '9:41' },
|
||||||
'../layers': { LayerStack: { allocateShellKey: () => nextKey++ } },
|
'../layers': { LayerStack: { allocateShellKey: () => nextKey++ } },
|
||||||
// As in menu.ts.
|
// As in menu.ts.
|
||||||
@@ -469,11 +470,19 @@ function chromeLayer(g, { notifications = 0, phoneBattery = null, windows = 1, t
|
|||||||
};
|
};
|
||||||
let heightChanges = 0;
|
let heightChanges = 0;
|
||||||
const chrome = new context.exports.ShellChromeLayer(() => state, () => heightChanges++);
|
const chrome = new context.exports.ShellChromeLayer(() => state, () => heightChanges++);
|
||||||
return { chrome, state, requested, planBottomBar: context.exports.planBottomBar, heightChanges: () => heightChanges };
|
return { chrome, state, requested, measuredText, planBottomBar: context.exports.planBottomBar, heightChanges: () => heightChanges };
|
||||||
}
|
}
|
||||||
const notification = (key) => ({ kind: 'notification', key });
|
const notification = (key) => ({ kind: 'notification', key });
|
||||||
const keysOf = (items) => Array.from(items, (item) => item.key);
|
const keysOf = (items) => Array.from(items, (item) => item.key);
|
||||||
|
|
||||||
|
test('the top bar labels the glasses battery with the paired model', () => {
|
||||||
|
const { chrome, state, measuredText } = chromeLayer(geometry(), { glassesModel: 'G1' });
|
||||||
|
state.battery.headset = 72;
|
||||||
|
chrome.paintParts();
|
||||||
|
assert.ok(measuredText.includes('G1'));
|
||||||
|
assert.ok(!measuredText.includes('G2'));
|
||||||
|
});
|
||||||
|
|
||||||
test('a bottom app switcher frames the foreground window\'s content in a rounded border', () => {
|
test('a bottom app switcher frames the foreground window\'s content in a rounded border', () => {
|
||||||
const g = geometry();
|
const g = geometry();
|
||||||
g.settings.appSwitcherPositionSetting.value = 'bottom';
|
g.settings.appSwitcherPositionSetting.value = 'bottom';
|
||||||
|
|||||||
@@ -35,6 +35,14 @@ test('the display mode starts as the middle band, or carries over the old mode a
|
|||||||
assert.equal(api.displayLayoutSetting.get(), 'band-bottom');
|
assert.equal(api.displayLayoutSetting.get(), 'band-bottom');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('the glasses model name follows the paired glasses type', () => {
|
||||||
|
const model = (entries) => settingsFixture(new Map(entries)).glassesModelName();
|
||||||
|
assert.equal(model([]), 'G2');
|
||||||
|
assert.equal(model([['deviceType', 'g2']]), 'G2');
|
||||||
|
assert.equal(model([['deviceType', 'g1']]), 'G1');
|
||||||
|
assert.equal(model([['deviceType', 'rayneo-io']]), 'iO');
|
||||||
|
});
|
||||||
|
|
||||||
test('per-app display modes carry over their old mode and position where the merged values can say it', () => {
|
test('per-app display modes carry over their old mode and position where the merged values can say it', () => {
|
||||||
const app = (appId, entries) => settingsFixture(new Map(entries))[`${appId}DisplayLayoutSetting`].get();
|
const app = (appId, entries) => settingsFixture(new Map(entries))[`${appId}DisplayLayoutSetting`].get();
|
||||||
assert.equal(app('navigate', []), 'global');
|
assert.equal(app('navigate', []), 'global');
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ const connected = {
|
|||||||
silentMode: false,
|
silentMode: false,
|
||||||
screenOn: true,
|
screenOn: true,
|
||||||
battery: 72,
|
battery: 72,
|
||||||
|
glassesModel: "G2",
|
||||||
caseBattery: null,
|
caseBattery: null,
|
||||||
caseCharging: null,
|
caseCharging: null,
|
||||||
foregroundTitle: "Music",
|
foregroundTitle: "Music",
|
||||||
@@ -37,22 +38,23 @@ test("only the Display off state counts as asleep (the watch face's wake hint)",
|
|||||||
assert.equal(glassesDisplayAsleep({ ...connected, phase: "disconnected", screenOn: false }), false);
|
assert.equal(glassesDisplayAsleep({ ...connected, phase: "disconnected", screenOn: false }), false);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("charging takes precedence and includes the last-known G2 battery", () => {
|
test("charging takes precedence and includes the glasses' model and last-known battery", () => {
|
||||||
assert.equal(
|
assert.equal(
|
||||||
glassesDisplayLabel({ ...connected, phase: "charging", silentMode: true, screenOn: false }),
|
glassesDisplayLabel({ ...connected, phase: "charging", silentMode: true, screenOn: false }),
|
||||||
"Charging · G2 72%",
|
"Charging: G2 72%",
|
||||||
);
|
);
|
||||||
assert.equal(chargingDisplayLabel(null), "Charging");
|
assert.equal(glassesDisplayLabel({ ...connected, phase: "charging", glassesModel: "G1" }), "Charging: G1 72%");
|
||||||
assert.equal(chargingDisplayLabel(-1), "Charging");
|
assert.equal(chargingDisplayLabel(null, "G2"), "Charging");
|
||||||
assert.equal(chargingDisplayLabel(101), "Charging");
|
assert.equal(chargingDisplayLabel(-1, "G2"), "Charging");
|
||||||
|
assert.equal(chargingDisplayLabel(101, "G2"), "Charging");
|
||||||
});
|
});
|
||||||
|
|
||||||
test("while charging, the case level is the watch face's second line and joins the mirror's message", () => {
|
test("while charging, the case level is the watch face's second line and joins the mirror's message", () => {
|
||||||
const charging = { ...connected, phase: "charging", caseBattery: 64, caseCharging: false };
|
const charging = { ...connected, phase: "charging", caseBattery: 64, caseCharging: false };
|
||||||
assert.equal(glassesDisplayLabel(charging), "Charging · G2 72%");
|
assert.equal(glassesDisplayLabel(charging), "Charging: G2 72%");
|
||||||
assert.equal(glassesDisplayDetail(charging), "Case 64%");
|
assert.equal(glassesDisplayDetail(charging), "Case 64%");
|
||||||
assert.equal(glassesDisplayDetail({ ...charging, caseCharging: true }), "Case 64% ⚡");
|
assert.equal(glassesDisplayDetail({ ...charging, caseCharging: true }), "Case 64% ⚡");
|
||||||
assert.equal(chargingPreviewMessage(charging), "Charging · G2 72% · Case 64%");
|
assert.equal(chargingPreviewMessage(charging), "Charging: G2 72% · Case 64%");
|
||||||
// No case level yet: the label alone.
|
// No case level yet: the label alone.
|
||||||
assert.equal(glassesDisplayDetail({ ...charging, caseBattery: null }), "");
|
assert.equal(glassesDisplayDetail({ ...charging, caseBattery: null }), "");
|
||||||
assert.equal(chargingPreviewMessage({ ...charging, caseBattery: null, battery: null }), "Charging");
|
assert.equal(chargingPreviewMessage({ ...charging, caseBattery: null, battery: null }), "Charging");
|
||||||
@@ -65,14 +67,19 @@ const levels = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
test("the Settings battery line lists each known level, with ⚡ only while the reading is live", () => {
|
test("the Settings battery line lists each known level, with ⚡ only while the reading is live", () => {
|
||||||
assert.equal(formatBatteryLine(levels, true), "G2 87% ⚡ · Case 64% ⚡ · R1 72%");
|
assert.equal(formatBatteryLine(levels, true, "G2"), "G2 87% ⚡ · Case 64% ⚡ · R1 72%");
|
||||||
// Without a link to the glasses their charging state and the case's are stale.
|
// Without a link to the glasses their charging state and the case's are stale.
|
||||||
assert.equal(formatBatteryLine({ ...levels, ringCharging: true }, false), "G2 87% · Case 64% · R1 72% ⚡");
|
assert.equal(formatBatteryLine({ ...levels, ringCharging: true }, false, "G2"), "G2 87% · Case 64% · R1 72% ⚡");
|
||||||
// caseCharging is null while the glasses are out of the case.
|
// caseCharging is null while the glasses are out of the case.
|
||||||
assert.equal(formatBatteryLine({ ...levels, caseCharging: null }, true), "G2 87% ⚡ · Case 64% · R1 72%");
|
assert.equal(formatBatteryLine({ ...levels, caseCharging: null }, true, "G2"), "G2 87% ⚡ · Case 64% · R1 72%");
|
||||||
assert.equal(formatBatteryLine({ ...levels, case: null, ring: null }, true), "G2 87% ⚡");
|
assert.equal(formatBatteryLine({ ...levels, case: null, ring: null }, true, "G2"), "G2 87% ⚡");
|
||||||
assert.equal(
|
assert.equal(
|
||||||
formatBatteryLine({ headset: null, headsetCharging: null, case: null, caseCharging: null, ring: null, ringCharging: null }, true),
|
formatBatteryLine({ headset: null, headsetCharging: null, case: null, caseCharging: null, ring: null, ringCharging: null }, true, "G2"),
|
||||||
"",
|
"",
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("the Settings battery line names the paired glasses", () => {
|
||||||
|
assert.equal(formatBatteryLine({ ...levels, case: null, ring: null }, true, "G1"), "G1 87% ⚡");
|
||||||
|
assert.equal(formatBatteryLine({ ...levels, case: null, ring: null }, true, "iO"), "iO 87% ⚡");
|
||||||
|
});
|
||||||
@@ -212,7 +212,7 @@ test('iOS bandwidth footer toggles live, polls only in foreground and resets its
|
|||||||
'./phone-gestures': { PhoneGestureRecognizer: class { cancel() {} } },
|
'./phone-gestures': { PhoneGestureRecognizer: class { cancel() {} } },
|
||||||
'./ble-bandwidth-meter': require('../.test-build/app/phone-ui/ble-bandwidth-meter.js'),
|
'./ble-bandwidth-meter': require('../.test-build/app/phone-ui/ble-bandwidth-meter.js'),
|
||||||
'../native/ble-traffic': { sampleBleTraffic: () => totals },
|
'../native/ble-traffic': { sampleBleTraffic: () => totals },
|
||||||
'../ui/dashboard-settings': { brightnessSetting: { get: () => 'auto' }, displayLayoutSetting: { displayValue: () => 'Tall' }, showBleBandwidthSetting: { get: () => enabled },
|
'../ui/dashboard-settings': { brightnessSetting: { get: () => 'auto' }, displayLayoutSetting: { displayValue: () => 'Tall' }, showBleBandwidthSetting: { get: () => enabled }, glassesModelName: () => 'G2',
|
||||||
onAnySettingChanged: fn => { settingListeners.add(fn); return () => settingListeners.delete(fn); } },
|
onAnySettingChanged: fn => { settingListeners.add(fn); return () => settingListeners.delete(fn); } },
|
||||||
'../g2/device-addresses': { loadDeviceAddresses: () => ({}) },
|
'../g2/device-addresses': { loadDeviceAddresses: () => ({}) },
|
||||||
'../g2/ios-peripheral-identity': { deviceAddressError: () => 'no test devices' },
|
'../g2/ios-peripheral-identity': { deviceAddressError: () => 'no test devices' },
|
||||||
|
|||||||
@@ -125,6 +125,7 @@ function loadRemote({ phase = 'disconnected', preview = false, now = 1_800_000_0
|
|||||||
'../apps/evenhub/installed-apps': { getInstalledEvenHubApps: () => [], installedEvenHubAppId: id => id },
|
'../apps/evenhub/installed-apps': { getInstalledEvenHubApps: () => [], installedEvenHubAppId: id => id },
|
||||||
'../native/wear-bridge': { wearBridge: bridge, WEAR_PATHS: types().WEAR_PATHS },
|
'../native/wear-bridge': { wearBridge: bridge, WEAR_PATHS: types().WEAR_PATHS },
|
||||||
'../ui/dashboard-settings': {
|
'../ui/dashboard-settings': {
|
||||||
|
glassesModelName: () => 'G1',
|
||||||
onAnySettingChanged() {}, watchCanUnlockSetting: setting(true), watchCrownClockwiseNextSetting: setting(false),
|
onAnySettingChanged() {}, watchCanUnlockSetting: setting(true), watchCrownClockwiseNextSetting: setting(false),
|
||||||
watchMirrorAssistantSetting: setting(true), watchRemoteEnabledSetting: setting(true),
|
watchMirrorAssistantSetting: setting(true), watchRemoteEnabledSetting: setting(true),
|
||||||
watchVibrateOnInputSetting: setting(true), watchSoundEffectsSetting: setting(false),
|
watchVibrateOnInputSetting: setting(true), watchSoundEffectsSetting: setting(false),
|
||||||
@@ -214,6 +215,10 @@ test('the mirrored state carries the Apple Watch feedback settings', () => {
|
|||||||
assert.equal(state.soundEffects, false);
|
assert.equal(state.soundEffects, false);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('the mirrored state names the glasses for the charging line', () => {
|
||||||
|
assert.equal(loadRemote({ phase: 'charging' }).remote.buildState().glassesModel, 'G1');
|
||||||
|
});
|
||||||
|
|
||||||
test('the mirrored state says when gestures are landing on the preview', () => {
|
test('the mirrored state says when gestures are landing on the preview', () => {
|
||||||
const state = loadRemote({ preview: true }).remote.buildState();
|
const state = loadRemote({ preview: true }).remote.buildState();
|
||||||
assert.equal(state.preview, true);
|
assert.equal(state.preview, true);
|
||||||
|
|||||||
+6
-4
@@ -62,7 +62,7 @@ dashboard state, re-sent whenever it changes (and at least every 30 s):
|
|||||||
"protocol": 1, "version": "…",
|
"protocol": 1, "version": "…",
|
||||||
"phase": "connected", "status": "…", "connected": true, "preview": false,
|
"phase": "connected", "status": "…", "connected": true, "preview": false,
|
||||||
"screenOn": true, "locked": false, "worn": true, "listening": false,
|
"screenOn": true, "locked": false, "worn": true, "listening": false,
|
||||||
"battery": 78, "charging": false, "silentMode": false,
|
"battery": 78, "glassesModel": "G2", "charging": false, "silentMode": false,
|
||||||
"caseBattery": 64, "caseCharging": true,
|
"caseBattery": 64, "caseCharging": true,
|
||||||
"foreground": {"appId": "music", "title": "Music"},
|
"foreground": {"appId": "music", "title": "Music"},
|
||||||
"windows": [{"windowId": "…", "title": "…", "appId": "…", "focused": true, "closeable": true, "acceptsText": false}],
|
"windows": [{"windowId": "…", "title": "…", "appId": "…", "focused": true, "closeable": true, "acceptsText": false}],
|
||||||
@@ -74,9 +74,11 @@ dashboard state, re-sent whenever it changes (and at least every 30 s):
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
`battery` is the current or last-known G2 percentage. `charging` and
|
`battery` is the glasses' current or last-known percentage, and `glassesModel`
|
||||||
`silentMode` identify the two states in which the glasses display is not
|
is what the charging line calls them: `G2`, `G1` or `iO` (a watch treats a
|
||||||
visible even though the BLE session remains available.
|
missing one, from an older phone app, as `G2`). `charging` and `silentMode`
|
||||||
|
identify the two states in which the glasses display is not visible even though
|
||||||
|
the BLE session remains available.
|
||||||
|
|
||||||
`caseBattery` is the last-known charging-case percentage, or null until the
|
`caseBattery` is the last-known charging-case percentage, or null until the
|
||||||
glasses have reported one; the case only reports while the glasses are docked,
|
glasses have reported one; the case only reports while the glasses are docked,
|
||||||
|
|||||||
@@ -92,8 +92,10 @@ data class PhoneState(
|
|||||||
val locked: Boolean,
|
val locked: Boolean,
|
||||||
val worn: Boolean?,
|
val worn: Boolean?,
|
||||||
val listening: Boolean,
|
val listening: Boolean,
|
||||||
/** Current or last-known G2 charge percentage. */
|
/** The glasses' current or last-known charge percentage. */
|
||||||
val battery: Int?,
|
val battery: Int?,
|
||||||
|
/** The paired glasses' model, as the charging line names it. */
|
||||||
|
val glassesModel: String,
|
||||||
val charging: Boolean,
|
val charging: Boolean,
|
||||||
/** Last-known charging-case percentage; live only while the glasses are docked. */
|
/** Last-known charging-case percentage; live only while the glasses are docked. */
|
||||||
val caseBattery: Int?,
|
val caseBattery: Int?,
|
||||||
@@ -126,6 +128,7 @@ data class PhoneState(
|
|||||||
worn = if (o.isNull("worn")) null else o.optBoolean("worn"),
|
worn = if (o.isNull("worn")) null else o.optBoolean("worn"),
|
||||||
listening = o.optBoolean("listening", false),
|
listening = o.optBoolean("listening", false),
|
||||||
battery = if (o.isNull("battery")) null else o.optInt("battery", -1).takeIf { it in 0..100 },
|
battery = if (o.isNull("battery")) null else o.optInt("battery", -1).takeIf { it in 0..100 },
|
||||||
|
glassesModel = o.optString("glassesModel", "G2"),
|
||||||
charging = o.optBoolean("charging", false),
|
charging = o.optBoolean("charging", false),
|
||||||
caseBattery = if (o.isNull("caseBattery")) null else o.optInt("caseBattery", -1).takeIf { it in 0..100 },
|
caseBattery = if (o.isNull("caseBattery")) null else o.optInt("caseBattery", -1).takeIf { it in 0..100 },
|
||||||
caseCharging = if (o.isNull("caseCharging")) null else o.optBoolean("caseCharging"),
|
caseCharging = if (o.isNull("caseCharging")) null else o.optBoolean("caseCharging"),
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ fun padLine(state: PhoneState?, link: LinkStatus): StatusLine = when {
|
|||||||
state.remoteEnabled == false -> StatusLine("Watch control off", StatusTone.PROBLEM)
|
state.remoteEnabled == false -> StatusLine("Watch control off", StatusTone.PROBLEM)
|
||||||
state.connected -> when {
|
state.connected -> when {
|
||||||
state.charging || state.phase == "charging" ->
|
state.charging || state.phase == "charging" ->
|
||||||
StatusLine(chargingLine(state.battery), StatusTone.BUSY, caseLine(state))
|
StatusLine(chargingLine(state), StatusTone.BUSY, caseLine(state))
|
||||||
state.silentMode -> StatusLine("Silent mode", StatusTone.OFF)
|
state.silentMode -> StatusLine("Silent mode", StatusTone.OFF)
|
||||||
state.locked -> StatusLine("Locked", StatusTone.OFF)
|
state.locked -> StatusLine("Locked", StatusTone.OFF)
|
||||||
!state.screenOn -> StatusLine("●● Wake", StatusTone.OFF)
|
!state.screenOn -> StatusLine("●● Wake", StatusTone.OFF)
|
||||||
@@ -93,8 +93,8 @@ fun padLine(state: PhoneState?, link: LinkStatus): StatusLine = when {
|
|||||||
else -> StatusLine("Disconnected", StatusTone.OFF)
|
else -> StatusLine("Disconnected", StatusTone.OFF)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun chargingLine(battery: Int?): String =
|
private fun chargingLine(state: PhoneState): String =
|
||||||
if (battery != null) "Charging · G2 $battery%" else "Charging"
|
state.battery?.let { "Charging: ${state.glassesModel} $it%" } ?: "Charging"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* "Case 64%", with ⚡ while the case is on USB; null when the level is
|
* "Case 64%", with ⚡ while the case is on USB; null when the level is
|
||||||
|
|||||||
Reference in new issue
Block a user