Skip to content

feat(emulator): add standard Android emulator controls - #19078

Open
ZiraiMode wants to merge 3 commits into
stablyai:mainfrom
ZiraiMode:ZiraiMode/feature-add-standard-android-emulator-controls-t
Open

ZiraiMode wants to merge 3 commits into
stablyai:mainfrom
ZiraiMode:ZiraiMode/feature-add-standard-android-emulator-controls-t

Conversation

@ZiraiMode

@ZiraiMode ZiraiMode commented Sep 6, 2026 •

Copy link
Copy Markdown

ELI5

The embedded Android emulator now has the everyday controls people expect from the standalone emulator, without confusing Android Power with shutting down the AVD.

What Changed

  • Added an Android-specific responsive toolbar with Power, volume, rotate-left/right, screenshot, zoom, Back, Home, and Overview controls.
  • Kept Back, Home, and Overview visible in narrow panes and moved lower-frequency actions into More.
  • Added capability-gated Fold/Unfold and Wear buttons, while keeping emulator shutdown as a separate lifecycle action.
  • Added host-to-renderer capability metadata, Power long-press, posture commands, PNG screenshot saving, centered zoom, and focused tests.

Why

Basic Android emulator use previously required CLI commands or the standalone Android Emulator window. The embedded pane should provide the same everyday controls without overloading Android Power as AVD shutdown.

Linked Issue

Fixes #18452

Visual Proof

Before (origin/main) After 1 After 2 After 3
Android emulator toolbar before Android emulator toolbar after 1 Android emulator toolbar after 2 Android emulator toolbar after 3

Testing

  • I manually tested these changes locally
  • Automated tests added/updated
  • macOS with the Pixel_9_Pro AVD: Back/Home/Overview, Power short/long press, volume, both rotation directions, screenshot save/cancel, zoom modes and centered scrolling, responsive overflow, and separate shutdown.
  • Fold/Wear capability variants: covered by focused automated tests; no matching local AVD was available.
  • Passed the focused emulator/runtime/renderer Vitest command.
  • Passed pnpm tc.
  • Passed pnpm run check:code-quality:changed.
  • Passed localization catalog, extraction, and coverage verification.
  • Passed pnpm run build:electron-vite.
  • Passed git diff --check origin/main...HEAD.
  • Full repository lint/test/build: covered by PR CI.
  • Linux/Windows/SSH were not manually exercised. Device control stays on the existing emulator runtime boundary; new inventory fields are optional so older consumers ignore them and missing fields use conservative UI fallbacks.

AI Disclosure

Review

Self-reviewed the Power-versus-shutdown separation, capability fallbacks, ADB argument construction, renderer frame hot path, cross-platform paths, mixed-version optional fields, and performance.

Agent skill upstream boundary

  • Not applicable.

Notes

No repository assets were added for visual proof.

Checklist

  • This PR is small and focused — it is focused on [Feature]: Add standard Android Emulator controls to the embedded emulator pane #18452, but the end-to-end runtime/UI/test change is not small
  • I explained what changed and why (including ELI5)
  • Before/after screenshots are included
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered
  • Local focused checks pass; full pnpm lint, pnpm test, and pnpm build are covered by CI

@ZiraiMode
ZiraiMode marked this pull request as ready for review September 6, 2026 13:34
@coderabbitai

coderabbitai Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Team

Run ID: 998ac6e2-604e-4adc-a113-f50fcaf7a876

📥 Commits

Reviewing files that changed from the base of the PR and between 0365d232c39e9882ba305a5392d86e6e37b3c93b and 6e55fba.

📒 Files selected for processing (2)
  • src/main/emulator/android/android-emulator-input-controller.ts
  • src/main/emulator/backends/android-emulator-backend.test.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.


📝 Walkthrough

Walkthrough

The change adds Android device capability inspection and propagates capability metadata through inventory, backend, runtime, and renderer layers. It adds posture and long-press button commands, backend target resolution, Android toolbar controls, zoom handling, center-anchored scrolling, and screenshot capture. New tests cover capability probes, RPC validation, control behavior, device mapping, zoom state, stream handling, and screenshot saving.

Merge Risk: ⚪ Minimal · up to 6e55f

Android emulator controls, posture handling, and input coordinate updates are covered without an identified current-head merge-blocking risk.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 55 functions across 47 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the primary change: adding standard Android emulator controls.
Description check ✅ Passed The description includes the required sections, linked issue, visual proof, testing details, AI disclosure area, review notes, and checklist context. It is complete enough for review.
Linked Issues check ✅ Passed The changes address the requirements in [18452]: Android Power, volume, rotation, screenshot, zoom, Back, Home, Overview, responsive overflow, separate shutdown, and capability-gated Fold/Wear control…
Out of Scope Changes check ✅ Passed The changes remain focused on implementing and testing Android emulator controls. Supporting backend resolution, capability propagation, screenshot encoding, zoom behavior, and UI refactoring are dire…
  • Fix all pre-merge checks with AI

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Team

Run ID: 19a77555-d7d1-4916-b2af-7b055842f20e

📥 Commits

Reviewing files that changed from the base of the PR and between f952f1a and 0365d232c39e9882ba305a5392d86e6e37b3c93b.

📒 Files selected for processing (48)
  • src/main/emulator/android/android-device-control-capabilities.test.ts
  • src/main/emulator/android/android-device-control-capabilities.ts
  • src/main/emulator/android/android-device-inventory.ts
  • src/main/emulator/android/android-emulator-input-controller.ts
  • src/main/emulator/android/android-input-commands.test.ts
  • src/main/emulator/android/android-input-commands.ts
  • src/main/emulator/android/android-input-mapping.ts
  • src/main/emulator/backends/android-emulator-backend.test.ts
  • src/main/emulator/backends/android-emulator-backend.ts
  • src/main/emulator/backends/emulator-backend.ts
  • src/main/emulator/emulator-backend-resolver.ts
  • src/main/emulator/emulator-bridge.test.ts
  • src/main/emulator/emulator-bridge.ts
  • src/main/emulator/emulator-session-registry.test.ts
  • src/main/emulator/emulator-session-registry.ts
  • src/main/runtime/orca-runtime-emulator.ts
  • src/main/runtime/rpc/methods/emulator.test.ts
  • src/main/runtime/rpc/methods/emulator.ts
  • src/renderer/src/components/browser-pane/annotate/markup-screenshot-compose.ts
  • src/renderer/src/components/emulator-pane/EmulatorPane.test.tsx
  • src/renderer/src/components/emulator-pane/EmulatorPane.tsx
  • src/renderer/src/components/emulator-pane/android-emulator-toolbar-action-components.tsx
  • src/renderer/src/components/emulator-pane/android-emulator-toolbar-controls.tsx
  • src/renderer/src/components/emulator-pane/emulator-device-frame-layout.ts
  • src/renderer/src/components/emulator-pane/emulator-device-frame.tsx
  • src/renderer/src/components/emulator-pane/emulator-device-row-mapping.test.ts
  • src/renderer/src/components/emulator-pane/emulator-device-row-mapping.ts
  • src/renderer/src/components/emulator-pane/emulator-pane-toolbar.test.tsx
  • src/renderer/src/components/emulator-pane/emulator-pane-toolbar.tsx
  • src/renderer/src/components/emulator-pane/emulator-pane-types.ts
  • src/renderer/src/components/emulator-pane/emulator-pane-zoom.test.ts
  • src/renderer/src/components/emulator-pane/emulator-pane-zoom.ts
  • src/renderer/src/components/emulator-pane/emulator-screen-stream-content.tsx
  • src/renderer/src/components/emulator-pane/emulator-screen-surface.tsx
  • src/renderer/src/components/emulator-pane/save-emulator-screenshot.test.ts
  • src/renderer/src/components/emulator-pane/save-emulator-screenshot.ts
  • src/renderer/src/components/emulator-pane/use-center-anchored-emulator-scroll.test.tsx
  • src/renderer/src/components/emulator-pane/use-center-anchored-emulator-scroll.ts
  • src/renderer/src/components/emulator-pane/use-emulator-device-frame-layout.ts
  • src/renderer/src/components/emulator-pane/use-emulator-device-inventory.ts
  • src/renderer/src/components/emulator-pane/use-emulator-pane-controls.ts
  • src/renderer/src/components/emulator-pane/use-emulator-pane-session.test.tsx
  • src/renderer/src/components/emulator-pane/use-emulator-pane-session.ts
  • src/renderer/src/components/emulator-pane/use-emulator-pane-zoom.test.tsx
  • src/renderer/src/components/emulator-pane/use-emulator-video-stream.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/lib/canvas-png-data-url.ts
  • src/shared/emulator-device-controls.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.

@ZiraiMode
ZiraiMode force-pushed the ZiraiMode/feature-add-standard-android-emulator-controls-t branch from 0365d23 to 4e930de Compare September 6, 2026 14:12

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Add standard Android Emulator controls to the embedded emulator pane

1 participant