ตั้งแต่วันที่ 27 มีนาคม 2025 เป็นต้นไป เราขอแนะนำให้ใช้ android-latest-release
แทน aosp-main
เพื่อสร้างและมีส่วนร่วมใน AOSP โปรดดูข้อมูลเพิ่มเติมที่หัวข้อการเปลี่ยนแปลงใน AOSP
การจัดการพลังงานของเสียง
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
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 UTC
[[["เข้าใจง่าย","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 UTC"],[],[],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."]]