赞
踩
Android Automotive OS (AAOS) 是在核心 Android 音频堆栈的基础之上打造而成,以支持用作车辆信息娱乐系统的用例。AAOS 负责实现信息娱乐声音(即媒体、导航和通讯声音),但不直接负责具有严格可用性和计时要求的铃声和警告。虽然 AAOS 提供了信号和机制来帮助车辆管理音频,但最终还是由车辆来决定应为驾驶员和乘客播放什么声音,从而确保对保障安全至关重要的声音和监管声音能被确切听到,而不会中断。
当 Android 管理车辆的媒体体验时,应通过应用来代表外部媒体来源(例如电台调谐器),这类应用可以处理该来源的音频焦点和媒体键事件。
汽车音频系统可以处理以下声音和声音流:
Binder interface to callback the volume key events.
用于回调音量键事件的绑定程序接口。
ICarVolumeCallback代码位于:
packages/services/Car/service/src/com/android/car/audio/ICarVolumeCallback.aidl
ICarVolumeCallback的定义:
- interface ICarVolumeCallback {
- void onGroupVolumeChanged(int zoneId, int groupId, int flags);
- void onGroupMuteChanged(int zoneId, int groupId, int flags);
- void onMasterMuteChanged(int zoneId, int flags);
- }
AudioControlWrapper wraps IAudioControl HAL interface, handling version specific support so that the rest of CarAudioService doesn't need to know about it.
AudioControlWrapper包装了IAudioControl HAL接口,处理特定于版本的支持,因此CarAudioService的其余部分不需要知道它。
AudioControlWrapper代码位于:
packages/services/Car/service/src/com/android/car/audio/hal/AudioControlWrapper.java
AudioControlWrapper的定义:
public interface AudioControlWrapper {}
AudioControlWrapper方法:
- void unregisterFocusListener():关闭在音频控制 HAL 上注册的焦点侦听器。
- boolean supportsFeature(@AudioControlFeature int feature):指示 HAL 是否可以支持指定的功能。
- void registerFocusListener(HalFocusListener focusListener):向 IAudioControl 注册 HAL 音频焦点请求的侦听器。
- void registerAudioGainCallback(@NonNull HalAudioGainCallback gainCallback):使用 IAudioControl 注册 HAL 音频增益更改通知的回调。
- void unregisterAudioGainCallback():关闭在音频控制 HAL 上注册的音频增益回调。
- void onAudioFocusChange(@AttributeUsage int usage, int zoneId, int focusChange):通知 HAL 已发出的请求的音频焦点更改。
- void dump(IndentingPrintWriter writer):dumps the current state of the AudioControlWrapper
- void setFadeTowardFront(float value):Sets the fade for the vehicle.
- void setBalanceTowardRight(float value):Sets the balance value for the vehicle.
- void onDevicesToDuckChange(@NonNull List<CarDuckingInfo> carDuckingInfos):Notifies HAL of changes in usages holding focus and the corresponding ducking changes for a given zone.
- void onDevicesToMuteChange(@NonNull List<MutingInfo> carZonesMutingInfo):Notifies HAL of changes in muting changes for all audio zones.
- void linkToDeath(@Nullable AudioControlDeathRecipient deathRecipient):Registers recipient to be notified if AudioControl HAL service dies.
- void unlinkToDeath():Unregisters recipient for AudioControl HAL service death.
Framework focus listener interface to abstract away the specific HAL version
Framework 焦点侦听器接口,用于抽象出特定的 HAL 版本。
HalFocusListener代码位于:
packages/services/Car/service/src/com/android/car/audio/hal/HalFocusListener.java
HalFocusListener的定义:
- public interface HalFocusListener{
- void requestAudioFocus(@AttributeUsage int usage, int zoneId, int focusGain);
- void abandonAudioFocus(@AttributeUsage int usage, int zoneId);
- }
CarAudioManager是Android Automotive OS中提供的一个与车载音频相关的管理类,用于管理应用程序与车载音频的交互,CarAudioManager扩展了AudioManager的功能,同时增加了一些针对车载音频使用场景的特殊功能。
CarAudioManager代码位于:
packages/services/Car/car-lib/src/android/car/media/CarAudioManager.java
CarAudioManager的定义:
public final class CarAudioManager implements CarManagerBase {}
AudioManagerHelper 代码位于:
packages/services/Car/car-builtin-lib/src/android/car/builtin/media/AudioManagerHelper.Java
AudioManagerHelper 的定义:
public final class AudioManagerHelper {}
CarAudioSettings在Automotive OS系统中用于管理车载音频设置,其主要功能是控制车载系统的音量设置,以及配置提升和通知的音频设置。
CarAudioSettings代码位于:
packages/services/Car/car-lib/src/android/car/audio/CarAudioSettings.java
CarAudioSettings的定义:
public class CarAudioSettings {}
CarAudioService是Android Automotive OS系统中提供的一个服务,类似于AudioService,它管理整个车载音频系统,包括音频路由控制、音频设备管理、音量控制、焦点管理、车载媒体播放管理等。CarAudioService提供了对车辆音频系统功能和状态的控制,为车载音频应用提供便利,并支持多个应用程序同时执行音频任务。
CarAudioService代码位于:
packages/services/Car/service/src/com/android/car/audio/audioCarAudioService.java
CarAudioService的定义:
public class CarAudioService extends ICarAudio.Stub implements CarServiceBase {}
CarAudioContext在Android Automotive OS系统中用于管理车载音频场景相关的设置。在Android Auto中,可以通过它来管理不同的音频场景,例如导航、车载电话、媒体等,CarAudioContext包含的音频场景如下:
static final int MUSIC = 1:Music playback
static final int NAVIGATION = 2:Navigation directions
static final int VOICE_COMMAND = 3:Voice command session
static final int CALL_RING = 4:Voice call ringing
static final int CALL = 5:Voice call
static final int ALARM = 6:Alarm sound from Android
static final int NOTIFICATION = 7:Notifications
static final int SYSTEM_SOUND = 8:System sounds
static final int EMERGENCY = 9:Emergency related sounds such as collision warnings
static final int SAFETY = 10:Safety sounds such as obstacle detection when backing up or when changing lanes
static final int VEHICLE_STATUS = 11:Vehicle Status related sounds such as check engine light or seat belt chimes
static final int ANNOUNCEMENT = 12:Announcement such as traffic announcements
CarAudioContext代码位于:
packages/services/Car/service/src/com/android/car/audio/CarAudioContext.java
CarAudioContext的定义:
public final class CarAudioContext {}
CarVolume在Android Automotive OS系统中用于管理车载音量设置。在Android Auto中,可以通过它来控制车载音量,包括媒体音频、通话音量、通知音量等。同时,CarVolume还提供了一组API,用于处理车辆速度和声音关联的特殊需求。
CarVolume代码位于:
packages/services/Car/service/src/com/android/car/audio/CarVolume.java
CarVolume的定义:
final class CarVolume {}
A class encapsulates a volume group in car.
CarVolumeGroup 代码位于:
packages/services/Car/service/src/com/android/car/audio/CarVolumeGroup.java
CarVolumeGroup 的定义:
final class CarVolumeGroup {}
CarVolumeGroup代码位于:
packages/services/Car/service/src/com/android/car/audio/CarVolumeGroup.java
CarVolumeGroup的定义:
final class CarVolumeGroupMuting {}
继承于AudioPolicy.AudioPolicyVolumeCallback,用于接收与Volume更改相关的事件的回调类。
CarAudioPolicyVolumeCallback 代码位于:
packages/services/Car/service/src/com/android/car/audio/CarAudioPolicyVolumeCallback.java
CarAudioPolicyVolumeCallback 的定义:
- final class CarAudioPolicyVolumeCallback extends AudioPolicy.AudioPolicyVolumeCallback{
- public void onVolumeAdjustment(int adjustment)
- }
Manages callbacks for changes in car volume.
CarVolumeCallbackHandler代码位于:
packages/services/Car/service/src/com/android/car/audio/CarVolumeCallbackHandler.java
CarVolumeCallbackHandler的定义:
class CarVolumeCallbackHandler {}
CarAudioZone在Android Automotive OS系统中用于描述车载音频区域并提供音频设置。一个汽车通常有多个音频输出区域,例如,前排和后排,左侧和右侧等。CarAudioZone可以描述这些不同的音频区域,并提供相应的音频设置。
CarAudioZone代码位于:
packages/services/Car/service/src/com/android/car/audio/CarAudioZone.java
CarAudioZone的定义:
class CarAudioZone{}
汽车音频区域验证器
CarAudioZonesValidator代码位于:
packages/services/Car/service/src/com/android/car/audio/CarAudioZonesValidator.java
CarAudioZonesValidator的定义:
class CarAudioZonesValidator{}
A helper class loads all audio zones from the configuration XML file.
帮助程序类从配置 XML 文件加载所有音频区域。
CarAudioZonesHelper代码位于:
packages/services/Car/service/src/com/android/car/audio/CarAudioZonesHelper.java
CarAudioZonesHelper的定义:
class CarAudioZonesHelper {}
A helper class loads volume groups from car_volume_groups.xml configuration into one zone.
帮助程序类将volume groups 从car_volume_groups.xml配置加载到一个区域中。
CarAudioZonesHelperLegacy代码位于:
packages/services/Car/service/src/com/android/car/audio/CarAudioZonesHelperLegacy.java
CarAudioZonesHelperLegacy的定义:
class CarAudioZonesHelperLegacy {}
Manages audio focus on a per zone basis.
基于每个区域管理音频焦点。
CarZonesAudioFocus代码位于:
packages/services/Car/service/src/com/android/car/audio/CarZonesAudioFocus.java
CarZonesAudioFocus的定义:
final class CarZonesAudioFocus extends AudioPolicy.AudioPolicyFocusListener {}
CarAudioFocus在Android Automotive OS系统中用于控制车载音频角度相关设置。
CarAudioFocus代码位于:
packages/services/Car/service/src/com/android/car/audio/CarAudioFocus.java
CarAudioFocus的定义:
class CarAudioFocus extends AudioPolicy.AudioPolicyFocusListener {}
FocusInteraction is responsible for evaluating how incoming focus requests should be handled based on pre-defined interaction behaviors for each incoming {AudioContext} in relation to a {AudioContext} that is currently holding focus.
负责根据与当前持有焦点的 {AudioContext} 相关的每个传入 {AudioContext} 的预定义交互行为,评估如何处理传入的焦点请求。
FocusInteraction代码位于:
packages/services/Car/service/src/com/android/car/audio/FocusInteraction.java
FocusInteraction的定义:
final class FocusInteraction {}
FocusEntry代码位于:
packages/services/Car/service/src/com/android/car/audio/FocusEntry.java
FocusEntry的定义:
final class FocusEntry {}
CarDucking代码位于:
packages/services/Car/service/src/com/android/car/audio/CarDucking.java
CarDucking的定义:
final class CarDucking implements CarFocusCallback {}
Ducking information for a given car audio zone based on its focus state.
CarDuckingInfo代码位于:
packages/services/Car/service/src/com/android/car/audio/CarDuckingInfo.java
CarDuckingInfo的定义:
public final class CarDuckingInfo {}
CarDuckingUtils代码位于:
packages/services/Car/service/src/com/android/car/audio/CarDuckingUtils.java
CarDuckingUtils的定义:
final class CarDuckingUtils {}
A helper class wraps {@link AudioDeviceInfo}, and helps get/set the gain on a specific port in terms of millibels.
Note to the reader. For whatever reason, it seems that AudioGain contains only configuration information (min/max/step, etc) while the AudioGainConfig class contains the actual currently active gain value(s).
CarAudioDeviceInfo在Android Automotive OS系统中用于提供车载媒体系统和音频外设设备的信息。
CarAudioDeviceInfo代码位于:
packages/services/Car/service/src/com/android/car/audio/CarAudioDeviceInfo.java
CarAudioDeviceInfo的定义:
class CarAudioDeviceInfo {}
CarAudioDynamicRouting在Android Automotive OS系统中用于动态控制车载音频的路由。
CarAudioDynamicRouting代码位于:
packages/services/Car/service/src/com/android/car/audio/CarAudioDynamicRouting.java
CarAudioDynamicRouting的定义:
final class CarAudioDynamicRouting {}
CarAudioGainConfigInfo在Android Automotive OS系统中用于描述音频输入/输出通道的增益配置信息。
CarAudioGainConfigInfo代码位于:
packages/services/Car/service/src/com/android/car/audio/CarAudioGainConfigInfo.java
CarAudioGainConfigInfo的定义:
public class CarAudioGainConfigInfo {}
Provides audio gain callback registration helpers and implements AudioGain listener business logic.
提供音频增益回调注册帮助程序,实现音频增益监听器业务逻辑。
CarAudioGainMonitor代码位于:
packages/services/Car/service/src/com/android/car/audio/CarAudioGainMonitor.java
CarAudioGainMonit
final class CarAudioGainMonitor {}
Car HAL audio Utils
CarHalAudioUtils代码位于:
packages/services/Car/service/src/com/android/car/audio/CarHalAudioUtils.java
CarHalAudioUtils的定义:
public final class CarHalAudioUtils {}
CarAudioPlaybackCallback是在Android Automotive OS系统中用于音频播放事件的回调接口。
CarAudioPlaybackCallback代码位于:
packages/services/Car/service/src/com/android/car/audio/CarAudioPlaybackCallback.java
CarAudioPlaybackCallback的定义:
final class CarAudioPlaybackCallback extends AudioManager.AudioPlaybackCallback {}
CarAudioPowerListener代码位于:
packages/services/Car/service/src/com/android/car/audio/CarAudioPowerListener.java
CarAudioPowerListener的定义:
class CarAudioPowerListener {}
CarAudioPatchHandle是在Android Automotive OS系统中用于表示音频路径的句柄。
CarAudioPatchHandle代码位于:
packages/services/Car/service/src/com/android/car/media/CarAudioPatchHandle.java
CarAudioPatchHandle的定义:
public final class CarAudioPatchHandle implements Parcelable {}
Factory for constructing wrappers around IAudioControl HAL instances.
用于围绕 IAudioControl HAL 实例构造包装器的工厂。
AudioControlFactory代码位于:
packages/services/Car/service/src/com/android/car/audio/hal/AudioControlFactory.java
AudioControlFactory的定义:
public final class AudioControlFactory {}
Manages focus requests from the HAL on a per-zone per-usage basis.
基于每个区域的每次使用量管理 HAL 的焦点请求
HalAudioFocus代码位于:
packages/services/Car/service/src/com/android/car/audio/hal/HalAudioFocus.java
HalAudioFocus的定义:
- public final class HalAudioFocus implements HalFocusListener {
- private final class HalAudioFocusRequest {
- }
Wrapper for AIDL interface for AudioControl HAL.
Wrapper for IAudioControl@1.0.
Wrapper for IAudioControl@2.0.
AudioControlWrapper代码位于:
packages/services/Car/service/src/com/android/car/audio/hal/AudioControlWrapperAidl.java
packages/services/Car/service/src/com/android/car/audio/hal/AudioControlWrapperV1.java
packages/services/Car/service/src/com/android/car/audio/hal/AudioControlWrapperV2.java
AudioControlWrapper的定义:
- public final class AudioControlWrapperAidl implements AudioControlWrapper {
- private static final class FocusListenerWrapper extends IFocusListener.Stub {}
- private static final class AudioGainCallbackWrapper extends IAudioGainCallback.Stub {}
- }
- public final class AudioControlWrapperV1 implements AudioControlWrapper {}
- public final class AudioControlWrapperV2 implements AudioControlWrapper {}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。