Skip to content

Commit

Permalink
MAP: Dynamic Version Upgrade for MAP 1.4 supporting remote
Browse files Browse the repository at this point in the history
This change stores version of remote device if it supports
MAP 1.4. While sending SDP response, remote device support
will be checked in conf file and if entry for remote device
is found for 1.4 support, device will send 1.4 SDP response.

CRs-Fixed: 2398865
Change-Id: I9ad9bd1d1f568d19bbcd42a50476a2560914bbcd
  • Loading branch information
Sravan Voleti authored and Gerrit - the friendly Code Review server committed Feb 15, 2019
1 parent 50d5997 commit aa1995a
Show file tree
Hide file tree
Showing 8 changed files with 274 additions and 8 deletions.
8 changes: 8 additions & 0 deletions bta/dm/bta_dm_act.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1659,20 +1659,23 @@ static void bta_dm_store_profiles_version() {
UUID_SERVCLASS_HF_HANDSFREE,
UUID_SERVCLASS_AV_REMOTE_CONTROL,
UUID_SERVCLASS_AV_REM_CTRL_TARGET,
UUID_SERVCLASS_MESSAGE_NOTIFICATION,
};

const UINT16 btprofile_uuids[] = {
UUID_SERVCLASS_ADV_AUDIO_DISTRIBUTION,
UUID_SERVCLASS_HF_HANDSFREE,
UUID_SERVCLASS_AV_REMOTE_CONTROL,
UUID_SERVCLASS_AV_REMOTE_CONTROL,
UUID_SERVCLASS_MAP_PROFILE,
};

const char* profile_keys[] = {
A2DP_VERSION_CONFIG_KEY,
HFP_VERSION_CONFIG_KEY,
AV_REM_CTRL_VERSION_CONFIG_KEY,
AV_REM_CTRL_TG_VERSION_CONFIG_KEY,
MAP_MCE_VERSION_CONFIG_KEY,
};

int profile_num = sizeof(servclass_uuids)/sizeof(servclass_uuids[0]);
Expand All @@ -1691,6 +1694,11 @@ static void bta_dm_store_profiles_version() {
/* get profile version (if failure, version parameter is not updated) */
SDP_FindProfileVersionInRec(sdp_rec, btprofile_uuids[i], &profile_version);
if (profile_version != 0) {
if (servclass_uuids[i] == UUID_SERVCLASS_MESSAGE_NOTIFICATION) {
APPL_TRACE_DEBUG("%s MCE record found ", __func__);
check_and_store_mce_profile_version(sdp_rec);
continue;
}
if (btif_config_set_uint16(sdp_rec->remote_bd_addr.ToString().c_str(),
profile_keys[i],
profile_version)) {
Expand Down
2 changes: 2 additions & 0 deletions bta/sdp/bta_sdp_act.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ static const Uuid UUID_MAP_MNS = Uuid::From16Bit(0x1133);
static const Uuid UUID_SAP = Uuid::From16Bit(0x112D);

extern void check_and_store_pce_profile_version(tSDP_DISC_REC* p_sdp_rec);
extern void check_and_store_mce_profile_version(tSDP_DISC_REC* p_sdp_rec);

static void bta_create_mns_sdp_record(bluetooth_sdp_record* record,
tSDP_DISC_REC* p_rec) {
Expand Down Expand Up @@ -365,6 +366,7 @@ static void bta_sdp_search_cback(uint16_t result, void* user_data) {
bta_create_mas_sdp_record(&evt_data.records[count], p_rec);
} else if (uuid == UUID_MAP_MNS) {
APPL_TRACE_DEBUG("%s() - found MAP (MNS) uuid", __func__);
check_and_store_mce_profile_version(p_rec);
bta_create_mns_sdp_record(&evt_data.records[count], p_rec);
} else if (uuid == UUID_PBAP_PSE) {
APPL_TRACE_DEBUG("%s() - found PBAP (PSE) uuid", __func__);
Expand Down
2 changes: 2 additions & 0 deletions btif/include/btif_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
#define AV_REM_CTRL_TG_VERSION_CONFIG_KEY "AvrcpTgVersion"
#define AV_REM_CTRL_FEATURES_CONFIG_KEY "AvrcpFeatures"
#define PBAP_PCE_VERSION_CONFIG_KEY "PbapPceVersion"
#define MAP_MCE_VERSION_CONFIG_KEY "MapMceVersion"


static const char BTIF_CONFIG_MODULE[] = "btif_config_module";

Expand Down
2 changes: 2 additions & 0 deletions btif/src/btif_dm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,8 @@ void bond_state_changed(bt_status_t status, const RawAddress& bd_addr,
if (state == BT_BOND_STATE_NONE) {
// Update Pbap 1.2 entry, set rebonded to true
update_pce_entry_after_cancelling_bonding(bd_addr);
// Update Map 1.4 entry, set rebonded to true
update_mce_entry_after_cancelling_bonding(bd_addr);
}
}

Expand Down
2 changes: 2 additions & 0 deletions btif/src/btif_storage.cc
Original file line number Diff line number Diff line change
Expand Up @@ -895,6 +895,8 @@ bt_status_t btif_storage_remove_bonded_device(
ret &= btif_config_remove(bdstr, "AvrcpTgVersion");
if (btif_config_exist(bdstr, "PbapPceVersion"))
ret &= btif_config_remove(bdstr, "PbapPceVersion");
if (btif_config_exist(bdstr, MAP_MCE_VERSION_CONFIG_KEY))
ret &= btif_config_remove(bdstr, MAP_MCE_VERSION_CONFIG_KEY);
/* Retaining AvrcpFeatures and TwsPlusPeerAddr
as these are needed even after unpair */
/* write bonded info immediately */
Expand Down
Loading

0 comments on commit aa1995a

Please sign in to comment.