Skip to content

feat(lifecycle): support multi-resume and adaptive multi-window mode - #40

Open
yanwuu wants to merge 1 commit into
shilapi:masterfrom
yanwuu:feat/multi-resume-split-screen
Open

yanwuu wants to merge 1 commit into
shilapi:masterfrom
yanwuu:feat/multi-resume-split-screen

Conversation

@yanwuu

@yanwuu yanwuu commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Support Android Multi-Resume and adaptive multi-window mode to prevent frame drops, rendering pauses, and layout clipping when running CarPlay side-by-side in split screen or floating windows.

Note on Origin: This feature was originally developed and authored by me for shihabal3amri/DiPlay. I am now extracting and contributing this generic enhancement directly to upstream shilapi/xcertplay.


Motivation & Problem

  1. Frame Freezing in Split-Screen (Android 9/10):
    In split-screen mode on Android 9 (API 28) and Android 10, when the user touches another application (e.g. car launcher or navigation map), Android transitions CarPlayHostActivity into the PAUSED state. On many car head units (Qualcomm, MTK, Rockchip BSPs), paused activities suffer compositor frame throttling, Surface buffer starvation, and rendering freezes.
  2. System Bar Conflicts:
    Forcibly hiding status and navigation bars inside split screen can corrupt window decorations and cut off the vehicle's system bar / dock controls.
  3. Resolution Adaptation:
    Entering/exiting split screen changes dimensions without activity recreation, requiring stream rescheduling.

Key Changes

  • Android Multi-Resume: Added <meta-data android:name="android.allow_multiple_resumed_activities" android:value="true" /> under <application> in AndroidManifest.xml to keep both windows in the RESUMED state on Android 9/10.
  • Adaptive Fullscreen: In applyFullscreenMode(), avoid force-hiding system bars when isInMultiWindowMode is true.
  • Lifecycle Callback: Implemented onMultiWindowModeChanged in CarPlayHostActivity to re-apply bars and post scheduleDisplaySize() on videoView.
  • Manifest: Added android:supportsPictureInPicture="true" and android:resizeableActivity="true".

- Add android.allow_multiple_resumed_activities meta-data to enable
  multi-resume on Android 9 (API 28) and Android 10, preventing frame
  drops and rendering suspension when interacting with another app in
  split-screen or floating multi-window mode.
- Implement onMultiWindowModeChanged to trigger dynamic resolution
  re-scheduling when entering/exiting multi-window mode.
- Avoid force-hiding status and navigation bars while in multi-window
  mode to preserve split-screen boundaries and car system dock controls.
- Add supportsPictureInPicture and ensure resizeableActivity is declared
  consistently across activities.
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.

1 participant