fix(mobile): keep Android tablet cold launches in landscape#28825

merged1
main
GitHub fork: val/fix/android-tablet-cold-launch
opened10d agobyDDwite
View on GitHubTwo-way sync enabledPR last imported 5d ago

Fixes #28875.

Related: #24448 reports persistent HyperOS letterboxing; this PR does not claim device verification of that behavior.

Android tablet cold launches inherit the manifest's portrait lock before the runtime tablet policy runs. On an Android 15 Pixel Tablet emulator, the baseline shows a portrait-width splash with black side bars, then recovers to landscape. The candidate stays landscape during startup.

Remove the Android launcher activity's manifest orientation lock and apply the existing orientation policy before splash registration and super.onCreate. Keep the 600dp threshold, phone portrait policy, tablet FULL_USER policy, fold callback, configuration flags, and iOS behavior. Repeated prebuilds also migrate an existing generated activity without duplicating the call.

Based on the plugin fix and Expo tests in #18634, with added migration coverage and fresh native tablet evidence. This focused fix addresses an observed startup defect without adding a rotation preference or changing the established phone/tablet policy.

Before and after

Before and after tablet startup

Before cold-launch recording · After cold-launch recording

Both recordings start with the display in landscape and force-stop/relaunch the native app. The baseline starts from Settings; the candidate starts from the launcher after Settings automation failed. The stills are extracted from those recordings. The baseline's narrow splash is temporary; no persistent narrow-window defect is claimed on this emulator.

Verification

  • Pixel Tablet emulator, Android 15/API 35, 2560×1600 px, 320 dpi, 800dp short side. Real Debug development clients with the same JavaScript and isolated public demo data. No app-level orientation override was enabled.
  • Native baseline built from main 1d626d02d9 orientation inputs, fingerprint 971743703b097b8870b39ff842d130f50b115eeb; candidate 703f5e86ca, fingerprint 318ebbaa3f4f7346f8317ce1d80b466c0828b2af. Both native builds pass.
  • Two tests run Expo's real Android mods: both fail against the baseline plugin and pass with the fix. They cover the manifest, policy/order, repeated prebuilds, and migration of an existing generated activity.
  • vp run check:changed and git diff --check pass.
  • Phone runtime, fold transitions, Release startup, physical BYD hardware, and sensor rotation transitions remain unverified. Further device testing stopped after AgentDevice twice failed to open Android Settings with Failed to probe Android app sandbox ... run-as: package not an application. No phone device pass is claimed.

Integrated and verified with GPT-6.1 Sol through the Codex harness in T3 Code. The underlying plugin fix and original tests are credited to the contributors of #18634.

Checks

24 successful · 16 skipped
All checks passed
703f5e8

Added 1 commit

  • fix(mobile): apply tablet orientation before activity startup703f5e8
Synced from GitHub

Approvability

Verdict: Approved at 703f5e8

Macroscope's review found this PR approvable — The plugin applies the existing Android orientation policy earlier so tablet cold launches can remain in landscape. Phone portrait behavior and tablet rotation preferences remain unchanged.

You can add or adjust custom eligibility rules. Learn more.

Synced from GitHub

Review in Change Stack →

No actionable comments were generated in the recent review.

External image Recent review info
External image Run configuration
External image Commits

Reviewing files that changed from the base of the PR and between 3fd2b855c5c6b9169cdfe3733b34011c1c5ed4b7 and 703f5e86caf5646030b66e6208d8cda00a3d1715.

External image Files selected for processing: 2
  • apps/mobile/plugins/withAndroidTabletOrientation.cjs
  • apps/mobile/plugins/withAndroidTabletOrientation.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Walkthrough

The Android orientation plugin removes the launcher activity’s explicit screen orientation and places applyTabletOrientation() at the start of Kotlin MainActivity.onCreate. New prebuild tests check the generated manifest, orientation selection, and repeated-build stability.

Changes: Android tablet orientation

Layer / File(s)Summary
Manifest and activity orientation policy
apps/mobile/plugins/withAndroidTabletOrientation.cjs, apps/mobile/plugins/withAndroidTabletOrientation.test.ts
The plugin removes android:screenOrientation and ensures applyTabletOrientation() runs at the start of onCreate. Tests check the manifest config changes, the 600dp orientation threshold, and stable output across repeated prebuilds.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Low

Possibly related issues

  • pingdotgg/t3code#24448 — The issue describes a tablet opening in a portrait-sized window when launched in landscape. This change removes the manifest orientation lock and applies the tablet orientation policy before startup.

Suggested labels: bugfix, 📱 Native Change, size:S

Suggested reviewers: maria-rcks, macroscopeapp

Merge Risk: External image Minimal · up to 703f5

The orientation policy is applied earlier at startup. No merge-blocking issue was established; phone and fold transitions remain unverified on devices.

Pre-merge checks: Passed 4
Check nameStatusExplanation
Title checkPassedThe title "fix(mobile): keep Android tablet cold launches in landscape" matches the main change. The PR removes the launcher activity's manifest orientation lock and applies the existing tablet orient…
Linked Issues checkPassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes checkPassedCheck skipped because no linked issues were found for this pull request.
Description checkPassedThe pull request description is complete. It explains the startup problem, the implementation change, scope, issue context, verification results, visual evidence, unverified scenarios, and agent tooli…
Full details: Title check

Explanation

The title "fix(mobile): keep Android tablet cold launches in landscape" matches the main change. The PR removes the launcher activity's manifest orientation lock and applies the existing tablet orientation policy before splash registration and super.onCreate, so tablet cold launches stay in landscape. The title is specific, follows conventional commit form, and names the primary fix without listing files.

Full details: Description check

Explanation

The pull request description is complete. It explains the startup problem, the implementation change, scope, issue context, verification results, visual evidence, unverified scenarios, and agent tooling. It also states the specific test and build outcomes and avoids claiming unverified device coverage.

Finishing Touches
Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts