自 2025 年 3 月 27 日起,我們建議您使用 android-latest-release
而非 aosp-main
建構及貢獻 AOSP。詳情請參閱「Android 開放原始碼計畫變更」。
音訊電源管理
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
為了支援車輛專屬的電源管理功能,Android 提供 CarPowerManagementService
服務和 CarPowerManager
介面。電源政策會影響 Android Automotive OS (AAOS) 音訊堆疊,以及具有音訊元件的音訊 HAL android.car.hardware.power.PowerComponent.AUDIO
。詳情請參閱「電源管理」。
在 CarAudioService
中,啟用動態音訊轉送功能時,CarAudioPowerListener
會在 CarPowerManagementService
上註冊。這可讓 CarAudioService
監聽與音訊相關的電源政策變更。當電源政策停用音訊時,系統會採取下列動作:
系統只會保留關鍵音訊屬性用法的焦點要求。其他焦點要求則會遭到放棄。
所有非必要音訊屬性使用情況的傳入焦點要求都會遭到拒絕。
如果使用車輛音量群組靜音功能,則會將不含關鍵音訊屬性用途的車輛音量群組設為靜音。
以下音訊屬性用法被視為重要:
在設定範例 (第 2 版)中,我們建議您為系統音效 (包括緊急和安全音效) 使用不同的音量群組,以便與主要音訊區中的其他內容區隔開來。如此一來,當您停用音訊時,所有非必要音訊屬性用途的音量群組都會靜音,而緊急和安全音效則不會靜音。
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2025-06-12 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-06-12 (世界標準時間)。"],[],[],null,["# Audio power management\n\nTo support vehicle-specific power management, Android provides a\n`CarPowerManagementService` service and a `CarPowerManager` interface. The power\npolicy affects the Android Automotive OS (AAOS) audio stack and the audio HAL\nwith the audio component, `android.car.hardware.power.PowerComponent.AUDIO`. To\nlearn more, see [Power Management](/docs/automotive/power/power).\n\nIn `CarAudioService`, a `CarAudioPowerListener` is registered on\n`CarPowerManagementService` when the dynamic audio routing is enabled. This\nallows `CarAudioService` to listen to power policy changes related to audio.\nWhen audio is disabled by the power policy, the following actions take place:\n\n- Only focus requests of critical audio attribute usages are retained. Other\n focus requests are abandoned.\n\n- All incoming focus requests of non-critical audio attribute usages are\n rejected.\n\n- If car volume group muting is used, car volume groups that do not contain\n audio context for critical audio attribute usages are muted.\n\nThe following audio attribute usages are considered as critical:\n\n- Emergency\n- Safety\n\nIn\n[Sample configuration (version 2)](/docs/automotive/audio/audio-policy-configuration#sample),\nwe recommend you use separate volume groups for system sounds, including emergency\nand safety, from other contexts in the primary audio zone. In this way, volume\ngroups for all non-critical audio attribute usages are muted when audio is\ndisabled, while emergency and safety sounds remain unmuted."]]