Merge "Add mono audio parameter"
diff --git a/include/hardware/bluetooth.h b/include/hardware/bluetooth.h
index 3427213..683e369 100644
--- a/include/hardware/bluetooth.h
+++ b/include/hardware/bluetooth.h
@@ -256,6 +256,19 @@
void *val;
} bt_property_t;
+/** Bluetooth Out Of Band data for bonding */
+typedef struct
+{
+ uint8_t c192[16]; /* Simple Pairing Hash C-192 */
+ uint8_t r192[16]; /* Simple Pairing Randomizer R-192 */
+ uint8_t c256[16]; /* Simple Pairing Hash C-256 */
+ uint8_t r256[16]; /* Simple Pairing Randomizer R-256 */
+ uint8_t sm_tk[16]; /* Security Manager TK Value */
+ uint8_t le_sc_c[16]; /* LE Secure Connections Random Value */
+ uint8_t le_sc_r[16]; /* LE Secure Connections Random Value */
+} bt_out_of_band_data_t;
+
+
/** Bluetooth Device Type */
typedef enum {
@@ -485,6 +498,10 @@
/** Create Bluetooth Bonding */
int (*create_bond)(const bt_bdaddr_t *bd_addr, int transport);
+ /** Create Bluetooth Bond using out of band data */
+ int (*create_bond_out_of_band)(const bt_bdaddr_t *bd_addr, int transport,
+ const bt_out_of_band_data_t *oob_data);
+
/** Remove Bond */
int (*remove_bond)(const bt_bdaddr_t *bd_addr);
diff --git a/include/hardware/fingerprint.h b/include/hardware/fingerprint.h
index 618ca7e..b567732 100644
--- a/include/hardware/fingerprint.h
+++ b/include/hardware/fingerprint.h
@@ -50,6 +50,7 @@
FINGERPRINT_ERROR_NO_SPACE = 4, /* No space available to store a template */
FINGERPRINT_ERROR_CANCELED = 5, /* The current operation can't proceed. See above. */
FINGERPRINT_ERROR_UNABLE_TO_REMOVE = 6, /* fingerprint with given id can't be removed */
+ FINGERPRINT_ERROR_LOCKOUT = 7, /* the functionality is temporarily locked out */
FINGERPRINT_ERROR_VENDOR_BASE = 1000 /* vendor-specific error messages start here */
} fingerprint_error_t;
@@ -250,8 +251,16 @@
*/
int (*authenticate)(struct fingerprint_device *dev, uint64_t operation_id, uint32_t gid);
+ /*
+ * Resets a lockout by providing a valid hardware authentication token.
+ *
+ * Function return: 0 on success
+ * or a negative number in case of error, generally from the errno.h set.
+ */
+ int (*reset_lockout)(struct fingerprint_device *dev, const hw_auth_token_t *hat);
+
/* Reserved for backward binary compatibility */
- void *reserved[4];
+ void *reserved[3];
} fingerprint_device_t;
typedef struct fingerprint_module {
diff --git a/include/hardware/vehicle.h b/include/hardware/vehicle.h
index 22c69bb..e2a0e9e 100644
--- a/include/hardware/vehicle.h
+++ b/include/hardware/vehicle.h
@@ -67,6 +67,9 @@
* @data_member: Name of member from vehicle_value union to access this data.
* @data_enum: enum type that should be used for the data.
* @unit: Unit of data. Should be from vehicle_unit_type.
+ * @config_flags: Usage of config_flags in vehicle_prop_config
+ * @config_array: Usage of config_array in vehicle_prop_config. When this is specified,
+ * @config_flags will not be used.
* @config_string: Explains the usage of config_string in vehicle_prop_config. Property with
* this annotation is expected to have additional information in config_string
* for that property to work.
@@ -253,6 +256,7 @@
* @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
* @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
* @access VEHICLE_PROP_ACCESS_READ_WRITE
+ * @config_flags Supported zones
* @data_member hvac.fan_speed
* @data_enum TODO
*/
@@ -263,6 +267,7 @@
* @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
* @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
* @access VEHICLE_PROP_ACCESS_READ_WRITE
+ * @config_flags Supported zones
* @data_member hvac.fan_direction
* @data_enum TODO
*/
@@ -272,8 +277,9 @@
* Bit flags for fan direction
*/
enum vehicle_hvac_fan_direction_flags {
- VEHICLE_HVAC_FAN_DIRECTION_FACE_FLAG = 0x1,
- VEHICLE_HVAC_FAN_DIRECTION_FLOOR_FLAG = 0x2
+ VEHICLE_HVAC_FAN_DIRECTION_FACE_FLAG = 0x1,
+ VEHICLE_HVAC_FAN_DIRECTION_FLOOR_FLAG = 0x2,
+ VEHICLE_HVAC_FAN_DIRECTION_FACE_AND_FLOOR_FLAG = 0x3
};
/**
@@ -281,6 +287,7 @@
* @value_type VEHICLE_VALUE_TYPE_ZONED_FLOAT
* @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE|VEHICLE_PROP_CHANGE_MODE_CONTINUOUS
* @access VEHICLE_PROP_ACCESS_READ_WRITE
+ * @config_flags Supported zones
* @data_member hvac.temperature_current
*/
#define VEHICLE_PROPERTY_HVAC_TEMPERATURE_CURRENT (0x00000502)
@@ -289,6 +296,7 @@
* HVAC, target temperature set.
* @value_type VEHICLE_VALUE_TYPE_ZONED_FLOAT
* @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE|VEHICLE_PROP_CHANGE_MODE_CONTINUOUS
+ * @config_flags Supported zones
* @access VEHICLE_PROP_ACCESS_READ_WRITE
* @data_member hvac.temperature_set
*/
@@ -299,6 +307,7 @@
* @value_type VEHICLE_VALUE_TYPE_ZONED_BOOLEAN
* @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
* @access VEHICLE_PROP_ACCESS_READ_WRITE
+ * @config_flags Supported zones
* @data_member hvac.defrost_on
*/
#define VEHICLE_PROPERTY_HVAC_DEFROSTER (0x00000504)
@@ -308,6 +317,7 @@
* @value_type VEHICLE_VALUE_TYPE_ZONED_BOOLEAN
* @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
* @access VEHICLE_PROP_ACCESS_READ_WRITE
+ * @config_flags Supported zones
* @data_member hvac.ac_on
*/
#define VEHICLE_PROPERTY_HVAC_AC_ON (0x00000505)
@@ -379,6 +389,7 @@
* @value_type VEHICLE_VALUE_TYPE_INT32_VEC4
* @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
* @access VEHICLE_PROP_ACCESS_READ_WRITE
+ * @config_flags Number of presets supported
* @data_member int32_array
*/
#define VEHICLE_PROPERTY_RADIO_PRESET (0x0000801)
@@ -529,10 +540,10 @@
};
/**
- * Property to control audio volume of each stream.
+ * Property to control audio volume of each audio context.
*
* Data type looks like:
- * int32_array[0] : stream number (not bit flag) like VEHICLE_AUDIO_STREAM0.
+ * int32_array[0] : stream context as defined in vehicle_audio_context_flag.
* 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.
@@ -543,6 +554,7 @@
* @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)
@@ -570,8 +582,8 @@
/**
* Property for handling volume limit set by user. This limits maximum volume that can be set
- * per each volume.
- * int32_array[0] : stream number (not bit flag) like VEHICLE_AUDIO_STREAM0.
+ * per each context.
+ * int32_array[0] : stream context as defined in vehicle_audio_context_flag.
* 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.
*
@@ -582,6 +594,7 @@
* @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)
@@ -602,8 +615,8 @@
* 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 application contexts that will be sent through the physical stream. Flag
- * is defined in vehicle_app_context_flag.
+ * 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.
@@ -632,6 +645,8 @@
* @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)
@@ -652,6 +667,48 @@
};
/**
+ * Property to share currently active audio context in android side.
+ * 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.
+ *
+ * @value_type VEHICLE_VALUE_TYPE_INT32
+ * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
+ * @access VEHICLE_PROP_ACCESS_WRITE
+ * @data_member int32
+ */
+#define VEHICLE_PROPERTY_AUDIO_CONTEXT (0x00000905)
+/**
+ * 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 = 0x100,
+ /** Aux audio input is played */
+ VEHICLE_AUDIO_CONTEXT_AUX_AUDIO = 0x200,
+};
+
+/**
* Property to control power state of application processor.
*
* It is assumed that AP's power state is controller by separate power controller.
@@ -669,6 +726,7 @@
* @value_type VEHICLE_VALUE_TYPE_INT32_VEC2
* @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
* @access VEHICLE_PROP_ACCESS_READ_WRITE
+ * @config_flags Additional info on power state. Should use vehicle_ap_power_state_config_flag.
* @data_member int32_array
*/
#define VEHICLE_PROPERTY_AP_POWER_STATE (0x00000A00)
@@ -824,42 +882,6 @@
};
/**
- * Property to share currently active application context in android side.
- * 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.
- *
- * @value_type VEHICLE_VALUE_TYPE_INT32
- * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
- * @access VEHICLE_PROP_ACCESS_WRITE
- * @data_member int32
- */
-#define VEHICLE_PROPERTY_APP_CONTEXT (0x00000B00)
-/**
- * Flags to tell the current application context. The same flag is used in
- */
-enum vehicle_app_context_flag {
- /** Music playback is currently active. */
- VEHICLE_APP_CONTEXT_MUSIC_FLAG = 0x1,
- /** Navigation is currently running. */
- VEHICLE_APP_CONTEXT_NAVIGATION_FLAG = 0x2,
- /** Voice command session is currently running. */
- VEHICLE_APP_CONTEXT_VOICE_COMMAND_FLAG = 0x4,
- /** Voice call is currently active. */
- VEHICLE_APP_CONTEXT_CALL_FLAG = 0x8,
- /** Alarm is active. This may be only used in VEHICLE_PROPERTY_AUDIO_ROUTING_POLICY. */
- VEHICLE_APP_CONTEXT_ALARM_FLAG = 0x10,
- /**
- * Notification sound is active. This may be only used in VEHICLE_PROPERTY_AUDIO_ROUTING_POLICY.
- */
- VEHICLE_APP_CONTEXT_NOTIFICATION_FLAG = 0x20,
- /**
- * Context unknown. Only used for VEHICLE_PROPERTY_AUDIO_ROUTING_POLICY to represent default
- * stream for unknown contents.
- */
- VEHICLE_APP_CONTEXT_UNKNOWN_FLAG = 0x40,
-};
-
-/**
* H/W specific, non-standard property can be added as necessary. Such property should use
* property number in range of [VEHICLE_PROPERTY_CUSTOM_START, VEHICLE_PROPERTY_CUSTOM_END].
* Definition of property in this range is completely up to each HAL implementation.
@@ -1218,6 +1240,7 @@
* from 1 (see VEHICLE_RADIO_PRESET_MIN_VALUE) to vehicle_radio_num_presets.
*/
int32_t vehicle_radio_num_presets;
+ int32_t config_array[4];
};
/**
@@ -1537,8 +1560,11 @@
* @param device
* @param prop
* @param sample_rate
+ * @param zones All subscribed zones for zoned property. can be ignored for non-zoned property.
+ * 0 means all zones supported instead of no zone.
*/
- int (*subscribe)(struct vehicle_hw_device* device, int32_t prop, float sample_rate);
+ int (*subscribe)(struct vehicle_hw_device* device, int32_t prop, float sample_rate,
+ int32_t zones);
/** Cancel subscription on a property. */
int (*unsubscribe)(struct vehicle_hw_device* device, int32_t prop);
diff --git a/modules/usbaudio/audio_hal.c b/modules/usbaudio/audio_hal.c
index d0d43ab..d899d6b 100644
--- a/modules/usbaudio/audio_hal.c
+++ b/modules/usbaudio/audio_hal.c
@@ -55,11 +55,6 @@
#define DEFAULT_INPUT_BUFFER_SIZE_MS 20
-// stereo channel count
-#define FCC_2 2
-// fixed channel count of 8 limitation (for data processing in AudioFlinger)
-#define FCC_8 8
-
struct audio_device {
struct audio_hw_device hw_device;
diff --git a/modules/vehicle/vehicle.c b/modules/vehicle/vehicle.c
index 7e92ddd..38c38ee 100644
--- a/modules/vehicle/vehicle.c
+++ b/modules/vehicle/vehicle.c
@@ -372,6 +372,10 @@
}
break;
default: // unsupported
+ if (sub->impl == NULL) {
+ ALOGE("subscription impl NULL");
+ return;
+ }
if (sub->impl->error_fn_ != NULL) {
sub->impl->error_fn_(VEHICLE_ERROR_UNKNOWN, VEHICLE_PROPERTY_INVALID,
VEHICLE_OPERATION_GENERIC);
@@ -402,7 +406,8 @@
}
}
-static int vdev_subscribe(vehicle_hw_device_t* device, int32_t prop, float sample_rate) {
+static int vdev_subscribe(vehicle_hw_device_t* device, int32_t prop, float sample_rate,
+ int32_t zones) {
ALOGD("vdev_subscribe 0x%x, %f", prop, sample_rate);
vehicle_device_impl_t* impl = (vehicle_device_impl_t*)device;
// Check that the device is initialized.
diff --git a/tests/vehicle/vehicle-hal-tool.c b/tests/vehicle/vehicle-hal-tool.c
index 78fd714..d10a7b9 100755
--- a/tests/vehicle/vehicle-hal-tool.c
+++ b/tests/vehicle/vehicle-hal-tool.c
@@ -292,7 +292,7 @@
uint32_t wait_in_seconds) {
// Init the device with a callback.
device->init(device, vehicle_event_callback, vehicle_error_callback);
- int ret_code = device->subscribe(device, prop, 0);
+ int ret_code = device->subscribe(device, prop, 0, 0);
if (ret_code != 0) {
printf("Could not subscribe: %d\n", ret_code);
exit(1);
@@ -355,6 +355,7 @@
char int_array_string[1000]; int_array_string[0] = '\0';
int opt;
+ //TODO allow passing zone
while ((opt = getopt(argc, argv, "lm:p:t:v:w:s:")) != -1) {
switch (opt) {
case 'l':
diff --git a/tests/vehicle/vehicle_tests.cpp b/tests/vehicle/vehicle_tests.cpp
index 5862972..4c15570 100644
--- a/tests/vehicle/vehicle_tests.cpp
+++ b/tests/vehicle/vehicle_tests.cpp
@@ -99,7 +99,7 @@
TEST_F(VehicleDevice, subscribeTest) {
// If the device is not init subscribe should fail off the bat.
int ret_code = vehicle_device()->subscribe(vehicle_device(), VEHICLE_PROPERTY_DRIVING_STATUS,
- 0);
+ 0, 0);
ASSERT_EQ(ret_code, -EINVAL) << "Return code is: " << ret_code;
// Let's init the device.
@@ -107,7 +107,7 @@
ASSERT_EQ(ret_code, 0) << "Return code is: " << ret_code;
// Subscribe should now go through.
- ret_code = vehicle_device()->subscribe(vehicle_device(), VEHICLE_PROPERTY_DRIVING_STATUS, 0);
+ ret_code = vehicle_device()->subscribe(vehicle_device(), VEHICLE_PROPERTY_DRIVING_STATUS, 0, 0);
ASSERT_EQ(ret_code, 0) << "Return code is: " << ret_code;
// We should start getting some messages thrown from the callback. Let's