Repository navigation
feat(serve-emu): expose Android emulator fold controls - #135
Conversation
| @@ -0,0 +1,5 @@ | |||
| --- | |||
| 'expo-device-hub': minor | |||
There was a problem hiding this comment.
🟡 Fold controls omitted from Hub releases
The new changeset targets expo-device-hub's ignored dependency serve-emu instead of expo-device-hub. Changesets excludes serve-emu, so this feature does not trigger a Hub release.
Learn more
The Changesets configuration ignores serve-emu. The published Hub package vendors that code rather than publishing serve-emu independently, so a changeset targeting the ignored name cannot version the Hub release. The repository release guidance requires changes that ship in Hub to target expo-device-hub.
Example: A release run after merging this feature sees no new expo-device-hub changeset from the fold controls and leaves Hub at its previous version instead of scheduling the minor release.
Recommended fix: Target expo-device-hub in this changeset so the release workflow versions the package that distributes the new API.
| 'expo-device-hub': minor | |
| 'expo-device-hub': minor |
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
This finding does not match the PR diff: .changeset/android-fold-controls.md already targets 'expo-device-hub': minor, the package that publishes Hub. No changeset change is needed.
| const posture = name ? POSTURES[name] : undefined; | ||
| return { | ||
| supported: true, | ||
| posture: name ? posture ?? null : angle <= 5 ? "closed" : angle >= 175 ? "opened" : null, |
There was a problem hiding this comment.
🟡 Unknown state names hide fold posture
When base-state reports an unfamiliar name, getFoldStatus returns a null posture even at a closed or opened hinge angle. setFoldPosture then rejects a successful command because its confirmation never sees the requested posture.
Learn more
An emulator can report a hinge sensor reading and a physical state name not present in POSTURES. The name branch now discards the angle fallback for such states. During setFoldPosture, the command can succeed, but every status read returns a null posture until confirmation times out.
Example: An emulator reports hinge-angle0 = 0 and Committed state: DeviceState{identifier=2, name='FOLDED'}. A request to close it succeeds at the console but returns Emulator did not confirm closed posture instead of the closed status.
Recommended fix: Preserve angle-based fallback when POSTURES[name] is undefined, while keeping recognized names such as TENT authoritative over extreme hinge angles.
Was this helpful? React with 👍 or 👎 to provide feedback.
Android foldable emulators can report their hinge angle and physical device state and accept fold/unfold commands, but serve-emu did not expose those capabilities to API clients.
This adds typed
GET /api/foldstatus andPOST /api/foldcontrol to both serve-emu HTTP hosts. Status uses read-only emulator console and Android physical-state queries, so polling does not enable or reconfigure gRPC. Commands use the emulator's documentedfold/unfoldactions and read back the resulting posture. Physical Android devices and emulator profiles without a hinge sensor report unsupported. Commands are limited toclosedandopened; continuous hinge-angle control is outside this change.Validation:
bun run --filter serve-emu check— 1,094 tests passed, typecheck, build, docs sync, and package smoke test passed.opened/180° status →closed/0° →opened/180°, with status read back after each command. No gRPC endpoint was activated during the run.Built with Codex (GPT-6 Sol).