Correctness:
- Pair-glasses flows no longer strand the app in the manual-disconnected
state: the pre-scan disconnect is followed by resumeAutoReconnect(), and
the config page's scan hand-off drops the live link too.
- The mixed-arms serial warning is reachable now: pairs() groups by the
canonical serial key, and a lone left + lone right with different serials
get the mismatch warning on both rows (it previously required two
different serials inside one serial-keyed group, which cannot happen).
- A selected pair that degrades to one arm (prune while the page is open)
is deselected, and Save never pads a missing arm from stored addresses.
- DiscoveryAggregator.ingest no longer lets a bonded re-emit or split
advertisement overwrite the note/name/flag learned from a full
advertisement, and reclassifies split reports using remembered fields so
a nameless half doesn't drop the arm.
- estimateProximity ignores the advertised TX Power Level (radiated power,
not measured-power-at-1m); the calibration table is the only reference.
- Saving a ring without a glasses pair updates the stored identity's ring
name/address instead of leaving the previous ring on record.
- Ring detection requires the stock "EVEN R1" name prefix in both the TS
classifier and the Java pre-filter; a bare "R1" substring matched
unrelated devices, and ring rows are always selectable.
- One-shot scans keep every sample (buildAddressSet merges them through
DiscoveryAggregator), and flash-flow address resolution takes left/right
from one serial-joined complete pair instead of latest-per-role.
Lifecycle:
- The pairing scan and its refresh timer pause on app suspend and resume
with the app, and the model's app-event hooks are detached when the page
is left for good.
Cleanup:
- One MAC normalizer (even-advertisement.normalizeMacAddress, re-exported
by device-addresses), used for the ring "Yours" comparison too.
- One serial-equality definition (serialKey/serialsMatch); the containment
fallback in isPreviouslyPaired is gone.
- Shared formatErrorMessage replaces five per-view-model copies; shared
hex-util replaces the duplicate TS hex codecs; one Java bytesToHex in
FaceclawFirmwareUtil replaces three hand-rolled encoders.
- glassesRow/ringRow share a presentation-base helper; dead row address
fields, the constant glassesSectionVisibility, the identical-branch
status ternary, and zoneRank/ZONE_ORDER are removed.
- .gitignore now actually covers .test-build/ as tests/README claims.
UI:
- Dark-mode styles for the pairing page: readable instructions, dark-gray
cards with consistent light text; light mode keeps its current look.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016ZqzwmRQ3HQxasBz5rYyZV
Removes unused keyword-spotting model. Makes on-device voice model a
runtime download rather than bundling it. Removes native-code library
versions for 32-bit and x86_64 processors.
Stream BLE advertisements into a dedicated pairing flow with arm, ring, serial, and hardware variant detection.
Add proximity ranking, device artwork, pairing safeguards, and unit coverage for discovery and candidate grouping.
We're going to extend the Faceclaw app onboarding process to include checking for and installing the custom firmware (currently handled externally with the scripts in ../g2flash). We'll add script scripts/resetOnboarding.sh that uses adb to reset the app on the attached phone to default/pre-onboarding state for testing. The onboarding process will explain that it's only compatible with custom firmware, with options to either skip and try out the app using only the phone-screen preview (instead of pairing with glasses), or proceed with flashing.
If the user proceeds with flashing, we first connect to the glasses (with the existing mechanism), and display an on-glasses confirmation prompt. Because this prompt needs compatibility with stock firmware, it will use a different subset of the BLE protocol than the main app does (in particular, no image containers), so we'll have a separate bluetooth communication class rather than extending FaceclawBleCommunicator. We'll send an init message to start a Hub app, initialize a layout with a text container and a list, populate the text container with a message saying that flashing will void warranty and the list with No and Yes, set up a keepalive/heartbeat message timer, and wait for a menu selection. (Refer to ../g2-kit-unofficial/ble/docs and ../g2-kit-unofficial/ble/gen for protocol details). If the prompt is approved, we go to the flashing screen.
On the flashing screen, we first download the official firmware, apply patches to it, and check that it has the expected result hash. See ../g2flash/build_cfw.sh and ../g2flash/apply_patches.py for details.
Let's implement everything prior to the update itself now, ie, the on-device confirmation prompt, and downloading, patching and verifying the modded firmware.
scripts/resetOnboarding.sh is meant to reset a pref so that Faceclaw reruns its first-run onboarding on next launch, but fails with "No onboarding keys were set. App is already in pre-onboarding state." (And onboarding doesn't trigger on next launch)
Thanks. I tested the on-glasses prompt on real hardware and it worked as expected. Next up, let's port the flashing procedure itself.
One detail of the flashing procedure worth noting: the two lenses get updated separately, and at the end of updating either lens, both lenses get rebooted, creating a brief period when neither is reachable, so the timeout to look for the second lens should not be too short.