Merge "[DO NOT MERGE] Implement key attestation using AndroidKeystore." into pi-dev-plus-aosp
diff --git a/bta/hf_client/bta_hf_client_main.cc b/bta/hf_client/bta_hf_client_main.cc
index 9bb8ab5..fac61c7 100644
--- a/bta/hf_client/bta_hf_client_main.cc
+++ b/bta/hf_client/bta_hf_client_main.cc
@@ -329,6 +329,8 @@
client_cb->state = BTA_HF_CLIENT_OPENING_ST;
tBTA_HF_CLIENT_DATA msg;
msg.hdr.layer_specific = client_cb->handle;
+ msg.api_open.bd_addr = client_cb->peer_addr;
+ msg.api_open.sec_mask = client_cb->cli_sec_mask;
bta_hf_client_start_open(&msg);
}
}
@@ -749,19 +751,14 @@
evt.bd_addr = client_cb->peer_addr;
if (client_cb->state == BTA_HF_CLIENT_INIT_ST) {
bta_hf_client_app_callback(BTA_HF_CLIENT_CLOSE_EVT, &evt);
+ APPL_TRACE_DEBUG("%s: marking CB handle %d to false", __func__, client_cb->handle);
+ client_cb->is_allocated = false;
} else if (client_cb->state == BTA_HF_CLIENT_OPEN_ST) {
evt.open.handle = client_cb->handle;
bta_hf_client_app_callback(BTA_HF_CLIENT_OPEN_EVT, &evt);
}
}
- /* if the next state is INIT then release the cb for future use */
- if (client_cb->state == BTA_HF_CLIENT_INIT_ST) {
- APPL_TRACE_DEBUG("%s: marking CB handle %d to false", __func__,
- client_cb->handle);
- client_cb->is_allocated = false;
- }
-
VLOG(2) << __func__ << ": device " << client_cb->peer_addr
<< "state change: [" << bta_hf_client_state_str(in_state) << "] -> ["
<< bta_hf_client_state_str(client_cb->state) << "] after Event ["
diff --git a/btif/src/btif_rc.cc b/btif/src/btif_rc.cc
index f8cd625..9919a7b 100644
--- a/btif/src/btif_rc.cc
+++ b/btif/src/btif_rc.cc
@@ -1365,8 +1365,6 @@
static uint8_t fill_attribute_id_array(
uint8_t cmd_attribute_number, btrc_media_attr_t* cmd_attribute_id_array,
size_t out_array_size, btrc_media_attr_t* out_attribute_id_array) {
- /* Reset attribute array */
- memset(out_attribute_id_array, 0, out_array_size);
/* Default case for cmd_attribute_number == 0xFF, No attribute */
uint8_t out_attribute_number = 0;
if (cmd_attribute_number == 0) {
@@ -1438,7 +1436,7 @@
AVRC_STS_BAD_CMD, pavrc_cmd->cmd.opcode);
} break;
case AVRC_PDU_GET_ELEMENT_ATTR: {
- btrc_media_attr_t element_attrs[BTRC_MAX_ELEM_ATTR_SIZE];
+ btrc_media_attr_t element_attrs[BTRC_MAX_ELEM_ATTR_SIZE] = {};
uint8_t num_attr = fill_attribute_id_array(
pavrc_cmd->get_elem_attrs.num_attr,
(btrc_media_attr_t*)pavrc_cmd->get_elem_attrs.attrs,
@@ -1485,7 +1483,7 @@
} break;
case AVRC_PDU_GET_FOLDER_ITEMS: {
- uint32_t attr_ids[BTRC_MAX_ELEM_ATTR_SIZE];
+ uint32_t attr_ids[BTRC_MAX_ELEM_ATTR_SIZE] = {0};
uint8_t num_attr;
num_attr = pavrc_cmd->get_items.attr_count;
@@ -1576,7 +1574,7 @@
} break;
case AVRC_PDU_GET_ITEM_ATTRIBUTES: {
- btrc_media_attr_t item_attrs[BTRC_MAX_ELEM_ATTR_SIZE];
+ btrc_media_attr_t item_attrs[BTRC_MAX_ELEM_ATTR_SIZE] = {};
uint8_t num_attr = fill_attribute_id_array(
pavrc_cmd->get_attrs.attr_count,
(btrc_media_attr_t*)pavrc_cmd->get_attrs.p_attr_list,
@@ -2045,7 +2043,7 @@
} break;
case AVRC_ITEM_MEDIA: {
- tAVRC_ATTR_ENTRY attr_vals[BTRC_MAX_ELEM_ATTR_SIZE];
+ tAVRC_ATTR_ENTRY attr_vals[BTRC_MAX_ELEM_ATTR_SIZE] = {};
memcpy(item.u.media.uid, cur_item->media.uid, sizeof(tAVRC_UID));
item.u.media.type = cur_item->media.type;