Android Automotive OS (AAOS) uses flags and configurations to enable different features, starting with dynamic routing to more generic feature flags, such as volume control from the car service. Current AAOS configuration flags for audio management are described here.
| Flag | Purpose | 
|---|---|
| audioUseDynamicRouting | Defined in the car service config file to
    Enable AAOS routing.
    The config must be set to true. Whenfalse,
    routing and much ofCarAudioService, are disabled and the OS
    falls back to the default behavior described in
    Configuring audio policies. | 
| useCoreAudioRouting | Defined in the car service config file to
    enable AAOS core audio routing management.
    When the value is set to true, car audio service uses
    the configuration definitions setup with the
    configurable audio policy engine.
    If value is set tofalse, the routing management falls back
    to use the car audio service dynamic audio policy mix definition as
    configured usingaudioUseDynamicRouting. | 
| useCoreAudioVolume | Defined in the car service config file to
    enable AAOS core audio volume management.
    When the value is set to true, car audio service uses
    the volume groups definitions setup with the
    configurable audio policy engine.
    If the value is set tofalse, the volume management falls back
    to use the car audio service default volume group definition as configured
    usingaudioUseDynamicRouting. | 
| audioUseCarVolumeGroupMuting | Defined in the car service config file to enable the muting of individual
    volume groups. When set to false(the default value), muting of
    individual volume groups is disabled. Instead, muting toggles master mute.
    When set totrue, car volume group muting is enabled and each
    individual volume group can be muted separately. Whentrue,
    volume group muting must be implemented at the
    Audio Control HAL. | 
| audioUseHalDuckingSignals | Defined in the car service config file to enable the IAudioControl#onDevicesToDuckChangeAPI to inform HAL when to
    duck. Whentrue(default value), the API receives signals indicating which
    output devices to duck and what usages hold focus. Whenfalse,
    the API is not called. The API isn't called unless the
    Audio Control HAL
    implements ducking. | 
| config_oemCarService | Defined in the car service config file, this is the component name for
    the OEM customization service. OEMs can opt to implement this service to
    customize car service actions for different policies. If OEMs opt to
    implement this component, they must implement a service to extend OemCarServiceexposed by car-lib, and then implement
    the required component services. For car audio service specifically, OEMs
    can implement any of the audio sub services to manage audio action. For
    details, see
    Car Audio Plugin Service.
    If the component name is invalid,CarServicewouldn't connect
    to any OEM service. The component name can't be a third party package. It
    must be pre-installed. | 
| audioVolumeAdjustmentContextsVersion | Defined in the car service config file, configuration to select the version of volume adjustment context priority list. Version 1 includes all audio contexts, in this order: 
 Version 2 is limited to the following contexts, in this order. The default version is  
 | 
| audioPersistMasterMuteState | Defined in the car service config file, configuration to persist global
    mute state. When true(the default value) Android restores the
    global mute state on boot. WhenaudioUseCarVolumeGroupMutingistrue, this has no impact on persisting mute changes as mute
    changes are based on individual volume groups. The default value is set totrueand must be overwritten when master mute shouldn't be
    persisted for a device. | 
| audioVolumeKeyEventTimeoutMs | Defined in the car service config file, configuration to indicate the timeout in milliseconds while a car volume group is considered active for volume control changes during volume key events. The configuration is used as follows: 
 The default value is  | 
| audioUseCarVolumeGroupEvent | Defined in the car service config file, configuration to enable callback
    events to volume groups. When true, clients receive callback
    throughICarVolumeGroupEventto events that impact volume
    groups. When enabled:
 The default value is  | 
| config_useFixedVolume | Defined in frameworks/base/core/res/res/values/config.xml.
    Must be set totrueto allow for car audio service to manage
    volume control. When theconfig_useFixedVolumeflag is not
    set, or is set tofalse(the default value), apps can call theAudioManagervolume management APIs and change the volume by
    stream type in the software mixer. This may be undesirable because of the
    potential effect on other apps and the fact that volume attenuation in the
    software mixer can result in fewer significant bits available in the
    signal when received at the hardware amplifier. New devices that have not
    been configured and that are set totruereceive volume changes
    through theAudioManagervolume and mute APIs. | 
| config_handleVolumeKeysInWindowManager | Defined in frameworks/base/core/res/res/values/config.xml, must
    be set totrueto allow for car audio service to intercept
    volume key events. If set tofalse(the default value) volume
    key events can be forwarded to the foreground app and can lead to adverse
    results from volume key event management outside the car audio service. | 
| audioUseMinMaxActivationVolume | Defined in the car service config file to enable
    
    minimum and maximum activation volume. When true, the volume gain index can be adjusted due to
    minimum and maximum activation volume management. Whenfalse(default value), minimum and maximum activation volume doesn't take effect. | 
| audioUseFadeManagerConfiguration | Defined in the car service config file to enable
    
    system-enforced audio focus loss behavior. When true,
    car audio framework parses the car audio fade config definitions and
    applies the respectiveFadeManagerConfigurationwhen dispatching
    audio focus loss. Whenfalse(default value), the system doesn't
    enforce fade behavior when an app loses audio focus. | 
Car audio service configs
Before Android 13, car service configs were overwritten
with a product configuration overlay (to learn more, see
Customizing the build with resource overlays)
for the packages/services/Car/service/res/values/config.xml file.
PRODUCT_PACKAGE_OVERLAYS := <path_to_overlay>
The location of the config file from <path_to_overlay> to the actual
location should include packages/services/Car/service/res/values/.
Car service RROs
Since Android 13, AAOS supports
Runtime resource overlays. Use an RRO to change the
value of the car audio configuration. For example, see the RROs for the
automotive cuttlefish reference in
device/google/cuttlefish/shared/auto/rro_overlay/. The
audioUseDynamicRouting config is overridden in
device/google/cuttlefish/shared/auto/rro_overlay/CarServiceOverlay/res/values/config.xml.
<resources>
    <bool name="audioUseDynamicRouting">true</bool>
...
The resource overlay map is contained in
device/google/cuttlefish/shared/auto/rro_overlay/CarServiceOverlay/res/xml/overlays.xml:
<overlay>
...
  <item target="bool/audioUseDynamicRouting"
value="@bool/audioUseDynamicRouting" />
...
</overlay>
The resource overlay manifest defined in
device/google/cuttlefish/shared/auto/rro_overlay/CarServiceOverlay/AndroidManifest.xml
contains the targetPackage set as com.android.car.updatable.
See these resources for more information:
Feature-enabled API
The method returns true if the feature is enabled on the device, otherwise
false. In the CarAudioManager#isAudioFeatureEnabled API, the parameter
passed in must be one of:
- AUDIO_FEATURE_DYNAMIC_ROUTING
- AUDIO_FEATURE_VOLUME_GROUP_MUTING
- AUDIO_FEATURE_OEM_AUDIO_SERVICE
- AUDIO_FEATURE_VOLUME_GROUP_EVENTS
- AUDIO_FEATURE_AUDIO_MIRRORING
