@glassly/engine 0.1.0-dev.61 → 0.1.0-dev.62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -1
- package/build/facades/ota.d.ts +3 -1
- package/build/facades/ota.d.ts.map +1 -1
- package/build/facades/ota.js +4 -2
- package/build/facades/ota.js.map +1 -1
- package/build/generated/releaseMetadata.js +3 -3
- package/build/generated/releaseMetadata.js.map +1 -1
- package/build/index.d.ts +2 -2
- package/build/index.d.ts.map +1 -1
- package/build/index.js +2 -2
- package/build/index.js.map +1 -1
- package/build/react/MentraLiveOtaFlow.d.ts +6 -1
- package/build/react/MentraLiveOtaFlow.d.ts.map +1 -1
- package/build/react/MentraLiveOtaFlow.js +136 -14
- package/build/react/MentraLiveOtaFlow.js.map +1 -1
- package/build/react/useMentraLiveOta.d.ts +5 -1
- package/build/react/useMentraLiveOta.d.ts.map +1 -1
- package/build/react/useMentraLiveOta.js +135 -58
- package/build/react/useMentraLiveOta.js.map +1 -1
- package/build/services/DisplayProcessor.d.ts +3 -3
- package/build/services/DisplayProcessor.js +3 -3
- package/build/services/DisplayProcessor.js.map +1 -1
- package/build/services/LocalDisplayManager.d.ts +2 -2
- package/build/services/LocalDisplayManager.js +2 -2
- package/build/services/LocalDisplayManager.js.map +1 -1
- package/build/services/OtaInstallCoordinator.d.ts +2 -0
- package/build/services/OtaInstallCoordinator.d.ts.map +1 -1
- package/build/services/OtaInstallCoordinator.js +21 -1
- package/build/services/OtaInstallCoordinator.js.map +1 -1
- package/build/services/PhonePhotoCoordinator.js +1 -1
- package/build/services/PhonePhotoCoordinator.js.map +1 -1
- package/build/services/StreamLifecycleController.d.ts +4 -0
- package/build/services/StreamLifecycleController.d.ts.map +1 -1
- package/build/services/StreamLifecycleController.js +4 -0
- package/build/services/StreamLifecycleController.js.map +1 -1
- package/build/services/otaInstallPolicy.d.ts +4 -0
- package/build/services/otaInstallPolicy.d.ts.map +1 -1
- package/build/services/otaInstallPolicy.js +4 -0
- package/build/services/otaInstallPolicy.js.map +1 -1
- package/build/types/applet.d.ts +1 -1
- package/build/types/applet.js.map +1 -1
- package/build/types/capabilities/even-realities-g2.d.ts.map +1 -1
- package/build/types/capabilities/even-realities-g2.js +2 -2
- package/build/types/capabilities/even-realities-g2.js.map +1 -1
- package/build/types/hardware.d.ts.map +1 -1
- package/build/types/hardware.js +1 -0
- package/build/types/hardware.js.map +1 -1
- package/build/types/index.d.ts +1 -1
- package/build/types/index.d.ts.map +1 -1
- package/build/types/index.js +1 -1
- package/build/types/index.js.map +1 -1
- package/build/utils/display/composer/ColumnComposer.d.ts +1 -1
- package/build/utils/display/composer/ColumnComposer.js +1 -1
- package/build/utils/display/composer/ColumnComposer.js.map +1 -1
- package/package.json +8 -7
- package/src/facades/ota.ts +4 -2
- package/src/generated/releaseMetadata.ts +3 -3
- package/src/index.ts +2 -1
- package/src/react/MentraLiveOtaFlow.tsx +226 -41
- package/src/react/useMentraLiveOta.ts +146 -60
- package/src/services/DisplayProcessor.ts +3 -3
- package/src/services/LocalDisplayManager.ts +2 -2
- package/src/services/OtaInstallCoordinator.ts +21 -0
- package/src/services/PhonePhotoCoordinator.ts +1 -1
- package/src/services/StreamLifecycleController.ts +4 -0
- package/src/services/otaInstallPolicy.ts +4 -0
- package/src/types/applet.ts +1 -1
- package/src/types/capabilities/even-realities-g2.ts +3 -2
- package/src/types/hardware.ts +1 -0
- package/src/types/index.ts +1 -1
- package/src/utils/display/composer/ColumnComposer.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MentraLiveOtaFlow.js","sourceRoot":"","sources":["../../src/react/MentraLiveOtaFlow.tsx"],"names":[],"mappings":";AAAA,kGAAkG;AAClG,OAAc,EAAC,OAAO,EAAC,MAAM,OAAO,CAAA;AACpC,OAAO,EACL,iBAAiB,EACjB,SAAS,EACT,UAAU,EACV,UAAU,EACV,IAAI,EACJ,IAAI,GAGL,MAAM,cAAc,CAAA;AACr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,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,SAAS,EAAE,QAAQ,EAAC;IACxE,OAAO,EAAE,EAAC,QAAQ,EAAE,EAAE,EAAE,WAAW,EAAE,CAAC,cAAc,CAAC,EAAE,UAAU,EAAE,KAAK,EAAC;IACzE,aAAa,EAAE,EAAC,YAAY,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAC;IAC7F,YAAY,EAAE,EAAC,YAAY,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAC;IAC1C,aAAa,EAAE,EAAC,UAAU,EAAE,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAC;IAC5E,gBAAgB,EAAE,EAAC,GAAG,EAAE,EAAE,EAAE,eAAe,EAAE,CAAC,EAAC;IAC/C,cAAc,EAAE,EAAC,GAAG,EAAE,CAAC,EAAC;IACxB,gBAAgB,EAAE,EAAC,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,KAAK,EAAC;IACnD,iBAAiB,EAAE,EAAC,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,EAAC;IACjD,MAAM,EAAE;QACN,UAAU,EAAE,QAAQ;QACpB,YAAY,EAAE,EAAE;QAChB,WAAW,EAAE,CAAC;QACd,cAAc,EAAE,QAAQ;QACxB,SAAS,EAAE,EAAE;QACb,iBAAiB,EAAE,EAAE;KACtB;IACD,UAAU,EAAE,EAAC,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,KAAK,EAAC;CAC9C,CAAC,CAAA","sourcesContent":["/* eslint-disable react-native/no-raw-text -- BodyText and PercentText are local Text wrappers. */\nimport React, {useMemo} from \"react\"\nimport {\n ActivityIndicator,\n Pressable,\n ScrollView,\n StyleSheet,\n Text,\n View,\n type StyleProp,\n type ViewStyle,\n} from \"react-native\"\nimport {SafeAreaView} from \"react-native-safe-area-context\"\nimport Svg, {Path, Rect} from \"react-native-svg\"\n\nimport {useMentraLiveOta, type MentraLiveOtaController, type MentraLiveOtaFlowPage} from \"./useMentraLiveOta\"\n\nexport type {MentraLiveOtaFlowPage} from \"./useMentraLiveOta\"\n\nexport type MentraLiveOtaFlowTheme = {\n background: string\n border: string\n error: string\n foreground: string\n primary: string\n primaryText: string\n textDim: string\n}\n\nexport type MentraLiveOtaFlowTranslate = (key: string, options?: Record<string, string>) => string\n\nexport type MentraLiveOtaFlowProps = {\n /** Display name used in update copy. */\n deviceName?: string\n /** Entry page. `progress` exists for recovery/deep-link compatibility. */\n initialPage?: MentraLiveOtaFlowPage\n /** Start the OTA-only projections. Full Engine hosts should pass false. */\n initializeRuntime?: boolean\n /** Called after the final check or when the user leaves an optional update. */\n onFinished: () => void\n /** Host-owned Wi-Fi setup for glasses that do not support hotspot OTA. */\n onOpenWifiSetup: () => void\n /** Lets a host coordinate its global connection overlay with OTA progress and firmware restarts. */\n onFirmwareRestartingChange?: (restarting: boolean, progressActive: boolean) => void\n /** Enables the existing developer-only escape hatches. */\n allowDevSkip?: boolean\n /** Enables the existing super-mode interrupted-session escape hatch. */\n superMode?: boolean\n /** Optional host localization. Defaults to the Glassly App English OTA copy. */\n translate?: MentraLiveOtaFlowTranslate\n /** Optional host theme. Both hosts use the same layout and state machine. */\n theme?: Partial<MentraLiveOtaFlowTheme>\n style?: StyleProp<ViewStyle>\n}\n\nconst DEFAULT_THEME: MentraLiveOtaFlowTheme = {\n background: \"#FFFFFF\",\n border: \"#D7DFDA\",\n error: \"#C43131\",\n foreground: \"#0E2C1A\",\n primary: \"#00B869\",\n primaryText: \"#FFFFFF\",\n textDim: \"#66736B\",\n}\n\nconst ENGLISH_COPY: Record<string, string> = {\n \"common:continue\": \"Continue\",\n \"ota:checkingForUpdates\": \"Checking for updates\",\n \"ota:checkingForUpdatesMessage\":\n \"Connected devices will perform automatic updates. Automatic updates can be disabled in Device Settings\",\n \"ota:updateAvailable\": \"{{deviceName}} Update Available\",\n \"ota:updateConnectWifi\": \"Connect your {{deviceName}} to WiFi to install the update.\",\n \"ota:updateDescription\":\n \"A new update is available for your glasses. We recommend updating now for the best experience.\",\n \"ota:releaseTransition\": \"{{fromVersion}} → {{toVersion}}\",\n \"ota:releaseTransitionUnknown\": \"Current version unknown → {{toVersion}}\",\n \"ota:updatedToVersion\": \"Updated to {{version}}\",\n \"ota:downgradeAvailable\": \"{{deviceName}} Version Change Required\",\n \"ota:downgradeDescription\":\n \"This app requires an earlier glasses software version. Your photos and videos will be preserved, but glasses settings will be reset and restored automatically after the change.\",\n \"ota:updateNow\": \"Update Now\",\n \"ota:setupWifi\": \"Setup WiFi\",\n \"ota:updateLater\": \"Later\",\n \"ota:upToDate\": \"Up To Date\",\n \"ota:devBuild\": \"Development Build\",\n \"ota:devBuildNoOta\":\n \"This mobile app is a development build, so automatic glasses updates are disabled. Use the developer settings manifest override to update them manually.\",\n \"ota:noUpdatesAvailable\": \"Your glasses are running the latest version.\",\n \"ota:checkFailed\": \"Check Failed\",\n \"ota:checkFailedMessage\": \"Couldn't check for updates. Please check your connection and try again.\",\n \"ota:updateInfoUnavailable\": \"Update Info Unavailable\",\n \"ota:updateInfoUnavailableMessage\":\n \"Update information for this version of the app is unavailable. Please check the app store for a newer version of the Glassly App.\",\n \"ota:downgradeDuration\": \"Your glasses will restart twice — this may take up to 2 minutes.\",\n \"ota:versionChangeRestarting\": \"Installing a different version…\",\n \"ota:versionChangeVerifying\": \"Verifying your glasses…\",\n \"ota:versionChangeKeepNearby\": \"Keep your glasses nearby and connected. They will restart on their own.\",\n \"ota:versionChangeComplete\": \"Version Change Complete\",\n \"ota:versionChangeCompleteMessage\":\n \"Your glasses are now on the required version. Their settings were reset and are being restored automatically.\",\n \"ota:versionChangeFirmwarePassComplete\": \"Firmware updated\",\n \"ota:versionChangeFirmwarePassCompleteMessage\":\n \"Your glasses restarted with new firmware. One more step: they'll now continue to the required version.\",\n}\n\nfunction defaultTranslate(key: string, options?: Record<string, string>): string {\n let value = ENGLISH_COPY[key] ?? key\n for (const [name, replacement] of Object.entries(options ?? {})) {\n value = value.replaceAll(`{{${name}}}`, replacement)\n }\n return value\n}\n\nexport function MentraLiveOtaFlow({\n allowDevSkip = typeof __DEV__ !== \"undefined\" && __DEV__,\n deviceName = \"Mentra Live\",\n initialPage = \"check\",\n initializeRuntime = true,\n onFinished,\n onFirmwareRestartingChange,\n onOpenWifiSetup,\n style,\n superMode = false,\n theme,\n translate = defaultTranslate,\n}: MentraLiveOtaFlowProps) {\n const colors = useMemo(() => ({...DEFAULT_THEME, ...theme}), [theme])\n const controller = useMentraLiveOta({\n initialPage,\n initializeRuntime,\n onFinished,\n onFirmwareRestartingChange,\n onOpenWifiSetup,\n })\n\n return (\n <SafeAreaView style={[styles.safeArea, {backgroundColor: colors.background}, style]}>\n <View style={styles.header}>\n <View />\n <GlasslyMark color={colors.primary} />\n </View>\n <OtaFlowContent\n allowDevSkip={allowDevSkip}\n colors={colors}\n controller={controller}\n deviceName={deviceName}\n superMode={superMode}\n translate={translate}\n />\n </SafeAreaView>\n )\n}\n\nfunction OtaFlowContent({\n allowDevSkip,\n colors,\n controller,\n deviceName,\n superMode,\n translate,\n}: {\n allowDevSkip: boolean\n colors: MentraLiveOtaFlowTheme\n controller: MentraLiveOtaController\n deviceName: string\n superMode: boolean\n translate: MentraLiveOtaFlowTranslate\n}) {\n const {state} = controller\n\n if (state.screen === \"initializing\") {\n return (\n <FlowPage colors={colors} icon=\"download\" title={translate(\"ota:checkingForUpdates\")}>\n <ActivityIndicator size=\"large\" color={colors.foreground} />\n </FlowPage>\n )\n }\n\n if (state.screen === \"checking\") {\n return (\n <FlowPage colors={colors} icon=\"download\" title={translate(\"ota:checkingForUpdates\")}>\n <BodyText colors={colors}>{translate(\"ota:checkingForUpdatesMessage\")}</BodyText>\n <ActivityIndicator size=\"large\" color={colors.foreground} />\n </FlowPage>\n )\n }\n\n if (state.screen === \"update_available\" || state.screen === \"wifi_required\") {\n return (\n <FlowPage\n colors={colors}\n icon=\"download\"\n title={translate(state.versionChange ? \"ota:downgradeAvailable\" : \"ota:updateAvailable\", {deviceName})}\n actions={\n <>\n <FlowButton\n colors={colors}\n disabled={!state.wifiStatusKnown}\n label={translate(state.screen === \"wifi_required\" ? \"ota:setupWifi\" : \"ota:updateNow\")}\n onPress={state.screen === \"wifi_required\" ? controller.openWifiSetup : controller.install}\n />\n {state.canDismiss ? (\n <FlowButton colors={colors} label={translate(\"ota:updateLater\")} onPress={controller.finish} secondary />\n ) : null}\n {allowDevSkip && state.updateRequired ? (\n <FlowButton colors={colors} label=\"Skip (dev only)\" onPress={controller.finish} secondary />\n ) : null}\n </>\n }>\n {state.releaseTransition ? (\n <BodyText colors={colors}>\n {state.releaseTransition.fromVersion\n ? translate(\"ota:releaseTransition\", {\n fromVersion: state.releaseTransition.fromVersion,\n toVersion: state.releaseTransition.toVersion,\n })\n : translate(\"ota:releaseTransitionUnknown\", {toVersion: state.releaseTransition.toVersion})}\n </BodyText>\n ) : null}\n <BodyText colors={colors}>\n {state.screen === \"wifi_required\"\n ? translate(\"ota:updateConnectWifi\", {deviceName})\n : translate(state.versionChange ? \"ota:downgradeDescription\" : \"ota:updateDescription\")}\n </BodyText>\n </FlowPage>\n )\n }\n\n if (state.screen === \"dev_build\") {\n return (\n <FlowPage\n actions={<FlowButton colors={colors} label={translate(\"common:continue\")} onPress={controller.finish} />}\n colors={colors}\n icon=\"settings\"\n title={translate(\"ota:devBuild\")}>\n <BodyText colors={colors}>{translate(\"ota:devBuildNoOta\")}</BodyText>\n </FlowPage>\n )\n }\n\n if (state.screen === \"up_to_date\") {\n return (\n <FlowPage\n actions={<FlowButton colors={colors} label={translate(\"common:continue\")} onPress={controller.finish} />}\n colors={colors}\n icon=\"check\"\n title={translate(\"ota:upToDate\")}>\n <BodyText colors={colors}>{translate(\"ota:noUpdatesAvailable\")}</BodyText>\n {state.releaseTransition ? (\n <BodyText colors={colors}>\n {translate(\"ota:updatedToVersion\", {version: state.releaseTransition.toVersion})}\n </BodyText>\n ) : null}\n <ChangelogList changelogs={state.changelogs} colors={colors} />\n </FlowPage>\n )\n }\n\n if (state.screen === \"update_info_unavailable\") {\n return (\n <FlowPage\n actions={<FlowButton colors={colors} label={translate(\"common:continue\")} onPress={controller.finish} />}\n colors={colors}\n icon=\"alert\"\n title={translate(\"ota:updateInfoUnavailable\")}>\n <BodyText colors={colors}>{translate(\"ota:updateInfoUnavailableMessage\")}</BodyText>\n </FlowPage>\n )\n }\n\n if (state.screen === \"check_failed\") {\n return (\n <FlowPage\n actions={\n <>\n <FlowButton colors={colors} label=\"Retry\" onPress={controller.retryCheck} />\n {allowDevSkip ? (\n <FlowButton colors={colors} label=\"Skip (dev only)\" onPress={controller.finish} secondary />\n ) : null}\n </>\n }\n colors={colors}\n icon=\"alert\"\n title={translate(\"ota:checkFailed\")}>\n <BodyText colors={colors}>{translate(\"ota:checkFailedMessage\")}</BodyText>\n </FlowPage>\n )\n }\n\n if (state.versionChangePhase === \"restarting\" || state.versionChangePhase === \"verifying\") {\n return (\n <FlowPage\n colors={colors}\n icon=\"download\"\n title={translate(\n state.versionChangePhase === \"verifying\" ? \"ota:versionChangeVerifying\" : \"ota:versionChangeRestarting\",\n )}>\n <ActivityIndicator size=\"large\" color={colors.foreground} />\n <BodyText colors={colors}>{translate(\"ota:versionChangeKeepNearby\")}</BodyText>\n <BodyText colors={colors}>{translate(\"ota:downgradeDuration\")}</BodyText>\n </FlowPage>\n )\n }\n\n if (state.screen === \"starting\" || state.screen === \"preparing_hotspot\") {\n const title =\n state.hotspotPhase === \"downloading\"\n ? \"Downloading update to phone...\"\n : state.hotspotPhase === \"starting_hotspot\"\n ? \"Starting glasses hotspot...\"\n : state.hotspotPhase === \"joining_hotspot\"\n ? \"Connecting phone to glasses...\"\n : \"Starting update...\"\n return (\n <FlowPage colors={colors} icon=\"download\" title={title}>\n {state.hotspotPhase === \"downloading\" && state.hotspotArtifactPercent !== null ? (\n <PercentText colors={colors} percent={state.hotspotArtifactPercent} />\n ) : null}\n <ActivityIndicator size=\"large\" color={colors.foreground} />\n <BodyText colors={colors}>Do not disconnect your glasses</BodyText>\n </FlowPage>\n )\n }\n\n if (state.screen === \"updating\") {\n return (\n <FlowPage colors={colors} icon=\"download\" title={state.phase === \"download\" ? \"Downloading...\" : \"Installing...\"}>\n {state.installingApkOnly ? (\n <ActivityIndicator size=\"large\" color={colors.foreground} />\n ) : (\n <>\n <PercentText colors={colors} percent={state.progress ?? 0} />\n <View style={[styles.progressTrack, {backgroundColor: colors.border}]}>\n <View\n style={[styles.progressFill, {backgroundColor: colors.primary, width: `${state.progress ?? 0}%`}]}\n />\n </View>\n </>\n )}\n <BodyText colors={colors}>Do not disconnect your glasses</BodyText>\n {state.versionChange && state.phase === \"install\" ? (\n <BodyText colors={colors}>{translate(\"ota:downgradeDuration\")}</BodyText>\n ) : null}\n </FlowPage>\n )\n }\n\n if (state.screen === \"restarting\") {\n return (\n <FlowPage\n actions={\n <FlowButton colors={colors} disabled={state.continueDisabled} label=\"Continue\" onPress={controller.finish} />\n }\n colors={colors}\n icon=\"check\"\n title=\"Update Installed\"\n />\n )\n }\n\n if (state.screen === \"complete\") {\n const title = state.versionChangeConverged\n ? translate(\"ota:versionChangeComplete\")\n : state.versionChange\n ? translate(\"ota:versionChangeFirmwarePassComplete\")\n : \"Update complete!\"\n const message = state.versionChangeConverged\n ? translate(\"ota:versionChangeCompleteMessage\")\n : state.versionChange\n ? translate(\"ota:versionChangeFirmwarePassCompleteMessage\")\n : \"Your glasses are up to date.\"\n return (\n <FlowPage\n actions={\n <FlowButton\n colors={colors}\n label={state.versionChange && !state.versionChangeConverged ? \"Continue\" : \"Done\"}\n onPress={controller.finish}\n />\n }\n colors={colors}\n icon=\"check\"\n title={title}>\n <BodyText colors={colors}>{message}</BodyText>\n {state.releaseTransition ? (\n <BodyText colors={colors}>\n {translate(\"ota:updatedToVersion\", {version: state.releaseTransition.toVersion})}\n </BodyText>\n ) : null}\n <ChangelogList changelogs={state.changelogs} colors={colors} />\n </FlowPage>\n )\n }\n\n if (state.screen === \"failed\") {\n return (\n <FlowPage\n actions={\n <>\n <FlowButton\n colors={colors}\n label={state.canRetry ? \"Retry\" : \"Done\"}\n onPress={state.canRetry ? controller.retryInstall : controller.finish}\n />\n {state.canOpenWifiSetup ? (\n <FlowButton colors={colors} label=\"Change WiFi\" onPress={controller.openWifiSetup} secondary />\n ) : null}\n </>\n }\n colors={colors}\n icon=\"alert\"\n title=\"Update Failed\">\n <BodyText colors={colors}>{state.error?.message}</BodyText>\n </FlowPage>\n )\n }\n\n return (\n <FlowPage\n actions={\n superMode ? (\n <FlowButton colors={colors} label=\"Skip (super)\" onPress={controller.discard} secondary />\n ) : undefined\n }\n colors={colors}\n icon=\"bluetooth\"\n title=\"Glasses disconnected\">\n <BodyText colors={colors}>Reconnecting...</BodyText>\n <ActivityIndicator size=\"large\" color={colors.foreground} />\n </FlowPage>\n )\n}\n\ntype FlowPageProps = {\n actions?: React.ReactNode\n children?: React.ReactNode\n colors: MentraLiveOtaFlowTheme\n icon: \"alert\" | \"bluetooth\" | \"check\" | \"download\" | \"settings\"\n title: string\n}\n\nfunction FlowPage({actions, children, colors, icon, title}: FlowPageProps) {\n return (\n <View style={styles.page} testID=\"mentra-live-ota-flow\">\n <View style={styles.centerContent}>\n <FlowIcon colors={colors} name={icon} />\n <Text style={[styles.title, {color: colors.foreground}]}>{title}</Text>\n {children}\n </View>\n {actions ? <View style={styles.actions}>{actions}</View> : <View style={styles.actionSpacer} />}\n </View>\n )\n}\n\nfunction BodyText({children, colors}: {children: React.ReactNode; colors: MentraLiveOtaFlowTheme}) {\n return <Text style={[styles.body, {color: colors.textDim}]}>{children}</Text>\n}\n\nfunction PercentText({colors, percent}: {colors: MentraLiveOtaFlowTheme; percent: number}) {\n return <Text style={[styles.percent, {color: colors.primary}]}>{Math.round(percent)}%</Text>\n}\n\nfunction ChangelogList({\n changelogs,\n colors,\n}: {\n changelogs: MentraLiveOtaController[\"state\"][\"changelogs\"]\n colors: MentraLiveOtaFlowTheme\n}) {\n if (changelogs.length === 0) return null\n return (\n <ScrollView contentContainerStyle={styles.changelogContent} style={styles.changelogList}>\n {changelogs.map((entry) => (\n <View key={entry.version} style={styles.changelogEntry}>\n <Text selectable style={[styles.changelogVersion, {color: colors.foreground}]}>\n {entry.version}\n </Text>\n <Text selectable style={[styles.changelogMarkdown, {color: colors.textDim}]}>\n {entry.markdown}\n </Text>\n </View>\n ))}\n </ScrollView>\n )\n}\n\nfunction FlowButton({\n colors,\n disabled = false,\n label,\n onPress,\n secondary = false,\n}: {\n colors: MentraLiveOtaFlowTheme\n disabled?: boolean\n label: string\n onPress: () => void\n secondary?: boolean\n}) {\n return (\n <Pressable\n accessibilityRole=\"button\"\n disabled={disabled}\n onPress={onPress}\n style={({pressed}) => [\n styles.button,\n {\n backgroundColor: secondary ? colors.background : colors.foreground,\n borderColor: secondary ? colors.border : colors.foreground,\n opacity: disabled ? 0.45 : pressed ? 0.75 : 1,\n },\n ]}\n testID={`button-${label}`}>\n <Text style={[styles.buttonText, {color: secondary ? colors.foreground : colors.background}]}>{label}</Text>\n </Pressable>\n )\n}\n\nfunction GlasslyMark({color}: {color: string}) {\n return (\n <Svg width={33} height={18} viewBox=\"0 0 50 27\" fill=\"none\">\n <Rect y={14.8072} width={11.8457} height={11.8457} fill={color} />\n <Path d=\"M9.36639 0L30.7163 14.8072V26.6529L9.36639 11.8457V0Z\" fill={color} />\n <Path d=\"M28.6501 0L50 14.8072V26.6529L28.6501 11.8457V0Z\" fill={color} />\n </Svg>\n )\n}\n\nfunction FlowIcon({colors, name}: {colors: MentraLiveOtaFlowTheme; name: FlowPageProps[\"icon\"]}) {\n const color = name === \"alert\" || name === \"bluetooth\" ? colors.error : colors.primary\n const glyph =\n name === \"check\" ? \"✓\" : name === \"alert\" ? \"!\" : name === \"settings\" ? \"⚙\" : name === \"bluetooth\" ? \"⌁\" : \"↓\"\n return <Text style={[styles.icon, {color}]}>{glyph}</Text>\n}\n\nconst styles = StyleSheet.create({\n safeArea: {flex: 1},\n header: {\n alignItems: \"center\",\n flexDirection: \"row\",\n height: 48,\n justifyContent: \"space-between\",\n paddingHorizontal: 20,\n },\n page: {flex: 1, paddingBottom: 24, paddingHorizontal: 24},\n centerContent: {alignItems: \"center\", flex: 1, gap: 16, justifyContent: \"center\"},\n actionSpacer: {height: 48},\n actions: {gap: 12},\n icon: {fontSize: 64, fontWeight: \"500\", lineHeight: 72, textAlign: \"center\"},\n title: {fontSize: 20, fontWeight: \"600\", textAlign: \"center\"},\n body: {fontSize: 14, lineHeight: 20, maxWidth: 420, textAlign: \"center\"},\n percent: {fontSize: 30, fontVariant: [\"tabular-nums\"], fontWeight: \"700\"},\n progressTrack: {borderRadius: 4, height: 8, maxWidth: 420, overflow: \"hidden\", width: \"100%\"},\n progressFill: {borderRadius: 4, height: 8},\n changelogList: {flexShrink: 1, maxHeight: 260, maxWidth: 420, width: \"100%\"},\n changelogContent: {gap: 18, paddingVertical: 4},\n changelogEntry: {gap: 8},\n changelogVersion: {fontSize: 16, fontWeight: \"600\"},\n changelogMarkdown: {fontSize: 14, lineHeight: 20},\n button: {\n alignItems: \"center\",\n borderRadius: 50,\n borderWidth: 1,\n justifyContent: \"center\",\n minHeight: 44,\n paddingHorizontal: 20,\n },\n buttonText: {fontSize: 14, fontWeight: \"500\"},\n})\n"]}
|
|
1
|
+
{"version":3,"file":"MentraLiveOtaFlow.js","sourceRoot":"","sources":["../../src/react/MentraLiveOtaFlow.tsx"],"names":[],"mappings":";AAAA,kGAAkG;AAClG,OAAc,EAAC,OAAO,EAAC,MAAM,OAAO,CAAA;AACpC,OAAO,EACL,iBAAiB,EACjB,SAAS,EACT,UAAU,EACV,UAAU,EACV,IAAI,EACJ,IAAI,GAGL,MAAM,cAAc,CAAA;AACrB,OAAO,EAAC,WAAW,EAAiD,MAAM,qBAAqB,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E,EAAE,EAAC;IACjF,gBAAgB,EAAE,EAAC,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,KAAK,EAAC;IACnD,wBAAwB,EAAE,EAAC,GAAG,EAAE,EAAE,EAAC;IACnC,MAAM,EAAE;QACN,UAAU,EAAE,QAAQ;QACpB,YAAY,EAAE,EAAE;QAChB,WAAW,EAAE,CAAC;QACd,cAAc,EAAE,QAAQ;QACxB,SAAS,EAAE,EAAE;QACb,iBAAiB,EAAE,EAAE;KACtB;IACD,UAAU,EAAE,EAAC,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,KAAK,EAAC;CAC9C,CAAC,CAAA","sourcesContent":["/* eslint-disable react-native/no-raw-text -- BodyText and PercentText are local Text wrappers. */\nimport React, {useMemo} from \"react\"\nimport {\n ActivityIndicator,\n Pressable,\n ScrollView,\n StyleSheet,\n Text,\n View,\n type StyleProp,\n type ViewStyle,\n} from \"react-native\"\nimport {useMarkdown, type MarkedStyles, type useMarkdownHookOptions} from \"react-native-marked\"\nimport {SafeAreaView} from \"react-native-safe-area-context\"\nimport Svg, {Path, Rect} from \"react-native-svg\"\n\nimport {\n MINIMUM_OTA_BATTERY_LEVEL,\n useMentraLiveOta,\n type MentraLiveOtaController,\n type MentraLiveOtaFlowPage,\n} from \"./useMentraLiveOta\"\n\nexport type {MentraLiveOtaFlowPage} from \"./useMentraLiveOta\"\n\nexport type MentraLiveOtaFlowTheme = {\n background: string\n border: string\n error: string\n foreground: string\n primary: string\n primaryText: string\n textDim: string\n}\n\nexport type MentraLiveOtaFlowTranslate = (key: string, options?: Record<string, string>) => string\n\nexport type MentraLiveOtaFlowProps = {\n /** Display name used in update copy. */\n deviceName?: string\n /** Entry page. `progress` exists for recovery/deep-link compatibility. */\n initialPage?: MentraLiveOtaFlowPage\n /** Start the OTA-only projections. Full Engine hosts should pass false. */\n initializeRuntime?: boolean\n /** Called after the final check or when the user leaves an optional update. */\n onFinished: () => void\n /** Host-owned Wi-Fi setup for glasses that do not support hotspot OTA. */\n onOpenWifiSetup: () => void\n /** Lets a host coordinate its global connection overlay with OTA progress and firmware restarts. */\n onFirmwareRestartingChange?: (restarting: boolean, progressActive: boolean) => void\n /** Enables the existing developer-only escape hatches. */\n allowDevSkip?: boolean\n /** Enables the existing super-mode interrupted-session escape hatch. */\n superMode?: boolean\n /** Optional host localization. Defaults to the Glassly App English OTA copy. */\n translate?: MentraLiveOtaFlowTranslate\n /** Optional host theme. Both hosts use the same layout and state machine. */\n theme?: Partial<MentraLiveOtaFlowTheme>\n style?: StyleProp<ViewStyle>\n}\n\nconst DEFAULT_THEME: MentraLiveOtaFlowTheme = {\n background: \"#FFFFFF\",\n border: \"#D7DFDA\",\n error: \"#C43131\",\n foreground: \"#0E2C1A\",\n primary: \"#00B869\",\n primaryText: \"#FFFFFF\",\n textDim: \"#66736B\",\n}\n\nconst ENGLISH_COPY: Record<string, string> = {\n \"common:continue\": \"Continue\",\n \"common:done\": \"Done\",\n \"ota:checkingForUpdates\": \"Checking for updates\",\n \"ota:checkingForUpdatesMessage\":\n \"Connected devices will perform automatic updates. Automatic updates can be disabled in Device Settings\",\n \"ota:finishingUpdate\": \"Finishing your update\",\n \"ota:checkingAdditionalUpdates\": \"Checking whether your glasses need any additional updates.\",\n \"ota:updateAvailable\": \"{{deviceName}} Update Available\",\n \"ota:batteryRequiredTitle\": \"Charge {{deviceName}} to Update\",\n \"ota:batteryRequiredMessage\":\n \"{{deviceName}} is currently at {{batteryLevel}}%. Charge it to at least {{minimumBatteryLevel}}% before updating.\",\n \"ota:batteryRequiredLiveUpdate\": \"This screen will update automatically as the battery charges.\",\n \"ota:updateConnectWifi\": \"Connect your {{deviceName}} to WiFi to install the update.\",\n \"ota:wifiRequiredTitle\": \"WiFi Needed for Update\",\n \"ota:updateDescription\":\n \"A new update is available for your glasses. We recommend updating now for the best experience.\",\n \"ota:updateSequenceMessage\":\n \"Your glasses may install more than one update and restart several times. Keep them nearby until finished.\",\n \"ota:releaseTransition\": \"{{fromVersion}} → {{toVersion}}\",\n \"ota:releaseTransitionUnknown\": \"Current version unknown → {{toVersion}}\",\n \"ota:updatedToVersion\": \"Updated to {{version}}\",\n \"ota:downgradeAvailable\": \"{{deviceName}} Version Change Required\",\n \"ota:downgradeDescription\":\n \"This app requires an earlier glasses software version. Your photos and videos will be preserved, but glasses settings will be reset and restored automatically after the change.\",\n \"ota:updateNow\": \"Update Now\",\n \"ota:setupWifi\": \"Setup WiFi\",\n \"ota:updateLater\": \"Later\",\n \"ota:updateComplete\": \"Update complete\",\n \"ota:whatsNew\": \"What's new\",\n \"ota:upToDate\": \"Up To Date\",\n \"ota:devBuild\": \"Development Build\",\n \"ota:devBuildNoOta\":\n \"This mobile app is a development build, so automatic glasses updates are disabled. Use the developer settings manifest override to update them manually.\",\n \"ota:noUpdatesAvailable\": \"Your glasses are running the latest version.\",\n \"ota:checkFailed\": \"Check Failed\",\n \"ota:checkFailedMessage\": \"Couldn't check for updates. Please check your connection and try again.\",\n \"ota:updateInfoUnavailable\": \"Update Info Unavailable\",\n \"ota:updateInfoUnavailableMessage\":\n \"Update information for this version of the app is unavailable. Please check the app store for a newer version of the Glassly App.\",\n \"ota:downgradeDuration\": \"Your glasses will restart twice — this may take up to 2 minutes.\",\n \"ota:versionChangeRestarting\": \"Installing a different version…\",\n \"ota:versionChangeVerifying\": \"Verifying your glasses…\",\n \"ota:versionChangeKeepNearby\": \"Keep your glasses nearby and connected. They will restart on their own.\",\n \"ota:restartingGlasses\": \"Restarting {{deviceName}}…\",\n \"ota:restartingGlassesMessage\":\n \"The update is installed. Keep your glasses nearby and leave this screen open while they finish starting.\",\n \"ota:restartingGlassesAutomatic\": \"We'll continue automatically when they're ready.\",\n \"ota:versionChangeComplete\": \"Version Change Complete\",\n \"ota:versionChangeCompleteMessage\":\n \"Your glasses are now on the required version. Their settings were reset and are being restored automatically.\",\n \"ota:versionChangeFirmwarePassComplete\": \"Firmware updated\",\n \"ota:versionChangeFirmwarePassCompleteMessage\":\n \"Your glasses restarted with new firmware. One more step: they'll now continue to the required version.\",\n}\n\nfunction defaultTranslate(key: string, options?: Record<string, string>): string {\n let value = ENGLISH_COPY[key] ?? key\n for (const [name, replacement] of Object.entries(options ?? {})) {\n value = value.replaceAll(`{{${name}}}`, replacement)\n }\n return value\n}\n\nexport function MentraLiveOtaFlow({\n allowDevSkip = typeof __DEV__ !== \"undefined\" && __DEV__,\n deviceName = \"Mentra Live\",\n initialPage = \"check\",\n initializeRuntime = true,\n onFinished,\n onFirmwareRestartingChange,\n onOpenWifiSetup,\n style,\n superMode = false,\n theme,\n translate = defaultTranslate,\n}: MentraLiveOtaFlowProps) {\n const colors = useMemo(() => ({...DEFAULT_THEME, ...theme}), [theme])\n const controller = useMentraLiveOta({\n initialPage,\n initializeRuntime,\n onFinished,\n onFirmwareRestartingChange,\n onOpenWifiSetup,\n })\n\n return (\n <SafeAreaView style={[styles.safeArea, {backgroundColor: colors.background}, style]}>\n <View style={styles.header}>\n <View />\n <GlasslyMark color={colors.primary} />\n </View>\n <OtaFlowContent\n allowDevSkip={allowDevSkip}\n colors={colors}\n controller={controller}\n deviceName={deviceName}\n superMode={superMode}\n translate={translate}\n />\n </SafeAreaView>\n )\n}\n\nfunction OtaFlowContent({\n allowDevSkip,\n colors,\n controller,\n deviceName,\n superMode,\n translate,\n}: {\n allowDevSkip: boolean\n colors: MentraLiveOtaFlowTheme\n controller: MentraLiveOtaController\n deviceName: string\n superMode: boolean\n translate: MentraLiveOtaFlowTranslate\n}) {\n const {state} = controller\n\n if (state.screen === \"initializing\") {\n return (\n <FlowPage colors={colors} icon=\"download\" title={translate(\"ota:checkingForUpdates\")}>\n <ActivityIndicator size=\"large\" color={colors.foreground} />\n </FlowPage>\n )\n }\n\n if (state.screen === \"checking\") {\n return (\n <FlowPage colors={colors} icon=\"download\" title={translate(\"ota:checkingForUpdates\")}>\n <BodyText colors={colors}>{translate(\"ota:checkingForUpdatesMessage\")}</BodyText>\n <ActivityIndicator size=\"large\" color={colors.foreground} />\n </FlowPage>\n )\n }\n\n if (state.screen === \"battery_required\") {\n return (\n <FlowPage\n actions={\n <>\n <FlowButton colors={colors} disabled label={translate(\"ota:updateNow\")} onPress={controller.install} />\n {state.canDismiss ? (\n <FlowButton colors={colors} label={translate(\"ota:updateLater\")} onPress={controller.finish} secondary />\n ) : null}\n </>\n }\n colors={colors}\n icon=\"alert\"\n title={translate(\"ota:batteryRequiredTitle\", {deviceName})}>\n <BodyText colors={colors}>\n {translate(\"ota:batteryRequiredMessage\", {\n batteryLevel: String(state.batteryLevel),\n deviceName,\n minimumBatteryLevel: String(MINIMUM_OTA_BATTERY_LEVEL),\n })}\n </BodyText>\n <BodyText colors={colors}>{translate(\"ota:batteryRequiredLiveUpdate\")}</BodyText>\n </FlowPage>\n )\n }\n\n if (state.screen === \"finishing\") {\n return (\n <FlowPage colors={colors} icon=\"download\" title={translate(\"ota:finishingUpdate\")}>\n <BodyText colors={colors}>{translate(\"ota:checkingAdditionalUpdates\")}</BodyText>\n <ActivityIndicator size=\"large\" color={colors.foreground} />\n </FlowPage>\n )\n }\n\n if (state.screen === \"update_available\" || state.screen === \"wifi_required\") {\n const titleKey =\n state.screen === \"wifi_required\"\n ? \"ota:wifiRequiredTitle\"\n : state.versionChange\n ? \"ota:downgradeAvailable\"\n : \"ota:updateAvailable\"\n return (\n <FlowPage\n colors={colors}\n icon=\"download\"\n title={translate(titleKey, {deviceName})}\n actions={\n <>\n <FlowButton\n colors={colors}\n disabled={!state.wifiStatusKnown}\n label={translate(state.screen === \"wifi_required\" ? \"ota:setupWifi\" : \"ota:updateNow\")}\n onPress={state.screen === \"wifi_required\" ? controller.openWifiSetup : controller.install}\n />\n {state.canDismiss ? (\n <FlowButton colors={colors} label={translate(\"ota:updateLater\")} onPress={controller.finish} secondary />\n ) : null}\n {allowDevSkip && state.updateRequired ? (\n <FlowButton colors={colors} label=\"Skip (dev only)\" onPress={controller.finish} secondary />\n ) : null}\n </>\n }>\n {state.releaseTransition ? (\n <BodyText colors={colors}>\n {state.releaseTransition.fromVersion\n ? translate(\"ota:releaseTransition\", {\n fromVersion: state.releaseTransition.fromVersion,\n toVersion: state.releaseTransition.toVersion,\n })\n : translate(\"ota:releaseTransitionUnknown\", {toVersion: state.releaseTransition.toVersion})}\n </BodyText>\n ) : null}\n <BodyText colors={colors}>\n {state.screen === \"wifi_required\"\n ? translate(\"ota:updateConnectWifi\", {deviceName})\n : translate(state.versionChange ? \"ota:downgradeDescription\" : \"ota:updateDescription\")}\n </BodyText>\n <BodyText colors={colors}>{translate(\"ota:updateSequenceMessage\")}</BodyText>\n </FlowPage>\n )\n }\n\n if (state.screen === \"dev_build\") {\n return (\n <FlowPage\n actions={<FlowButton colors={colors} label={translate(\"common:continue\")} onPress={controller.finish} />}\n colors={colors}\n icon=\"settings\"\n title={translate(\"ota:devBuild\")}>\n <BodyText colors={colors}>{translate(\"ota:devBuildNoOta\")}</BodyText>\n </FlowPage>\n )\n }\n\n if (state.screen === \"up_to_date\") {\n return (\n <FlowPage\n actions={\n <FlowButton\n colors={colors}\n label={translate(state.completedUpdate ? \"common:done\" : \"common:continue\")}\n onPress={controller.finish}\n />\n }\n colors={colors}\n contentAlignment={state.changelogs.length > 0 ? \"top\" : \"center\"}\n icon=\"check\"\n title={translate(state.completedUpdate ? \"ota:updateComplete\" : \"ota:upToDate\")}>\n <BodyText colors={colors}>{translate(\"ota:noUpdatesAvailable\")}</BodyText>\n {state.releaseTransition ? (\n <BodyText colors={colors}>\n {translate(\"ota:updatedToVersion\", {version: state.releaseTransition.toVersion})}\n </BodyText>\n ) : null}\n <ChangelogList changelogs={state.changelogs} colors={colors} title={translate(\"ota:whatsNew\")} />\n </FlowPage>\n )\n }\n\n if (state.screen === \"update_info_unavailable\") {\n return (\n <FlowPage\n actions={<FlowButton colors={colors} label={translate(\"common:continue\")} onPress={controller.finish} />}\n colors={colors}\n icon=\"alert\"\n title={translate(\"ota:updateInfoUnavailable\")}>\n <BodyText colors={colors}>{translate(\"ota:updateInfoUnavailableMessage\")}</BodyText>\n </FlowPage>\n )\n }\n\n if (state.screen === \"check_failed\") {\n return (\n <FlowPage\n actions={\n <>\n <FlowButton colors={colors} label=\"Retry\" onPress={controller.retryCheck} />\n {allowDevSkip ? (\n <FlowButton colors={colors} label=\"Skip (dev only)\" onPress={controller.finish} secondary />\n ) : null}\n </>\n }\n colors={colors}\n icon=\"alert\"\n title={translate(\"ota:checkFailed\")}>\n <BodyText colors={colors}>{translate(\"ota:checkFailedMessage\")}</BodyText>\n </FlowPage>\n )\n }\n\n if (state.versionChangePhase === \"restarting\" || state.versionChangePhase === \"verifying\") {\n return (\n <FlowPage\n colors={colors}\n icon=\"download\"\n title={translate(\n state.versionChangePhase === \"verifying\" ? \"ota:versionChangeVerifying\" : \"ota:versionChangeRestarting\",\n )}>\n <ActivityIndicator size=\"large\" color={colors.foreground} />\n <BodyText colors={colors}>{translate(\"ota:versionChangeKeepNearby\")}</BodyText>\n <BodyText colors={colors}>{translate(\"ota:downgradeDuration\")}</BodyText>\n </FlowPage>\n )\n }\n\n if (state.screen === \"starting\" || state.screen === \"preparing_hotspot\") {\n const title =\n state.hotspotPhase === \"downloading\"\n ? \"Downloading update to phone...\"\n : state.hotspotPhase === \"starting_hotspot\"\n ? \"Starting glasses hotspot...\"\n : state.hotspotPhase === \"joining_hotspot\"\n ? \"Connecting phone to glasses...\"\n : \"Starting update...\"\n return (\n <FlowPage colors={colors} icon=\"download\" title={title}>\n {state.hotspotPhase === \"downloading\" && state.hotspotArtifactPercent !== null ? (\n <PercentText colors={colors} percent={state.hotspotArtifactPercent} />\n ) : null}\n <ActivityIndicator size=\"large\" color={colors.foreground} />\n <BodyText colors={colors}>Do not disconnect your glasses</BodyText>\n </FlowPage>\n )\n }\n\n if (state.screen === \"updating\") {\n return (\n <FlowPage colors={colors} icon=\"download\" title={state.phase === \"download\" ? \"Downloading...\" : \"Installing...\"}>\n {state.installingApkOnly ? (\n <ActivityIndicator size=\"large\" color={colors.foreground} />\n ) : (\n <>\n <PercentText colors={colors} percent={state.progress ?? 0} />\n <View style={[styles.progressTrack, {backgroundColor: colors.border}]}>\n <View\n style={[styles.progressFill, {backgroundColor: colors.primary, width: `${state.progress ?? 0}%`}]}\n />\n </View>\n </>\n )}\n <BodyText colors={colors}>Do not disconnect your glasses</BodyText>\n {state.versionChange && state.phase === \"install\" ? (\n <BodyText colors={colors}>{translate(\"ota:downgradeDuration\")}</BodyText>\n ) : null}\n </FlowPage>\n )\n }\n\n if (state.screen === \"restarting\") {\n return (\n <FlowPage colors={colors} icon=\"download\" title={translate(\"ota:restartingGlasses\", {deviceName})}>\n <ActivityIndicator size=\"large\" color={colors.foreground} />\n <BodyText colors={colors}>{translate(\"ota:restartingGlassesMessage\")}</BodyText>\n <BodyText colors={colors}>{translate(\"ota:restartingGlassesAutomatic\")}</BodyText>\n </FlowPage>\n )\n }\n\n if (state.screen === \"complete\") {\n const title = state.versionChangeConverged\n ? translate(\"ota:versionChangeComplete\")\n : state.versionChange\n ? translate(\"ota:versionChangeFirmwarePassComplete\")\n : \"Update complete!\"\n const message = state.versionChangeConverged\n ? translate(\"ota:versionChangeCompleteMessage\")\n : state.versionChange\n ? translate(\"ota:versionChangeFirmwarePassCompleteMessage\")\n : \"Your glasses are up to date.\"\n return (\n <FlowPage\n actions={\n <FlowButton\n colors={colors}\n label={state.versionChange && !state.versionChangeConverged ? \"Continue\" : \"Done\"}\n onPress={controller.finish}\n />\n }\n colors={colors}\n contentAlignment={state.changelogs.length > 0 ? \"top\" : \"center\"}\n icon=\"check\"\n title={title}>\n <BodyText colors={colors}>{message}</BodyText>\n {state.releaseTransition ? (\n <BodyText colors={colors}>\n {translate(\"ota:updatedToVersion\", {version: state.releaseTransition.toVersion})}\n </BodyText>\n ) : null}\n <ChangelogList changelogs={state.changelogs} colors={colors} title={translate(\"ota:whatsNew\")} />\n </FlowPage>\n )\n }\n\n if (state.screen === \"failed\") {\n return (\n <FlowPage\n actions={\n <>\n <FlowButton\n colors={colors}\n label={state.canRetry ? \"Retry\" : \"Done\"}\n onPress={state.canRetry ? controller.retryInstall : controller.finish}\n />\n {state.canOpenWifiSetup ? (\n <FlowButton colors={colors} label=\"Change WiFi\" onPress={controller.openWifiSetup} secondary />\n ) : null}\n </>\n }\n colors={colors}\n icon=\"alert\"\n title=\"Update Failed\">\n <BodyText colors={colors}>{state.error?.message}</BodyText>\n </FlowPage>\n )\n }\n\n return (\n <FlowPage\n actions={\n superMode ? (\n <FlowButton colors={colors} label=\"Skip (super)\" onPress={controller.discard} secondary />\n ) : undefined\n }\n colors={colors}\n icon=\"bluetooth\"\n title=\"Glasses disconnected\">\n <BodyText colors={colors}>Reconnecting...</BodyText>\n <ActivityIndicator size=\"large\" color={colors.foreground} />\n </FlowPage>\n )\n}\n\ntype FlowPageProps = {\n actions?: React.ReactNode\n children?: React.ReactNode\n colors: MentraLiveOtaFlowTheme\n contentAlignment?: \"center\" | \"top\"\n icon: \"alert\" | \"bluetooth\" | \"check\" | \"download\" | \"settings\"\n title: string\n}\n\nfunction FlowPage({actions, children, colors, contentAlignment = \"center\", icon, title}: FlowPageProps) {\n return (\n <View style={styles.page} testID=\"mentra-live-ota-flow\">\n <View style={[styles.centerContent, contentAlignment === \"top\" && styles.topContent]}>\n <FlowIcon colors={colors} name={icon} />\n <Text style={[styles.title, {color: colors.foreground}]}>{title}</Text>\n {children}\n </View>\n {actions ? <View style={styles.actions}>{actions}</View> : <View style={styles.actionSpacer} />}\n </View>\n )\n}\n\nfunction BodyText({children, colors}: {children: React.ReactNode; colors: MentraLiveOtaFlowTheme}) {\n return <Text style={[styles.body, {color: colors.textDim}]}>{children}</Text>\n}\n\nfunction PercentText({colors, percent}: {colors: MentraLiveOtaFlowTheme; percent: number}) {\n return <Text style={[styles.percent, {color: colors.primary}]}>{Math.round(percent)}%</Text>\n}\n\nfunction ChangelogMarkdown({colors, markdown}: {colors: MentraLiveOtaFlowTheme; markdown: string}) {\n const markdownStyles = useMemo<MarkedStyles>(\n () => ({\n blockquote: {\n borderLeftColor: colors.primary,\n borderLeftWidth: 3,\n marginVertical: 2,\n opacity: 1,\n paddingLeft: 12,\n },\n code: {\n backgroundColor: colors.background,\n borderColor: colors.border,\n borderRadius: 8,\n borderWidth: 1,\n padding: 12,\n },\n codespan: {\n backgroundColor: colors.border,\n color: colors.foreground,\n fontFamily: \"monospace\",\n fontSize: 13,\n fontStyle: \"normal\",\n fontWeight: \"400\",\n },\n em: {color: colors.textDim, fontSize: 14, lineHeight: 20},\n h1: {\n borderBottomWidth: 0,\n color: colors.foreground,\n fontSize: 18,\n fontWeight: \"700\",\n lineHeight: 24,\n marginVertical: 0,\n paddingBottom: 0,\n },\n h2: {\n borderBottomWidth: 0,\n color: colors.foreground,\n fontSize: 17,\n fontWeight: \"700\",\n lineHeight: 23,\n marginVertical: 0,\n paddingBottom: 0,\n },\n h3: {color: colors.foreground, fontSize: 16, fontWeight: \"700\", lineHeight: 22, marginVertical: 0},\n h4: {color: colors.foreground, fontSize: 15, fontWeight: \"700\", lineHeight: 21, marginVertical: 0},\n h5: {color: colors.foreground, fontSize: 14, fontWeight: \"700\", lineHeight: 20, marginVertical: 0},\n h6: {color: colors.textDim, fontSize: 14, fontWeight: \"600\", lineHeight: 20, marginVertical: 0},\n hr: {borderBottomColor: colors.border, marginVertical: 2},\n image: {borderRadius: 8},\n li: {color: colors.textDim, fontSize: 14, lineHeight: 20},\n link: {\n color: colors.primary,\n fontSize: 14,\n fontStyle: \"normal\",\n lineHeight: 20,\n textDecorationLine: \"underline\",\n },\n paragraph: {paddingVertical: 0},\n strikethrough: {color: colors.textDim, fontSize: 14, lineHeight: 20},\n strong: {color: colors.foreground, fontSize: 14, fontWeight: \"700\", lineHeight: 20},\n table: {borderColor: colors.border, borderRadius: 8},\n tableCell: {padding: 8},\n text: {color: colors.textDim, fontSize: 14, lineHeight: 20},\n }),\n [colors],\n )\n const markdownTheme = useMemo<NonNullable<useMarkdownHookOptions[\"theme\"]>>(\n () => ({\n colors: {\n background: colors.background,\n border: colors.border,\n code: colors.border,\n link: colors.primary,\n text: colors.textDim,\n },\n }),\n [colors],\n )\n const elements = useMarkdown(markdown, {colorScheme: \"light\", styles: markdownStyles, theme: markdownTheme})\n\n return (\n <View style={styles.changelogMarkdownContent} testID=\"ota-changelog-markdown\">\n {elements}\n </View>\n )\n}\n\nexport function ChangelogList({\n changelogs,\n colors,\n title,\n}: {\n changelogs: MentraLiveOtaController[\"state\"][\"changelogs\"]\n colors: MentraLiveOtaFlowTheme\n title: string\n}) {\n if (changelogs.length === 0) return null\n return (\n <View style={[styles.changelogCard, {borderColor: colors.border}]} testID=\"ota-changelog-card\">\n <Text style={[styles.changelogTitle, {color: colors.foreground}]}>{title}</Text>\n <ScrollView\n contentContainerStyle={styles.changelogContent}\n nestedScrollEnabled\n showsVerticalScrollIndicator\n style={styles.changelogList}\n testID=\"ota-changelog-scroll\">\n {changelogs.map((entry, index) => (\n <View\n key={entry.version}\n style={[\n styles.changelogEntry,\n index > 0 && styles.changelogEntryDivider,\n index > 0 && {borderTopColor: colors.border},\n ]}>\n <Text selectable style={[styles.changelogVersion, {color: colors.foreground}]}>\n {entry.version}\n </Text>\n <ChangelogMarkdown colors={colors} markdown={entry.markdown} />\n </View>\n ))}\n </ScrollView>\n </View>\n )\n}\n\nfunction FlowButton({\n colors,\n disabled = false,\n label,\n onPress,\n secondary = false,\n}: {\n colors: MentraLiveOtaFlowTheme\n disabled?: boolean\n label: string\n onPress: () => void\n secondary?: boolean\n}) {\n return (\n <Pressable\n accessibilityRole=\"button\"\n disabled={disabled}\n onPress={onPress}\n style={({pressed}) => [\n styles.button,\n {\n backgroundColor: secondary ? colors.background : colors.foreground,\n borderColor: secondary ? colors.border : colors.foreground,\n opacity: disabled ? 0.45 : pressed ? 0.75 : 1,\n },\n ]}\n testID={`button-${label}`}>\n <Text style={[styles.buttonText, {color: secondary ? colors.foreground : colors.background}]}>{label}</Text>\n </Pressable>\n )\n}\n\nfunction GlasslyMark({color}: {color: string}) {\n return (\n <Svg width={33} height={18} viewBox=\"0 0 50 27\" fill=\"none\">\n <Rect y={14.8072} width={11.8457} height={11.8457} fill={color} />\n <Path d=\"M9.36639 0L30.7163 14.8072V26.6529L9.36639 11.8457V0Z\" fill={color} />\n <Path d=\"M28.6501 0L50 14.8072V26.6529L28.6501 11.8457V0Z\" fill={color} />\n </Svg>\n )\n}\n\nfunction FlowIcon({colors, name}: {colors: MentraLiveOtaFlowTheme; name: FlowPageProps[\"icon\"]}) {\n const color = name === \"alert\" || name === \"bluetooth\" ? colors.error : colors.primary\n const glyph =\n name === \"check\" ? \"✓\" : name === \"alert\" ? \"!\" : name === \"settings\" ? \"⚙\" : name === \"bluetooth\" ? \"⌁\" : \"↓\"\n return <Text style={[styles.icon, {color}]}>{glyph}</Text>\n}\n\nconst styles = StyleSheet.create({\n safeArea: {flex: 1},\n header: {\n alignItems: \"center\",\n flexDirection: \"row\",\n height: 48,\n justifyContent: \"space-between\",\n paddingHorizontal: 20,\n },\n page: {flex: 1, paddingBottom: 24, paddingHorizontal: 24},\n centerContent: {alignItems: \"center\", flex: 1, gap: 16, justifyContent: \"center\"},\n topContent: {justifyContent: \"flex-start\", paddingTop: 12},\n actionSpacer: {height: 48},\n actions: {gap: 12},\n icon: {fontSize: 64, fontWeight: \"500\", lineHeight: 72, textAlign: \"center\"},\n title: {fontSize: 20, fontWeight: \"600\", textAlign: \"center\"},\n body: {fontSize: 14, lineHeight: 20, maxWidth: 420, textAlign: \"center\"},\n percent: {fontSize: 30, fontVariant: [\"tabular-nums\"], fontWeight: \"700\"},\n progressTrack: {borderRadius: 4, height: 8, maxWidth: 420, overflow: \"hidden\", width: \"100%\"},\n progressFill: {borderRadius: 4, height: 8},\n changelogCard: {\n borderRadius: 16,\n borderWidth: 1,\n flexShrink: 1,\n gap: 12,\n maxHeight: 300,\n maxWidth: 420,\n padding: 16,\n width: \"100%\",\n },\n changelogTitle: {fontSize: 16, fontWeight: \"700\"},\n changelogList: {flexShrink: 1, maxHeight: 232, width: \"100%\"},\n changelogContent: {gap: 20, paddingBottom: 2},\n changelogEntry: {gap: 8},\n changelogEntryDivider: {borderTopWidth: StyleSheet.hairlineWidth, paddingTop: 20},\n changelogVersion: {fontSize: 14, fontWeight: \"600\"},\n changelogMarkdownContent: {gap: 10},\n button: {\n alignItems: \"center\",\n borderRadius: 50,\n borderWidth: 1,\n justifyContent: \"center\",\n minHeight: 44,\n paddingHorizontal: 20,\n },\n buttonText: {fontSize: 14, fontWeight: \"500\"},\n})\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReleaseChangelog } from "../facades/ota";
|
|
2
2
|
export type MentraLiveOtaFlowPage = "check" | "progress";
|
|
3
|
-
export type MentraLiveOtaScreen = "initializing" | "checking" | "update_available" | "wifi_required" | "up_to_date" | "dev_build" | "check_failed" | "update_info_unavailable" | "starting" | "preparing_hotspot" | "updating" | "restarting" | "verifying" | "complete" | "failed" | "disconnected";
|
|
3
|
+
export type MentraLiveOtaScreen = "initializing" | "checking" | "finishing" | "update_available" | "battery_required" | "wifi_required" | "up_to_date" | "dev_build" | "check_failed" | "update_info_unavailable" | "starting" | "preparing_hotspot" | "updating" | "restarting" | "verifying" | "complete" | "failed" | "disconnected";
|
|
4
4
|
export type MentraLiveOtaErrorCode = "check_failed" | "update_info_unavailable" | "install_failed" | "bes_restart_required";
|
|
5
5
|
export type MentraLiveOtaError = {
|
|
6
6
|
code: MentraLiveOtaErrorCode;
|
|
@@ -19,6 +19,7 @@ export type MentraLiveOtaReleaseTransition = {
|
|
|
19
19
|
export type MentraLiveOtaState = {
|
|
20
20
|
screen: MentraLiveOtaScreen;
|
|
21
21
|
connected: boolean;
|
|
22
|
+
batteryLevel: number | null;
|
|
22
23
|
transport: MentraLiveOtaTransport | null;
|
|
23
24
|
updateRequired: boolean;
|
|
24
25
|
versionChange: boolean;
|
|
@@ -44,6 +45,8 @@ export type MentraLiveOtaState = {
|
|
|
44
45
|
canDiscard: boolean;
|
|
45
46
|
canOpenWifiSetup: boolean;
|
|
46
47
|
continueDisabled: boolean;
|
|
48
|
+
/** True only after an approved update session reaches a final no-update check. */
|
|
49
|
+
completedUpdate: boolean;
|
|
47
50
|
/** Release labels for the offered or just-completed coordinated update. */
|
|
48
51
|
releaseTransition: MentraLiveOtaReleaseTransition | null;
|
|
49
52
|
/** Release notes crossed by this update, newest first. Populated on completion. */
|
|
@@ -71,6 +74,7 @@ export type MentraLiveOtaController = {
|
|
|
71
74
|
discard: () => void;
|
|
72
75
|
openWifiSetup: () => void;
|
|
73
76
|
};
|
|
77
|
+
export declare const MINIMUM_OTA_BATTERY_LEVEL = 25;
|
|
74
78
|
/**
|
|
75
79
|
* Headless Mentra Live OTA flow. Engine owns checking, hotspot staging,
|
|
76
80
|
* APK/MTK/BES sequencing, restart recovery, retries, and verification; the host
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMentraLiveOta.d.ts","sourceRoot":"","sources":["../../src/react/useMentraLiveOta.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,gBAAgB,CAAA;AAGpD,MAAM,MAAM,qBAAqB,GAAG,OAAO,GAAG,UAAU,CAAA;AAExD,MAAM,MAAM,mBAAmB,GAC3B,cAAc,GACd,UAAU,GACV,kBAAkB,GAClB,eAAe,GACf,YAAY,GACZ,WAAW,GACX,cAAc,GACd,yBAAyB,GACzB,UAAU,GACV,mBAAmB,GACnB,UAAU,GACV,YAAY,GACZ,WAAW,GACX,UAAU,GACV,QAAQ,GACR,cAAc,CAAA;AAElB,MAAM,MAAM,sBAAsB,GAC9B,cAAc,GACd,yBAAyB,GACzB,gBAAgB,GAChB,sBAAsB,CAAA;AAE1B,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,sBAAsB,CAAA;IAC5B,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG,MAAM,GAAG,SAAS,CAAA;AACvD,MAAM,MAAM,yBAAyB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;IACpC,KAAK,EAAE,kBAAkB,CAAA;IACzB,KAAK,EAAE,MAAM,IAAI,CAAA;IACjB,UAAU,EAAE,MAAM,IAAI,CAAA;IACtB,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,YAAY,EAAE,MAAM,IAAI,CAAA;IACxB,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,aAAa,EAAE,MAAM,IAAI,CAAA;CAC1B,CAAA;AAMD,eAAO,MAAM,yBAAyB,KAAK,CAAA;AA8D3C;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,GAAE,uBAA4B,GAAG,uBAAuB,CA8kB/F"}
|
|
@@ -5,6 +5,7 @@ import { BES_INSTALL_RESTART_MESSAGE, getOtaErrorMessage, shouldRequireGlassesRe
|
|
|
5
5
|
import { useEngineSnapshot } from "./useEngineSnapshot";
|
|
6
6
|
const AUTO_CHAIN_NETWORK_RETRY_DELAY_MS = 5000;
|
|
7
7
|
const AUTO_CHAIN_COMPLETE_DELAY_MS = 750;
|
|
8
|
+
export const MINIMUM_OTA_BATTERY_LEVEL = 25;
|
|
8
9
|
function releaseRangeTargetVersion(result) {
|
|
9
10
|
return result.releaseVersion ?? result.updateInfo?.versionName ?? result.latestVersionInfo?.versionName ?? null;
|
|
10
11
|
}
|
|
@@ -40,10 +41,10 @@ function installProgress(snapshot) {
|
|
|
40
41
|
const isDownload = otaStatus?.phase === "download";
|
|
41
42
|
const totalSteps = otaStatus?.totalSteps ?? 1;
|
|
42
43
|
const rawPercent = isDownload
|
|
43
|
-
? otaStatus?.stepPercent ?? 0
|
|
44
|
+
? (otaStatus?.stepPercent ?? 0)
|
|
44
45
|
: totalSteps >= 2
|
|
45
|
-
? otaStatus?.overallPercent ?? 0
|
|
46
|
-
: otaStatus?.stepPercent ?? 0;
|
|
46
|
+
? (otaStatus?.overallPercent ?? 0)
|
|
47
|
+
: (otaStatus?.stepPercent ?? 0);
|
|
47
48
|
return Math.min(Math.max(rawPercent, snapshot.mtkInstallStallSimulatedPercent ?? 0, 0), 100);
|
|
48
49
|
}
|
|
49
50
|
function progressScreen(snapshot) {
|
|
@@ -84,7 +85,9 @@ export function useMentraLiveOta(options = {}) {
|
|
|
84
85
|
const [updateFingerprint, setUpdateFingerprint] = useState(null);
|
|
85
86
|
const [offeredReleaseTransition, setOfferedReleaseTransition] = useState(null);
|
|
86
87
|
const [completedReleaseTransition, setCompletedReleaseTransition] = useState(null);
|
|
88
|
+
const [completedUpdate, setCompletedUpdate] = useState(false);
|
|
87
89
|
const [completedChangelogs, setCompletedChangelogs] = useState([]);
|
|
90
|
+
const [batteryBlocked, setBatteryBlocked] = useState(false);
|
|
88
91
|
const [checkGeneration, setCheckGeneration] = useState(0);
|
|
89
92
|
const performCheckGenerationRef = useRef(0);
|
|
90
93
|
const activeCheckKeyRef = useRef(null);
|
|
@@ -117,6 +120,7 @@ export function useMentraLiveOta(options = {}) {
|
|
|
117
120
|
const returnToCheck = useCallback(() => {
|
|
118
121
|
installActionPendingRef.current = false;
|
|
119
122
|
autoChainAdvancedRef.current = false;
|
|
123
|
+
setCheckState("checking");
|
|
120
124
|
setPage("check");
|
|
121
125
|
setCheckGeneration((generation) => generation + 1);
|
|
122
126
|
}, []);
|
|
@@ -125,6 +129,20 @@ export function useMentraLiveOta(options = {}) {
|
|
|
125
129
|
ota.clearProgress();
|
|
126
130
|
setPage("progress");
|
|
127
131
|
}, []);
|
|
132
|
+
const continueApprovedChain = useCallback((result) => {
|
|
133
|
+
if (installActionPendingRef.current || !isOtaAutoChainActive() || !result.updateInfo)
|
|
134
|
+
return false;
|
|
135
|
+
const snapshot = ota.snapshot();
|
|
136
|
+
if (!snapshot.wifiStatusKnown || (!snapshot.wifiConnected && snapshot.hotspotOtaVersion !== 1))
|
|
137
|
+
return false;
|
|
138
|
+
const admission = tryAdvanceOtaAutoChain(otaAutoChainFingerprint(result), result.updateInfo.isDowngrade === true, releaseRangeTargetVersion(result), result.releaseVersion);
|
|
139
|
+
if (!admission.advance)
|
|
140
|
+
return false;
|
|
141
|
+
checkCompletedRef.current = true;
|
|
142
|
+
ota.installSession.prepare(result);
|
|
143
|
+
navigateToProgress();
|
|
144
|
+
return true;
|
|
145
|
+
}, [navigateToProgress]);
|
|
128
146
|
useEffect(() => {
|
|
129
147
|
if (!runtimeReady || page !== "check")
|
|
130
148
|
return;
|
|
@@ -145,20 +163,20 @@ export function useMentraLiveOta(options = {}) {
|
|
|
145
163
|
const performCheck = async () => {
|
|
146
164
|
if (checkCompletedRef.current)
|
|
147
165
|
return;
|
|
148
|
-
if (!otaSnapshot.
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
if (remainingMs === null)
|
|
152
|
-
return;
|
|
153
|
-
reconnectTimeout = setTimeout(() => {
|
|
154
|
-
if (cancelled || myGeneration !== performCheckGenerationRef.current || ota.snapshot().connected)
|
|
155
|
-
return;
|
|
156
|
-
stopOtaAutoChain();
|
|
157
|
-
checkCompletedRef.current = true;
|
|
158
|
-
setCheckState("error");
|
|
159
|
-
}, remainingMs);
|
|
166
|
+
if (isOtaAutoChainActive() && !otaSnapshot.ready) {
|
|
167
|
+
const remainingMs = otaAutoChainReconnectWaitRemaining();
|
|
168
|
+
if (remainingMs === null)
|
|
160
169
|
return;
|
|
161
|
-
|
|
170
|
+
reconnectTimeout = setTimeout(() => {
|
|
171
|
+
if (cancelled || myGeneration !== performCheckGenerationRef.current || ota.snapshot().ready)
|
|
172
|
+
return;
|
|
173
|
+
stopOtaAutoChain();
|
|
174
|
+
checkCompletedRef.current = true;
|
|
175
|
+
setCheckState("error");
|
|
176
|
+
}, remainingMs);
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
if (!otaSnapshot.connected) {
|
|
162
180
|
if (checkStartedRef.current) {
|
|
163
181
|
stopOtaAutoChain();
|
|
164
182
|
checkCompletedRef.current = true;
|
|
@@ -235,31 +253,22 @@ export function useMentraLiveOta(options = {}) {
|
|
|
235
253
|
const fromVersion = currentReleaseVersion(ota.snapshot().appVersion);
|
|
236
254
|
setOfferedReleaseTransition(result.releaseVersion ? { fromVersion, toVersion: result.releaseVersion } : null);
|
|
237
255
|
}
|
|
238
|
-
if (isOtaAutoChainActive()) {
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
return;
|
|
242
|
-
if (!snapshot.wifiConnected && snapshot.hotspotOtaVersion !== 1) {
|
|
243
|
-
stopOtaAutoChain();
|
|
244
|
-
}
|
|
245
|
-
else {
|
|
246
|
-
const admission = tryAdvanceOtaAutoChain(fingerprint, result.updateInfo.isDowngrade === true, releaseRangeTargetVersion(result), result.releaseVersion);
|
|
247
|
-
if (admission.advance) {
|
|
248
|
-
checkCompletedRef.current = true;
|
|
249
|
-
ota.installSession.prepare(result);
|
|
250
|
-
navigateToProgress();
|
|
251
|
-
return;
|
|
252
|
-
}
|
|
253
|
-
}
|
|
256
|
+
if (isOtaAutoChainActive() && !ota.snapshot().wifiStatusKnown) {
|
|
257
|
+
checkCompletedRef.current = true;
|
|
258
|
+
return;
|
|
254
259
|
}
|
|
260
|
+
if (continueApprovedChain(result))
|
|
261
|
+
return;
|
|
255
262
|
checkCompletedRef.current = true;
|
|
256
263
|
setCheckState("update_available");
|
|
257
264
|
return;
|
|
258
265
|
}
|
|
259
|
-
|
|
266
|
+
const completedApprovedSession = isOtaAutoChainActive();
|
|
267
|
+
if (completedApprovedSession) {
|
|
260
268
|
setCompletedChangelogs(releaseChangelogsForActiveChain());
|
|
261
269
|
setCompletedReleaseTransition(releaseTransitionFromRange(otaAutoChainReleaseRange()));
|
|
262
270
|
}
|
|
271
|
+
setCompletedUpdate(completedApprovedSession);
|
|
263
272
|
stopOtaAutoChain();
|
|
264
273
|
checkCompletedRef.current = true;
|
|
265
274
|
ota.clearUpdateAvailable();
|
|
@@ -282,7 +291,40 @@ export function useMentraLiveOta(options = {}) {
|
|
|
282
291
|
if (reconnectTimeout)
|
|
283
292
|
clearTimeout(reconnectTimeout);
|
|
284
293
|
};
|
|
285
|
-
}, [
|
|
294
|
+
}, [
|
|
295
|
+
checkGeneration,
|
|
296
|
+
continueApprovedChain,
|
|
297
|
+
otaSnapshot.connected,
|
|
298
|
+
otaSnapshot.ready,
|
|
299
|
+
otaSnapshot.wifiStatusKnown,
|
|
300
|
+
page,
|
|
301
|
+
runtimeReady,
|
|
302
|
+
]);
|
|
303
|
+
useEffect(() => {
|
|
304
|
+
if (!runtimeReady ||
|
|
305
|
+
page !== "check" ||
|
|
306
|
+
(checkState !== "checking" && checkState !== "update_available") ||
|
|
307
|
+
!otaSnapshot.wifiStatusKnown ||
|
|
308
|
+
!isOtaAutoChainActive()) {
|
|
309
|
+
return;
|
|
310
|
+
}
|
|
311
|
+
const result = selectedCheckResultRef.current;
|
|
312
|
+
if (!result?.updateAvailable || !result.updateInfo)
|
|
313
|
+
return;
|
|
314
|
+
if (!otaSnapshot.wifiConnected && otaSnapshot.hotspotOtaVersion !== 1) {
|
|
315
|
+
setCheckState("update_available");
|
|
316
|
+
return;
|
|
317
|
+
}
|
|
318
|
+
continueApprovedChain(result);
|
|
319
|
+
}, [
|
|
320
|
+
checkState,
|
|
321
|
+
continueApprovedChain,
|
|
322
|
+
otaSnapshot.hotspotOtaVersion,
|
|
323
|
+
otaSnapshot.wifiConnected,
|
|
324
|
+
otaSnapshot.wifiStatusKnown,
|
|
325
|
+
page,
|
|
326
|
+
runtimeReady,
|
|
327
|
+
]);
|
|
286
328
|
useEffect(() => {
|
|
287
329
|
if (!runtimeReady || page !== "progress")
|
|
288
330
|
return;
|
|
@@ -322,8 +364,10 @@ export function useMentraLiveOta(options = {}) {
|
|
|
322
364
|
return () => clearTimeout(timeout);
|
|
323
365
|
}, [installSnapshot.connected, installSnapshot.displayState, page, returnToCheck]);
|
|
324
366
|
const check = useCallback(() => {
|
|
367
|
+
setBatteryBlocked(false);
|
|
325
368
|
setOfferedReleaseTransition(null);
|
|
326
369
|
setCompletedReleaseTransition(null);
|
|
370
|
+
setCompletedUpdate(false);
|
|
327
371
|
setCompletedChangelogs([]);
|
|
328
372
|
setPage("check");
|
|
329
373
|
setCheckState("checking");
|
|
@@ -339,6 +383,10 @@ export function useMentraLiveOta(options = {}) {
|
|
|
339
383
|
return;
|
|
340
384
|
}
|
|
341
385
|
const snapshot = ota.snapshot();
|
|
386
|
+
if (snapshot.batteryLevel !== null && snapshot.batteryLevel < MINIMUM_OTA_BATTERY_LEVEL) {
|
|
387
|
+
setBatteryBlocked(true);
|
|
388
|
+
return;
|
|
389
|
+
}
|
|
342
390
|
if (!snapshot.wifiStatusKnown) {
|
|
343
391
|
check();
|
|
344
392
|
return;
|
|
@@ -348,6 +396,8 @@ export function useMentraLiveOta(options = {}) {
|
|
|
348
396
|
return;
|
|
349
397
|
}
|
|
350
398
|
ota.installSession.prepare(result);
|
|
399
|
+
setBatteryBlocked(false);
|
|
400
|
+
setCompletedUpdate(false);
|
|
351
401
|
setCompletedChangelogs([]);
|
|
352
402
|
if (updateFingerprint) {
|
|
353
403
|
const fromVersion = offeredReleaseTransition
|
|
@@ -361,6 +411,12 @@ export function useMentraLiveOta(options = {}) {
|
|
|
361
411
|
}
|
|
362
412
|
navigateToProgress();
|
|
363
413
|
}, [check, isVersionChange, navigateToProgress, offeredReleaseTransition, page, updateFingerprint]);
|
|
414
|
+
useEffect(() => {
|
|
415
|
+
if (batteryBlocked &&
|
|
416
|
+
(otaSnapshot.batteryLevel === null || otaSnapshot.batteryLevel >= MINIMUM_OTA_BATTERY_LEVEL)) {
|
|
417
|
+
setBatteryBlocked(false);
|
|
418
|
+
}
|
|
419
|
+
}, [batteryBlocked, otaSnapshot.batteryLevel]);
|
|
364
420
|
const retryInstall = useCallback(() => {
|
|
365
421
|
if (page !== "progress")
|
|
366
422
|
return;
|
|
@@ -372,8 +428,11 @@ export function useMentraLiveOta(options = {}) {
|
|
|
372
428
|
onFinishedRef.current?.();
|
|
373
429
|
return;
|
|
374
430
|
}
|
|
375
|
-
|
|
376
|
-
|
|
431
|
+
const restartStillInProgress = installSnapshot.displayState === "restarting" ||
|
|
432
|
+
installSnapshot.versionChangePhase === "restarting" ||
|
|
433
|
+
installSnapshot.versionChangePhase === "verifying";
|
|
434
|
+
if (restartStillInProgress)
|
|
435
|
+
return;
|
|
377
436
|
const requiresGlassesReboot = shouldRequireGlassesRebootForBesFailure(installSnapshot.otaStatus, installSnapshot.otaProgress, installSnapshot.errorMsg);
|
|
378
437
|
if (requiresGlassesReboot)
|
|
379
438
|
stopOtaAutoChain();
|
|
@@ -395,10 +454,12 @@ export function useMentraLiveOta(options = {}) {
|
|
|
395
454
|
const state = useMemo(() => {
|
|
396
455
|
const hotspotSupported = otaSnapshot.hotspotOtaVersion === 1;
|
|
397
456
|
const canInstall = otaSnapshot.wifiStatusKnown && (otaSnapshot.wifiConnected || hotspotSupported);
|
|
457
|
+
const autoChainActive = isOtaAutoChainActive();
|
|
398
458
|
if (!runtimeReady) {
|
|
399
459
|
return {
|
|
400
460
|
screen: "initializing",
|
|
401
461
|
connected: otaSnapshot.connected,
|
|
462
|
+
batteryLevel: otaSnapshot.batteryLevel,
|
|
402
463
|
transport: null,
|
|
403
464
|
updateRequired: isUpdateRequired,
|
|
404
465
|
versionChange: isVersionChange,
|
|
@@ -424,33 +485,39 @@ export function useMentraLiveOta(options = {}) {
|
|
|
424
485
|
canDiscard: false,
|
|
425
486
|
canOpenWifiSetup: false,
|
|
426
487
|
continueDisabled: false,
|
|
488
|
+
completedUpdate: false,
|
|
427
489
|
releaseTransition: null,
|
|
428
490
|
changelogs: [],
|
|
429
491
|
};
|
|
430
492
|
}
|
|
431
493
|
if (page === "check") {
|
|
432
494
|
const wifiRequired = otaSnapshot.wifiStatusKnown && !otaSnapshot.wifiConnected && !hotspotSupported;
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
495
|
+
let screen;
|
|
496
|
+
if (checkState === "checking")
|
|
497
|
+
screen = autoChainActive ? "finishing" : "checking";
|
|
498
|
+
else if (checkState === "update_available") {
|
|
499
|
+
screen = wifiRequired ? "wifi_required" : batteryBlocked ? "battery_required" : "update_available";
|
|
500
|
+
}
|
|
501
|
+
else if (checkState === "no_update")
|
|
502
|
+
screen = "up_to_date";
|
|
503
|
+
else if (checkState === "dev_build")
|
|
504
|
+
screen = "dev_build";
|
|
505
|
+
else
|
|
506
|
+
screen = errorKind === "pin_unavailable" ? "update_info_unavailable" : "check_failed";
|
|
507
|
+
let error = null;
|
|
508
|
+
if (screen === "check_failed") {
|
|
509
|
+
error = {
|
|
510
|
+
code: "check_failed",
|
|
511
|
+
message: "Couldn't check for updates. Please check your connection and try again.",
|
|
512
|
+
};
|
|
513
|
+
}
|
|
514
|
+
else if (screen === "update_info_unavailable") {
|
|
515
|
+
error = { code: "update_info_unavailable", message: "Update information for this app version is unavailable." };
|
|
516
|
+
}
|
|
451
517
|
return {
|
|
452
518
|
screen,
|
|
453
519
|
connected: otaSnapshot.connected,
|
|
520
|
+
batteryLevel: otaSnapshot.batteryLevel,
|
|
454
521
|
transport: otaSnapshot.wifiConnected ? "wifi" : hotspotSupported ? "hotspot" : null,
|
|
455
522
|
updateRequired: isUpdateRequired,
|
|
456
523
|
versionChange: isVersionChange,
|
|
@@ -472,12 +539,17 @@ export function useMentraLiveOta(options = {}) {
|
|
|
472
539
|
canInstall: screen === "update_available" && canInstall,
|
|
473
540
|
canRetry: screen === "check_failed",
|
|
474
541
|
canFinish: screen === "up_to_date" || screen === "dev_build" || screen === "update_info_unavailable",
|
|
475
|
-
canDismiss: (screen === "update_available" || screen === "wifi_required") &&
|
|
542
|
+
canDismiss: (screen === "update_available" || screen === "wifi_required" || screen === "battery_required") &&
|
|
543
|
+
!isUpdateRequired &&
|
|
544
|
+
!autoChainActive,
|
|
476
545
|
canDiscard: false,
|
|
477
546
|
canOpenWifiSetup: screen === "wifi_required",
|
|
478
547
|
continueDisabled: false,
|
|
548
|
+
completedUpdate: screen === "up_to_date" && completedUpdate,
|
|
479
549
|
releaseTransition: screen === "update_available" || screen === "wifi_required"
|
|
480
|
-
?
|
|
550
|
+
? autoChainActive
|
|
551
|
+
? releaseTransitionFromRange(otaAutoChainReleaseRange())
|
|
552
|
+
: offeredReleaseTransition
|
|
481
553
|
: screen === "up_to_date"
|
|
482
554
|
? completedReleaseTransition
|
|
483
555
|
: null,
|
|
@@ -489,7 +561,8 @@ export function useMentraLiveOta(options = {}) {
|
|
|
489
561
|
const displayedError = requiresGlassesReboot
|
|
490
562
|
? BES_INSTALL_RESTART_MESSAGE
|
|
491
563
|
: installSnapshot.errorMsg || getOtaErrorMessage(installSnapshot.otaStatus?.error);
|
|
492
|
-
const
|
|
564
|
+
const progressState = progressScreen(installSnapshot);
|
|
565
|
+
const screen = progressState === "complete" && autoChainActive ? "finishing" : progressState;
|
|
493
566
|
const error = screen === "failed"
|
|
494
567
|
? {
|
|
495
568
|
code: requiresGlassesReboot ? "bes_restart_required" : "install_failed",
|
|
@@ -501,6 +574,7 @@ export function useMentraLiveOta(options = {}) {
|
|
|
501
574
|
return {
|
|
502
575
|
screen,
|
|
503
576
|
connected: installSnapshot.connected,
|
|
577
|
+
batteryLevel: otaSnapshot.batteryLevel,
|
|
504
578
|
transport: installSnapshot.transport,
|
|
505
579
|
updateRequired: isUpdateRequired,
|
|
506
580
|
versionChange: installSnapshot.isVersionChange,
|
|
@@ -523,18 +597,21 @@ export function useMentraLiveOta(options = {}) {
|
|
|
523
597
|
error,
|
|
524
598
|
canInstall: false,
|
|
525
599
|
canRetry: screen === "failed" && !requiresGlassesReboot,
|
|
526
|
-
canFinish: screen === "complete" ||
|
|
600
|
+
canFinish: screen === "complete" || (screen === "failed" && requiresGlassesReboot),
|
|
527
601
|
canDismiss: false,
|
|
528
602
|
canDiscard: screen === "disconnected",
|
|
529
603
|
canOpenWifiSetup: screen === "failed" && showChangeWifi,
|
|
530
604
|
continueDisabled: installSnapshot.continueButtonDisabled,
|
|
605
|
+
completedUpdate: false,
|
|
531
606
|
releaseTransition: releaseTransitionFromRange(otaAutoChainReleaseRange()),
|
|
532
607
|
changelogs,
|
|
533
608
|
};
|
|
534
609
|
}, [
|
|
535
610
|
checkState,
|
|
611
|
+
batteryBlocked,
|
|
536
612
|
completedChangelogs,
|
|
537
613
|
completedReleaseTransition,
|
|
614
|
+
completedUpdate,
|
|
538
615
|
errorKind,
|
|
539
616
|
firmwareRestarting,
|
|
540
617
|
installSnapshot,
|