Remove AUDIO_* properties.
See go/aae-audio for an implementation guide for automotive that does
not rely upon these car specific properties. The very small remaining
automotive specific elements will be represented in the automotive audio
control HAL.
Change-Id: Ia2147a8e486bdb896097771970f0527fc630b9c4
Test: not yet. Will run vhal VTS tests.
diff --git a/automotive/vehicle/2.0/Android.bp b/automotive/vehicle/2.0/Android.bp
index 7ab2387..ffe012e 100644
--- a/automotive/vehicle/2.0/Android.bp
+++ b/automotive/vehicle/2.0/Android.bp
@@ -42,19 +42,6 @@
"VehicleAreaSeat",
"VehicleAreaWindow",
"VehicleAreaZone",
- "VehicleAudioContextFlag",
- "VehicleAudioExtFocusFlag",
- "VehicleAudioFocusIndex",
- "VehicleAudioFocusRequest",
- "VehicleAudioFocusState",
- "VehicleAudioHwVariantConfigFlag",
- "VehicleAudioRoutingPolicyIndex",
- "VehicleAudioStream",
- "VehicleAudioStreamFlag",
- "VehicleAudioVolumeCapabilityFlag",
- "VehicleAudioVolumeIndex",
- "VehicleAudioVolumeLimitIndex",
- "VehicleAudioVolumeState",
"VehicleDisplay",
"VehicleDrivingStatus",
"VehicleGear",
diff --git a/automotive/vehicle/2.0/types.hal b/automotive/vehicle/2.0/types.hal
index 8e1b164..7e42781 100644
--- a/automotive/vehicle/2.0/types.hal
+++ b/automotive/vehicle/2.0/types.hal
@@ -906,346 +906,6 @@
| VehicleArea:GLOBAL),
/**
- * Represents audio focus state of Android side. Note that car's audio
- * module must own audio focus and grant audio focus to Android side when
- * requested by Android side. The focus has both per stream characteristics
- * and global characteristics.
- *
- * Focus request (get of this property) must take the following form with indices defined
- * by VehicleAudioFocusIndex:
- * int32Values[0]: VehicleAudioFocusRequest type
- * int32Values[1]: bit flags of streams requested by this focus request.
- * There can be up to 32 streams.
- * int32Values[2]: External focus state flags. For request, only flag like
- * VehicleAudioExtFocusFlag#PLAY_ONLY_FLAG or
- * VehicleAudioExtFocusFlag#MUTE_MEDIA_FLAG can be
- * used.
- * VehicleAudioExtFocusFlag#PLAY_ONLY_FLAG is for case
- * like radio where android side app still needs to hold
- * focus but playback is done outside Android.
- * VehicleAudioExtFocusFlag#MUTE_MEDIA_FLAG is for
- * muting media channel including radio.
- * VehicleAudioExtFocusFlag#PLAY_ONLY_FLAG can be set
- * even if android side releases focus (request type
- * REQUEST_RELEASE). In that case, audio module must
- * maintain mute state until user's explicit action to
- * play some media.
- * int32Values[3]: Audio contexts wishing to be active. Use combination of
- * flags from VehicleAudioContextFlag.
- * This can be used as a hint to adjust audio policy or
- * other policy decision.
- * Note that there can be multiple context active at the
- * same time. And android can send the same focus request
- * type gain due to change in audio contexts.
- * Note that each focus request can request multiple streams that is
- * expected to be used for the current request. But focus request itself
- * is global behavior as GAIN or GAIN_TRANSIENT expects all sounds played
- * by car's audio module to stop. Note that stream already allocated to
- * android before this focus request must not be affected by focus
- * request.
- *
- * Focus response (set and subscription callback for this property) must
- * take the following form with indices defined by VehicleAudioFocusIndex:
- * int32Values[0]: VehicleAudioFocusState type
- * int32Values[1]: bit flags of streams allowed.
- * int32Values[2]: External focus state: bit flags of currently active
- * audio focus in car side (outside Android). Active
- * audio focus does not necessarily mean currently
- * playing, but represents the state of having focus or
- * waiting for focus (pause state).
- * One or combination of flags from
- * VehicleAudioExtFocusFlag.
- * 0 means no active audio focus holder outside Android.
- * The state must have following values for each
- * VehicleAudioFocusState:
- * GAIN: VehicleAudioExtFocusFlag#PLAY_ONLY_FLAG
- * when radio is active in Android side. Otherwise,
- * VehicleAudioExtFocusFlag#NONE_FLAG.
- * GAIN_TRANSIENT: Can be
- * VehicleAudioExtFocusFlag#PERMANENT_FLAG or
- * VehicleAudioExtFocusFlag#TRANSIENT_FLAG if android
- * side has requested
- * REQUEST_GAIN_TRANSIENT_MAY_DUCK and car side is
- * ducking. Otherwise
- * VehicleAudioExtFocusFlag#NONE_FLAG.
- * LOSS: VehicleAudioExtFocusFlag#NONE_FLAG when no focus
- * is active in car side.
- * VehicleAudioExtFocusFlag#PERMANENT_FLAG when car
- * side is playing something permanent.
- * LOSS_TRANSIENT: must always be
- * VehicleAudioExtFocusFlag#PERMANENT_FLAG
- * int32Values[3]: Audio context(s) allowed to be active. When responding positively to a
- * focus request from Android, the request's original context must be
- * repeated here. When taking focus away, or denying a request, the
- * rejected or stopped context would have its corresponding bit cleared.
- *
- * A focus response must be sent per each focus request even if there is
- * no change in focus state. This can happen in case like focus request
- * only involving context change where android side still needs matching
- * focus response to confirm that audio module has made necessary changes.
- *
- * If car does not support AUDIO_FOCUS, focus is assumed to be granted
- * always.
- *
- * @change_mode VehiclePropertyChangeMode:ON_CHANGE
- * @access VehiclePropertyAccess:READ_WRITE
- */
- AUDIO_FOCUS = (
- 0x0900
- | VehiclePropertyGroup:SYSTEM
- | VehiclePropertyType:INT32_VEC
- | VehicleArea:GLOBAL),
-
- /**
- * A property to allow external component to control audio focus. Depending on
- * H/W architecture, audio HAL may need to control audio focus while vehicle
- * HAL is still interacting with upper layer. In such case, audio HAL may set
- * this property and vehicle HAL may use this property value to decide
- * response sent through AUDIO_FOCUS property.
- * Data format is the same as AUDIO_FOCUS property.
- *
- * @change_mode VehiclePropertyChangeMode:ON_CHANGE
- * @access VehiclePropertyAccess:READ_WRITE
- */
- AUDIO_FOCUS_EXT_SYNC = (
- 0x0910
- | VehiclePropertyGroup:SYSTEM
- | VehiclePropertyType:INT32_VEC
- | VehicleArea:GLOBAL),
-
- /**
- * Property to control audio volume of each audio context.
- *
- * VehiclePropConfig
- * configArray[0] : bit flags of all supported audio contexts from
- * VehicleAudioContextFlag. If this is 0, audio volume
- * is controlled per physical stream.
- * configArray[1] : flags defined in VehicleAudioVolumeCapabilityFlag to
- * represent audio module's capability.
- * configArray[2..3] : reserved
- * configArray[4..N+3] : maximum values for each audio context, where N is
- * the number of audio contexts provided in
- * configArray[0], minimum value is always 0 which
- * indicates mute state.
- *
- * Data type looks like:
- * int32Values[0] : audio context as defined in VehicleAudioContextFlag.
- * If only physical stream is supported
- * (configArray[0] == 0), this must represent physical
- * stream number.
- * int32Values[1] : volume level, valid range is 0 (mute) to max level
- * defined in the config.
- * int32Values[2] : One of VehicleAudioVolumeState.
- *
- * HAL implementations must check the incoming value of audio context
- * field in get call to return the right volume.
- *
- * @change_mode VehiclePropertyChangeMode:ON_CHANGE
- * @access VehiclePropertyAccess:READ_WRITE
- * @config_flags all audio contexts supported.
- */
- AUDIO_VOLUME = (
- 0x0901
- | VehiclePropertyGroup:SYSTEM
- | VehiclePropertyType:INT32_VEC
- | VehicleArea:GLOBAL),
-
- /**
- * Property to allow audio volume sync from external components like audio HAL.
- * Some vehicle HAL implementation may get volume control from audio HAL and in such
- * case, setting AUDIO_VOLUME_EXT_SYNC property may trigger event in AUDIO_VOLUME property.
- * Data format for this property is the same as AUDIO_VOLUME property.
- *
- * @change_mode VehiclePropertyChangeMode:ON_CHANGE
- * @access VehiclePropertyAccess:READ_WRITE
- * @config_flags all audio contexts supported.
- */
- AUDIO_VOLUME_EXT_SYNC = (
- 0x0911
- | VehiclePropertyGroup:SYSTEM
- | VehiclePropertyType:INT32_VEC
- | VehicleArea:GLOBAL),
-
- /**
- * Property for handling volume limit set by user. This limits maximum
- * volume that can be set per each context or physical stream.
- *
- * VehiclePropConfig
- * configArray[0] : bit flags of all supported audio contexts. If this is
- * 0, audio volume is controlled per physical stream.
- * configArray[1] : flags defined in VehicleAudioVolumeCapabilityFlag
- * to represent audio module's capability.
- *
- * Data type looks like:
- * int32Values[0] : audio context as defined in VehicleAudioContextFlag.
- * If only physical stream is supported
- * (configArray[0] == 0), this must represent physical
- * stream number.
- * int32Values[1] : maximum volume set to the stream. If there is no
- * restriction, this value must be equal to
- * AUDIO_VOLUME's max value.
- *
- * If car does not support this feature, this property must not be
- * populated by HAL.
- * HAL implementations must check the incoming value of audio context
- * field in get call to return the right volume.
- *
- * @change_mode VehiclePropertyChangeMode:ON_CHANGE
- * @access VehiclePropertyAccess:READ_WRITE
- * @config_flags all audio contexts supported.
- */
- AUDIO_VOLUME_LIMIT = (
- 0x0902
- | VehiclePropertyGroup:SYSTEM
- | VehiclePropertyType:INT32_VEC
- | VehicleArea:GLOBAL),
-
- /**
- * Property to share audio routing policy of android side. This property is
- * set at startup to pass audio policy in android side down to
- * vehicle HAL and car audio module.
- *
- * int32Values[0] : audio stream where the audio for the application
- * context must be routed by default. Note that this is
- * the default setting from system, but each app may
- * still use different audio stream for whatever reason.
- * int32Values[1] : All audio contexts that must be sent through the
- * physical stream. Flag is defined in
- * VehicleAudioContextFlag.
-
- * Setting of this property must be done for all available physical streams
- * based on audio H/W variant information acquired from AUDIO_HW_VARIANT
- * property.
- *
- * @change_mode VehiclePropertyChangeMode:ON_CHANGE
- * @access VehiclePropertyAccess:WRITE
- */
- AUDIO_ROUTING_POLICY = (
- 0x0903
- | VehiclePropertyGroup:SYSTEM
- | VehiclePropertyType:INT32_VEC
- | VehicleArea:GLOBAL),
-
- /**
- * Property to return audio H/W variant type used in this car. This is a
- * zero based index into the set of audio routing policies defined in
- * R.array.audioRoutingPolicy on CarService, which may be overlaid to
- * support multiple variants. If this property does not exist, the default
- * audio policy must be used.
- *
- * @change_mode VehiclePropertyChangeMode:STATIC
- * @access VehiclePropertyAccess:READ
- * @config_flags Additional info on audio H/W. Must use
- * VehicleAudioHwVariantConfigFlag for this.
- */
- AUDIO_HW_VARIANT = (
- 0x0904
- | VehiclePropertyGroup:SYSTEM
- | VehiclePropertyType:INT32
- | VehicleArea:GLOBAL),
-
- /**
- * Property to pass hint on external audio routing. When android side
- * request focus with VehicleAudioExtFocusflag, this
- * property must be set before setting AUDIO_FOCUS property as a hint for
- * external audio source routing.
- * Note that setting this property alone must not trigger any change.
- * Audio routing must be changed only when AUDIO_FOCUS property is set.
- * Note that this property allows passing custom value as long as it is
- * defined in VehiclePropConfig#configString. This allows supporting
- * non-standard routing options through this property.
- * It is recommended to use separate name space for custom property to
- * prevent conflict in future android releases.
- * Enabling each external routing option is done by enabling each bit flag
- * for the routing.
- * This property can support up to 128 external routings.
- * To give full flexibility, there is no standard definition for each bit
- * flag and assigning each bit flag to specific routing type is decided by
- * VehiclePropConfig#configString. VehiclePropConfig#configString has
- * format of each entry separated by ',' and each entry has format of
- * bitFlagPositon:typeString[:physicalStreamNumber].
- * bitFlagPosition: represents which bit flag will be set to enable this
- * routing. 0 means LSB in int32Values[0]. 31 will be MSB in
- * int32Values[0]. 127 will MSB in int32Values[3].
- * typeString: string representation of external routing. Some types are
- * already defined in AUDIO_EXT_ROUTING_SOURCE_* and use them first
- * before adding something custom. Applications will find each routing
- * using this string.
- * physicalStreamNumber: This part is optional and represents physical
- * stream to android which will be disabled when this routing is enabled.
- * If not specified, this routing must not affect physical streams to
- * android.
- * As an example, let's assume a system with two physical streams, 0 for
- * media and 1 for nav guidance. And let's assume external routing option
- * of am fm radio, external navigation guidance, satellite radio, and one
- * custom. Let's assume that radio and satellite replaces physical stream 0
- * and external navigation replaces physical stream 1. And bit flag will be
- * assigned in the order listed above. This configuration will look like
- * this in config_string:
- * "0:RADIO_AM_FM:0,1:EXT_NAV_GUIDANCE:1,2:RADIO_SATELLITE:0,3:com.test.SOMETHING_CUSTOM"
- * When android requests RADIO_AM_FM, int32Values[0] will be set to 0x1.
- * When android requests RADIO_SATELLITE + EXT_NAV_GUIDANCE, int32Values[0]
- * will be set to 0x2|0x4.
- *
- * @change_mode VehiclePropertyChangeMode:ON_CHANGE
- * @access VehiclePropertyAccess:READ_WRITE
- * @config_string List of all avaiable external source in the system.
- */
- AUDIO_EXT_ROUTING_HINT = (
- 0x0905
- | VehiclePropertyGroup:SYSTEM
- | VehiclePropertyType:INT32_VEC
- | VehicleArea:GLOBAL),
-
- /**
- * Represents state of audio stream. Audio HAL should set this when a stream is starting or
- * ending. Car service can request focus for audio played without focus. If such feature
- * is not required, this property does not need to be implemented.
- * Car service only monitors setting of this property. It is up to each vehicle HAL
- * implementation to add necessary action but default implementation will be doing nothing on
- * this propery's set from audio HAL.
- * Actual streaming of data should be done only after getting focus for the given stream from
- * car audio module. Focus can be already granted when stream is started. Focus state can be
- * monitored by monitoring AUDIO_FOCUS property. If car does not support
- * AUDIO_FOCUS property, there is no need to monitor focus as focus is assumed to be
- * granted always.
- * Data has the following format:
- * int32_array[0] : vehicle_audio_stream_state, 0: stopped, 1: started
- * int32_array[1] : stream number like 0, 1, 2, ...
- *
- * @change_mode VehiclePropertyChangeMode:ON_CHANGE
- * @access VehiclePropertyAccess:READ_WRITE
- */
- AUDIO_STREAM_STATE = (
- 0x0906
- | VehiclePropertyGroup:SYSTEM
- | VehiclePropertyType:INT32_VEC
- | VehicleArea:GLOBAL),
-
- /**
- * Property to control car specific audio parameters. Each parameter is defined as string key-
- * value pair.
- * set and event notification can pass multiple parameters using the
- * following format:
- * key1=value1;key2=value2;...
- * get call can request multiple parameters using the following format:
- * key1;key2;...
- * Response for get call has the same format as set.
- *
- * VehiclePropConfig
- * configString: give list of all supported keys with ; as separator. For example:
- * key1;key2;...
- *
- * @change_mode VehiclePropertyChangeMode:ON_CHANGE
- * @access VehiclePropertyAccess:READ_WRITE
- */
- AUDIO_PARAMETERS = (
- 0x907
- | VehiclePropertyGroup:SYSTEM
- | VehiclePropertyType:STRING
- | VehicleArea:GLOBAL),
-
- /**
* Property to control power state of application processor
*
* It is assumed that AP's power state is controller by separate power
@@ -2243,256 +1903,6 @@
VEHICLE_RADIO_PRESET_MIN_VALUE = 1,
};
-enum VehicleAudioFocusRequest : int32_t {
- REQUEST_GAIN = 0x1,
- REQUEST_GAIN_TRANSIENT = 0x2,
- REQUEST_GAIN_TRANSIENT_MAY_DUCK = 0x3,
- /**
- * This is for the case where android side plays sound like UI feedback
- * and car side does not need to duck existing playback as long as
- * requested stream is available.
- */
- REQUEST_GAIN_TRANSIENT_NO_DUCK = 0x4,
- REQUEST_RELEASE = 0x5,
-};
-
-enum VehicleAudioFocusState : int32_t {
- /**
- * Android side has permanent focus and can play allowed streams.
- */
- STATE_GAIN = 0x1,
-
- /**
- * Android side has transient focus and can play allowed streams.
- */
- STATE_GAIN_TRANSIENT = 0x2,
-
- /**
- * Car audio module is playing guidance kind of sound outside Android.
- * Android side can still play through allowed streams with ducking.
- */
- STATE_LOSS_TRANSIENT_CAN_DUCK = 0x3,
-
- /**
- * Car audio module is playing transient sound outside Android. Android side
- * must stop playing any sounds.
- */
- STATE_LOSS_TRANSIENT = 0x4,
-
- /**
- * Android side has lost focus and cannot play any sound.
- */
- STATE_LOSS = 0x5,
-
- /**
- * car audio module is playing safety critical sound, and Android side cannot
- * request focus until the current state is finished. car audio module
- * restore it to the previous state when it can allow Android to play.
- */
- STATE_LOSS_TRANSIENT_EXLCUSIVE = 0x6,
-};
-
-/**
- * Flags to represent multiple streams by combining these.
- */
-enum VehicleAudioStreamFlag : int32_t {
- STREAM0_FLAG = (0x1 << 0),
- STREAM1_FLAG = (0x1 << 1),
- STREAM2_FLAG = (0x1 << 2),
-};
-
-/**
- * Represents stream number (always 0 to N -1 where N is max number of streams).
- * Can be used for audio related property expecting one stream.
- */
-enum VehicleAudioStream : int32_t {
- STREAM0 = 0,
- STREAM1 = 1,
-};
-
-/**
- * Flag to represent external focus state (outside Android).
- */
-enum VehicleAudioExtFocusFlag : int32_t {
- /**
- * No external focus holder.
- */
- NONE_FLAG = 0x0,
-
- /**
- * Car side (outside Android) has component holding GAIN kind of focus state.
- */
- PERMANENT_FLAG = 0x1,
-
- /**
- * Car side (outside Android) has component holding GAIN_TRANSIENT kind of
- * focus state.
- */
- TRANSIENT_FLAG = 0x2,
-
- /**
- * Car side is expected to play something while focus is held by Android side.
- * One example can be radio attached in car side. But Android's radio app
- * still must have focus, and Android side must be in GAIN state, but
- * media stream will not be allocated to Android side and car side can play
- * radio any time while this flag is active.
- */
- PLAY_ONLY_FLAG = 0x4,
-
- /**
- * Car side must mute any media including radio. This can be used with any
- * focus request including GAIN* and RELEASE.
- */
- MUTE_MEDIA_FLAG = 0x8,
-};
-
-/**
- * Index in int32Values for VehicleProperty#AUDIO_FOCUS property.
- */
-enum VehicleAudioFocusIndex : int32_t {
- FOCUS = 0,
- STREAMS = 1,
- EXTERNAL_FOCUS_STATE = 2,
- AUDIO_CONTEXTS = 3,
-};
-
-/**
- * Flags to tell the current audio context.
- */
-enum VehicleAudioContextFlag : int32_t {
- /** Music playback is currently active. */
- MUSIC_FLAG = 0x1,
-
- /** Navigation is currently running. */
- NAVIGATION_FLAG = 0x2,
-
- /** Voice command session is currently running. */
- VOICE_COMMAND_FLAG = 0x4,
-
- /** Voice call is currently active. */
- CALL_FLAG = 0x8,
-
- /**
- * Alarm is active.
- * This must be only used in VehicleProperty#AUDIO_ROUTING_POLICY.
- */
- ALARM_FLAG = 0x10,
-
- /**
- * Notification sound is active.
- * This must be only used in VehicleProperty#AUDIO_ROUTING_POLICY.
- */
- NOTIFICATION_FLAG = 0x20,
-
- /**
- * Context unknown. Only used for VehicleProperty#AUDIO_ROUTING_POLICY to
- * represent default stream for unknown contents.
- */
- UNKNOWN_FLAG = 0x40,
-
- /** Safety alert / warning is played. */
- SAFETY_ALERT_FLAG = 0x80,
-
- /** CD / DVD kind of audio is played */
- CD_ROM_FLAG = 0x100,
-
- /** Aux audio input is played */
- AUX_AUDIO_FLAG = 0x200,
-
- /** system sound like UI feedback */
- SYSTEM_SOUND_FLAG = 0x400,
-
- /** Radio is played */
- RADIO_FLAG = 0x800,
-
- /** Ext source is played. This is for tagging generic ext sources. */
- EXT_SOURCE_FLAG = 0x1000,
-
- /** The phone ring tone is played */
- RINGTONE_FLAG = 0x2000
-};
-
-/**
- * flags to represent capability of audio volume property.
- * used in configArray[1] of VehiclePropConfig.
- */
-enum VehicleAudioVolumeCapabilityFlag : int32_t {
- /**
- * External audio module or vehicle hal has persistent storage to keep the
- * volume level. When this is set, the audio volume level for each context
- * will be retrieved from the property when the system starts up.
- * And external audio module is also expected to adjust volume automatically
- * whenever there is an audio context change.
- * When this flag is not set, android side will assume that there is no
- * persistent storage and the value stored in the android side will be used to
- * initialize the volume level, and android side will set volume level
- * of each physical stream whenever there is an audio context change.
- */
- PERSISTENT_STORAGE = 0x1,
-
- /**
- * [DEPRECATED]
- * When this flag is set, the H/W can support only single master volume for
- * all streams. There is no way to set volume level differently for each stream
- * or context.
- */
- MASTER_VOLUME_ONLY = 0x2,
-};
-
-/**
- * enum to represent audio volume state.
- */
-enum VehicleAudioVolumeState : int32_t {
- STATE_OK = 0,
-
- /**
- * Audio volume has reached volume limit set in
- * VehicleProperty#AUDIO_VOLUME_LIMIT and user's request to increase volume
- * further is not allowed.
- */
- STATE_LIMIT_REACHED = 1,
-};
-
-/**
- * Index in int32Values for VehicleProperty#AUDIO_VOLUME property.
- */
-enum VehicleAudioVolumeIndex : int32_t {
- STREAM = 0,
- VOLUME = 1,
- STATE = 2,
-};
-
-/**
- * Index in int32Values for VehicleProperty#AUDIO_VOLUME_LIMIT property.
- */
-enum VehicleAudioVolumeLimitIndex : int32_t {
- STREAM = 0,
- MAX_VOLUME = 1,
-};
-
-/**
- * Index in int32Values for VehicleProperty#AUDIO_ROUTING_POLICY property.
- */
-enum VehicleAudioRoutingPolicyIndex : int32_t {
- STREAM = 0,
- CONTEXTS = 1,
-};
-
-/**
- * Flag to be used in VehiclePropConfig#configFlags for
- * VehicleProperty#AUDIO_HW_VARIANT.
- */
-enum VehicleAudioHwVariantConfigFlag : int32_t {
- /**
- * Flag to tell that radio is internal to android and radio must
- * be treated like other android stream like media.
- * When this flag is not set or AUDIO_HW_VARIANT does not exist,
- * radio is treated as external module. This may affect audio focus
- * handling as well.
- */
- INTERNAL_RADIO_FLAG = 0x1,
-};
-
enum VehicleApPowerStateConfigFlag : int32_t /* NOTE: type is guessed */ {
/**
* AP can enter deep sleep state. If not set, AP will always shutdown from