Removes deprecated audio property in vehicle hal
Bug: 72054677
Test: lunch gcar_emu-x86 && m -j
Change-Id: Ia70bf17e0343704c5ca3468ad86145e7078696f7
diff --git a/include/hardware/vehicle.h b/include/hardware/vehicle.h
index 8b28e7a..aa92815 100644
--- a/include/hardware/vehicle.h
+++ b/include/hardware/vehicle.h
@@ -543,446 +543,6 @@
};
/**
- * Represents audio focus state of Android side. Note that car's audio module will 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) will take the following form in int32_vec4:
- * int32_array[0]: vehicle_audio_focus_request type
- * int32_array[1]: bit flags of streams requested by this focus request. There can be up to
- * 32 streams.
- * int32_array[2]: External focus state flags. For request, only flag like
- * VEHICLE_AUDIO_EXT_FOCUS_CAR_PLAY_ONLY_FLAG or
- * VEHICLE_AUDIO_EXT_FOCUS_CAR_MUTE_MEDIA_FLAG can be used.
- * VEHICLE_AUDIO_EXT_FOCUS_CAR_PLAY_ONLY_FLAG is for case like radio where android
- * side app still needs to hold focus but playback is done outside Android.
- * VEHICLE_AUDIO_EXT_FOCUS_CAR_MUTE_MEDIA_FLAG is for muting media channel
- * including radio. VEHICLE_AUDIO_EXT_FOCUS_CAR_MUTE_MEDIA_FLAG can be set even
- * if android side releases focus (request type REQUEST_RELEASE). In that case,
- * audio module should maintain mute state until user's explicit action to
- * play some media.
- * int32_array[3]: Currently active audio contexts. Use combination of flags from
- * vehicle_audio_context_flag.
- * 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 should not be affected by focus request.
- *
- * Focus response (set and subscription callback for this property) will take the following form:
- * int32_array[0]: vehicle_audio_focus_state type
- * int32_array[1]: bit flags of streams allowed.
- * int32_array[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 vehicle_audio_ext_focus_flag.
- * 0 means no active audio focus holder outside Android.
- * The state will have following values for each vehicle_audio_focus_state_type:
- * GAIN: 0 or VEHICLE_AUDIO_EXT_FOCUS_CAR_PLAY_ONLY when radio is active in
- * Android side.
- * GAIN_TRANSIENT: 0. Can be VEHICLE_AUDIO_EXT_FOCUS_CAR_PERMANENT or
- * VEHICLE_AUDIO_EXT_FOCUS_CAR_TRANSIENT if android side has requested
- * GAIN_TRANSIENT_MAY_DUCK and car side is ducking.
- * LOSS: 0 when no focus is audio is active in car side.
- * VEHICLE_AUDIO_EXT_FOCUS_CAR_PERMANENT when car side is playing something
- * permanent.
- * LOSS_TRANSIENT: always should be VEHICLE_AUDIO_EXT_FOCUS_CAR_TRANSIENT
- * int32_array[3]: context requested by android side when responding to focus request.
- * When car side is taking focus away, this should be zero.
- *
- * A focus response should 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 VEHICLE_PROPERTY_AUDIO_FOCUS, focus is assumed to be granted always.
- *
- * @value_type VEHICLE_VALUE_TYPE_INT32_VEC4
- * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
- * @access VEHICLE_PROP_ACCESS_READ_WRITE
- * @data_member int32_array
- */
-#define VEHICLE_PROPERTY_AUDIO_FOCUS (0x00000900)
-
-enum vehicle_audio_focus_request {
- VEHICLE_AUDIO_FOCUS_REQUEST_GAIN = 0x1,
- VEHICLE_AUDIO_FOCUS_REQUEST_GAIN_TRANSIENT = 0x2,
- VEHICLE_AUDIO_FOCUS_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.
- */
- VEHICLE_AUDIO_FOCUS_REQUEST_GAIN_TRANSIENT_NO_DUCK = 0x4,
- VEHICLE_AUDIO_FOCUS_REQUEST_RELEASE = 0x5,
-};
-
-enum vehicle_audio_focus_state {
- /**
- * Android side has permanent focus and can play allowed streams.
- */
- VEHICLE_AUDIO_FOCUS_STATE_GAIN = 0x1,
- /**
- * Android side has transient focus and can play allowed streams.
- */
- VEHICLE_AUDIO_FOCUS_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.
- */
- VEHICLE_AUDIO_FOCUS_STATE_LOSS_TRANSIENT_CAN_DUCK = 0x3,
- /**
- * Car audio module is playing transient sound outside Android. Android side should stop
- * playing any sounds.
- */
- VEHICLE_AUDIO_FOCUS_STATE_LOSS_TRANSIENT = 0x4,
- /**
- * Android side has lost focus and cannot play any sound.
- */
- VEHICLE_AUDIO_FOCUS_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 should restore it to the previous
- * state when it can allow Android to play.
- */
- VEHICLE_AUDIO_FOCUS_STATE_LOSS_TRANSIENT_EXLCUSIVE = 0x6,
-};
-
-/**
- * Flags to represent multiple streams by combining these.
- */
-enum vehicle_audio_stream_flag {
- VEHICLE_AUDIO_STREAM_STREAM0_FLAG = (0x1<<0),
- VEHICLE_AUDIO_STREAM_STREAM1_FLAG = (0x1<<1),
- VEHICLE_AUDIO_STREAM_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 vehicle_audio_stream {
- VEHICLE_AUDIO_STREAM0 = 0,
- VEHICLE_AUDIO_STREAM1 = 1,
-};
-
-/**
- * Flag to represent external focus state (outside Android).
- */
-enum vehicle_audio_ext_focus_flag {
- /**
- * No external focus holder.
- */
- VEHICLE_AUDIO_EXT_FOCUS_NONE_FLAG = 0x0,
- /**
- * Car side (outside Android) has component holding GAIN kind of focus state.
- */
- VEHICLE_AUDIO_EXT_FOCUS_CAR_PERMANENT_FLAG = 0x1,
- /**
- * Car side (outside Android) has component holding GAIN_TRANSIENT kind of focus state.
- */
- VEHICLE_AUDIO_EXT_FOCUS_CAR_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 should have focus,
- * and Android side should 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.
- */
- VEHICLE_AUDIO_EXT_FOCUS_CAR_PLAY_ONLY_FLAG = 0x4,
- /**
- * Car side should mute any media including radio. This can be used with any focus request
- * including GAIN* and RELEASE.
- */
- VEHICLE_AUDIO_EXT_FOCUS_CAR_MUTE_MEDIA_FLAG = 0x8,
-};
-
-/**
- * Index in int32_array for VEHICLE_PROPERTY_AUDIO_FOCUS property.
- */
-enum vehicle_audio_focus_index {
- VEHICLE_AUDIO_FOCUS_INDEX_FOCUS = 0,
- VEHICLE_AUDIO_FOCUS_INDEX_STREAMS = 1,
- VEHICLE_AUDIO_FOCUS_INDEX_EXTERNAL_FOCUS_STATE = 2,
- VEHICLE_AUDIO_FOCUS_INDEX_AUDIO_CONTEXTS = 3,
-};
-
-/**
- * Flags to tell the current audio context.
- */
-enum vehicle_audio_context_flag {
- /** Music playback is currently active. */
- VEHICLE_AUDIO_CONTEXT_MUSIC_FLAG = 0x1,
- /** Navigation is currently running. */
- VEHICLE_AUDIO_CONTEXT_NAVIGATION_FLAG = 0x2,
- /** Voice command session is currently running. */
- VEHICLE_AUDIO_CONTEXT_VOICE_COMMAND_FLAG = 0x4,
- /** Voice call is currently active. */
- VEHICLE_AUDIO_CONTEXT_CALL_FLAG = 0x8,
- /** Alarm is active. This may be only used in VEHICLE_PROPERTY_AUDIO_ROUTING_POLICY. */
- VEHICLE_AUDIO_CONTEXT_ALARM_FLAG = 0x10,
- /**
- * Notification sound is active. This may be only used in VEHICLE_PROPERTY_AUDIO_ROUTING_POLICY.
- */
- VEHICLE_AUDIO_CONTEXT_NOTIFICATION_FLAG = 0x20,
- /**
- * Context unknown. Only used for VEHICLE_PROPERTY_AUDIO_ROUTING_POLICY to represent default
- * stream for unknown contents.
- */
- VEHICLE_AUDIO_CONTEXT_UNKNOWN_FLAG = 0x40,
- /** Safety alert / warning is played. */
- VEHICLE_AUDIO_CONTEXT_SAFETY_ALERT_FLAG = 0x80,
- /** CD / DVD kind of audio is played */
- VEHICLE_AUDIO_CONTEXT_CD_ROM_FLAG = 0x100,
- /** Aux audio input is played */
- VEHICLE_AUDIO_CONTEXT_AUX_AUDIO_FLAG = 0x200,
- /** system sound like UI feedback */
- VEHICLE_AUDIO_CONTEXT_SYSTEM_SOUND_FLAG = 0x400,
- /** Radio is played */
- VEHICLE_AUDIO_CONTEXT_RADIO_FLAG = 0x800,
- /** Ext source is played. This is for tagging generic ext sources. */
- VEHICLE_AUDIO_CONTEXT_EXT_SOURCE_FLAG = 0x1000,
-};
-
-/**
- * Property to control audio volume of each audio context.
- *
- * vehicle_prop_config_t
- * config_array[0] : bit flags of all supported audio contexts. If this is 0,
- * audio volume is controlled per physical stream
- * config_array[1] : flags defined in vehicle_audio_volume_capability_flag to
- * represent audio module's capability.
- *
- * Data type looks like:
- * int32_array[0] : stream context as defined in vehicle_audio_context_flag. If only physical
- stream is supported (config_array[0] == 0), this will represent physical
- stream number.
- * int32_array[1] : volume level, valid range is 0 to int32_max_value defined in config.
- * 0 will be mute state. int32_min_value in config should be always 0.
- * int32_array[2] : One of vehicle_audio_volume_state.
- *
- * This property requires per stream based get. HAL implementation should check stream number
- * in get call to return the right volume.
- *
- * @value_type VEHICLE_VALUE_TYPE_INT32_VEC3
- * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
- * @access VEHICLE_PROP_ACCESS_READ_WRITE
- * @config_flags all audio contexts supported.
- * @data_member int32_array
- */
-#define VEHICLE_PROPERTY_AUDIO_VOLUME (0x00000901)
-
-
-/**
- * flags to represent capability of audio volume property.
- * used in config_array[1] of vehicle_prop_config_t.
- */
-enum vehicle_audio_volume_capability_flag {
- /**
- * External audio module or vehicle hal has persistent storage
- * to keep the volume level. This should be set only when per context
- * volume level is supproted. When this is set, audio volume level per
- * each context will be retrieved from the property when systen 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 stored value in android side will be used to
- * initialize the volume level. And android side will set volume level
- * of each physical streams whenever there is an audio context change.
- */
- VEHICLE_AUDIO_VOLUME_CAPABILITY_PERSISTENT_STORAGE = 0x1,
- /**
- * 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 per each stream or context.
- */
- VEHICLE_AUDIO_VOLUME_CAPABILITY_MASTER_VOLUME_ONLY = 0x2,
-};
-
-
-/**
- * enum to represent audio volume state.
- */
-enum vehicle_audio_volume_state {
- VEHICLE_AUDIO_VOLUME_STATE_OK = 0,
- /**
- * Audio volume has reached volume limit set in VEHICLE_PROPERTY_AUDIO_VOLUME_LIMIT
- * and user's request to increase volume further is not allowed.
- */
- VEHICLE_AUDIO_VOLUME_STATE_LIMIT_REACHED = 1,
-};
-
-/**
- * Index in int32_array for VEHICLE_PROPERTY_AUDIO_VOLUME property.
- */
-enum vehicle_audio_volume_index {
- VEHICLE_AUDIO_VOLUME_INDEX_STREAM = 0,
- VEHICLE_AUDIO_VOLUME_INDEX_VOLUME = 1,
- VEHICLE_AUDIO_VOLUME_INDEX_STATE = 2,
-};
-
-/**
- * Property for handling volume limit set by user. This limits maximum volume that can be set
- * per each context or physical stream.
- *
- * vehicle_prop_config_t
- * config_array[0] : bit flags of all supported audio contexts. If this is 0,
- * audio volume is controlled per physical stream
- * config_array[1] : flags defined in vehicle_audio_volume_capability_flag to
- * represent audio module's capability.
- *
- * Data type looks like:
- * int32_array[0] : stream context as defined in vehicle_audio_context_flag. If only physical
- * stream is supported (config_array[0] == 0), this will represent physical
- * stream number.
- * int32_array[1] : maximum volume set to the stream. If there is no restriction, this value
- * will be bigger than VEHICLE_PROPERTY_AUDIO_VOLUME's max value.
- *
- * If car does not support this feature, this property should not be populated by HAL.
- * This property requires per stream based get. HAL implementation should check stream number
- * in get call to return the right volume.
- *
- * @value_type VEHICLE_VALUE_TYPE_INT32_VEC2
- * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
- * @access VEHICLE_PROP_ACCESS_READ_WRITE
- * @config_flags all audio contexts supported.
- * @data_member int32_array
- */
-#define VEHICLE_PROPERTY_AUDIO_VOLUME_LIMIT (0x00000902)
-
-/**
- * Index in int32_array for VEHICLE_PROPERTY_AUDIO_VOLUME_LIMIT property.
- */
-enum vehicle_audio_volume_limit_index {
- VEHICLE_AUDIO_VOLUME_LIMIT_INDEX_STREAM = 0,
- VEHICLE_AUDIO_VOLUME_LIMIT_INDEX_MAX_VOLUME = 1,
-};
-
-/**
- * Property to share audio routing policy of android side. This property is set at the beginning
- * to pass audio policy in android side down to vehicle HAL and car audio module.
- * This can be used as a hint to adjust audio policy or other policy decision.
- *
- * int32_array[0] : audio stream where the audio for the application context will 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.
- * int32_array[1] : All audio contexts that will be sent through the physical stream. Flag
- * is defined in vehicle_audio_context_flag.
-
- * Setting of this property will be done for all available physical streams based on audio H/W
- * variant information acquired from VEHICLE_PROPERTY_AUDIO_HW_VARIANT property.
- *
- * @value_type VEHICLE_VALUE_TYPE_INT32_VEC2
- * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
- * @access VEHICLE_PROP_ACCESS_WRITE
- * @data_member int32_array
- */
-#define VEHICLE_PROPERTY_AUDIO_ROUTING_POLICY (0x00000903)
-
-/**
- * Index in int32_array for VEHICLE_PROPERTY_AUDIO_ROUTING_POLICY property.
- */
-enum vehicle_audio_routing_policy_index {
- VEHICLE_AUDIO_ROUTING_POLICY_INDEX_STREAM = 0,
- VEHICLE_AUDIO_ROUTING_POLICY_INDEX_CONTEXTS = 1,
-};
-
-/**
-* Property to return audio H/W variant type used in this car. This allows android side to
-* support different audio policy based on H/W variant used. Note that other components like
-* CarService may need overlay update to support additional variants. If this property does not
-* exist, default audio policy will be used.
-*
-* @value_type VEHICLE_VALUE_TYPE_INT32
-* @change_mode VEHICLE_PROP_CHANGE_MODE_STATIC
-* @access VEHICLE_PROP_ACCESS_READ
-* @config_flags Additional info on audio H/W. Should use vehicle_audio_hw_variant_config_flag for
-* this.
-* @data_member int32_value
-*/
-#define VEHICLE_PROPERTY_AUDIO_HW_VARIANT (0x00000904)
-
-/**
- * Flag to be used in vehicle_prop_config.config_flags for VEHICLE_PROPERTY_AUDIO_HW_VARIANT.
- */
-enum vehicle_audio_hw_variant_config_flag {
- /**
- * Flag to tell that radio is internal to android and radio should
- * 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 brins some delta in audio focus
- * handling as well.
- */
- VEHICLE_AUDIO_HW_VARIANT_FLAG_INTERNAL_RADIO_FLAG = 0x1,
-};
-
-/** audio routing for AM/FM. This should be also be the value when there is only one
- radio module in the system. */
-#define VEHICLE_PROPERTY_AUDIO_EXT_ROUTING_SOURCE_RADIO_AM_FM "RADIO_AM_FM"
-/** Should be added only when there is a separate radio module with HD capability. */
-#define VEHICLE_PROPERTY_AUDIO_EXT_ROUTING_SOURCE_RADIO_AM_FM_HD "RADIO_AM_FM_HD"
-/** For digial audio broadcasting type of radio */
-#define VEHICLE_PROPERTY_AUDIO_EXT_ROUTING_SOURCE_RADIO_DAB "RADIO_DAB"
-/** For satellite type of radio */
-#define VEHICLE_PROPERTY_AUDIO_EXT_ROUTING_SOURCE_RADIO_SATELLITE "RADIO_SATELLITE"
-/** For CD or DVD */
-#define VEHICLE_PROPERTY_AUDIO_EXT_ROUTING_SOURCE_CD_DVD "CD_DVD"
-/** For 1st auxiliary input */
-#define VEHICLE_PROPERTY_AUDIO_EXT_ROUTING_SOURCE_AUX_IN0 "AUX_IN0"
-/** For 2nd auxiliary input */
-#define VEHICLE_PROPERTY_AUDIO_EXT_ROUTING_SOURCE_AUX_IN1 "AUX_IN1"
-/** For navigation guidance from outside android */
-#define VEHICLE_PROPERTY_AUDIO_EXT_ROUTING_SOURCE_EXT_NAV_GUIDANCE "EXT_NAV_GUIDANCE"
-/** For voice command from outside android */
-#define VEHICLE_PROPERTY_AUDIO_EXT_ROUTING_SOURCE_EXT_VOICE_COMMAND "EXT_VOICE_COMMAND"
-/** For voice call from outside android */
-#define VEHICLE_PROPERTY_AUDIO_EXT_ROUTING_SOURCE_EXT_VOICE_CALL "EXT_VOICE_CALL"
-/** For safety alert from outside android */
-#define VEHICLE_PROPERTY_AUDIO_EXT_ROUTING_SOURCE_EXT_SAFETY_ALERT "EXT_SAFETY_ALERT"
-
-/**
-* Property to pass hint on external audio routing. When android side request focus
-* with VEHICLE_AUDIO_EXT_FOCUS_CAR_PLAY_ONLY_FLAG flag, this property will be set
-* before setting AUDIO_FOCUS property as a hint for external audio source routing.
-* Note that setting this property alone should not trigger any change.
-* Audio routing should be changed only when AUDIO_FOCUS property is set. Note that
-* this property allows passing custom value as long as it is defined in config_string.
-* 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 big flag to specific routing type is decided by config_string.
-* config_string has format of each entry separated by ','
-* and each entry has format of bitFlagPositon:typeString[:physicalStreamNumber].
-* bitFlagPosition: represents which big flag will be set to enable this routing. 0 means
-* LSB in int32_array[0]. 31 will be MSB in int32_array[0]. 127 will MSB in int32_array[3].
-* typeString: string representation of external routing. Some types are already defined
-* in VEHICLE_PROPERTY_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
-* should 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, int32_array[0] will be set to 0x1.
-* When android requests RADIO_SATELLITE + EXT_NAV_GUIDANCE, int32_array[0] will be set to 0x2|0x4.
-*
-* @value_type VEHICLE_VALUE_TYPE_INT32_VEC4
-* @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
-* @access VEHICLE_PROP_ACCESS_WRITE|VEHICLE_PROP_ACCESS_READ_WRITE
-* @config_string List of all avaiable external source in the system.
-* @data_member int32_array
-*/
-#define VEHICLE_PROPERTY_AUDIO_EXT_ROUTING_HINT (0x00000905)
-
-/**
* Property to control power state of application processor.
*
* It is assumed that AP's power state is controller by separate power controller.