Repository navigation
Conversation
- 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Resolves #36 by introducing Android system
AudioFocusmanagement and automatic ducking/muting for CarPlay audio playback on Android head units.Problem
In vehicle environments, native infotainment components (such as Bluetooth telephone calls, native FM/AM radio, backup radar chimes, or native voice assistants) dynamically request Android audio focus.
Previously,
xcertplaydid not participate in Android'sAudioFocuslifecycle. When a native audio event occurred:Solution
AudioFocusCoordinator:AudioFocusRequestbased on active stream priority:MEDIA->AUDIOFOCUS_GAINPHONE->AUDIOFOCUS_GAIN_TRANSIENTASSISTANT->AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCKNAVIGATION-> Coexists without claiming exclusive focus.0.2f) upon receivingAUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK.0.0f) uponAUDIOFOCUS_LOSS_TRANSIENT(e.g. during incoming/outgoing car Bluetooth phone calls or native car voice interruptions).AUDIOFOCUS_GAIN.Audio focusandMute media on temporary focus losstoggles in Settings -> Audio section (persisted inAirPlayPersistence).AudioFocusCoordinatorTestcovering channel focus priorities and volume constants.中文说明
问题背景:
在车机场景下,车载蓝牙电话、原车调频广播、倒车雷达提示音以及车载语音助手会随时请求 Android 系统音频焦点。此前
xcertplay未接入 Android 音频焦点监听,导致在蓝牙来电或原车播报时,CarPlay 音乐依旧全音量播放,发生声音撞车或在部分车机上引发异常(对应 Issue #36)。解决方案:
AudioFocusCoordinator):根据通道类型动态申请对应级别的音频焦点(媒体流申请长期焦点,通话/语音申请临时焦点,导航流不独占焦点)。LOSS_TRANSIENT_CAN_DUCK)时,自动压低 CarPlay 音乐音量至 20%。LOSS_TRANSIENT,如原车蓝牙电话接通)时,自动将媒体流静音(0%),电话挂断并重获焦点(GAIN)后自动恢复 100% 音量。