Skip to content

Commit

Permalink
Inclusive Language Updates
Browse files Browse the repository at this point in the history
master -> central
MASTER -> CENTRAL
Master -> Central

BYPASS_INCLUSIVE_LANGUAGE_REASON=required to explain the update

Bug: 170342881
Tag: #refactor
Test: cert/run --host
Test: atest --host bluetooth_test_common
Test: atest --host bluetooth_test_gd
Test: atest net_test_btif
Change-Id: I861ca756f04c06547ee9cb580029404308c678f2
Merged-In: I861ca756f04c06547ee9cb580029404308c678f2
  • Loading branch information
goptedoblivion committed Oct 14, 2020
1 parent a3d687c commit cd51927
Show file tree
Hide file tree
Showing 89 changed files with 673 additions and 664 deletions.
24 changes: 12 additions & 12 deletions bta/av/bta_av_aact.cc
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@ void bta_av_do_disc_a2dp(tBTA_AV_SCB* p_scb, tBTA_AV_DATA* p_data) {
BTA_AV_AVRC_TIMER_EVT, p_scb->hndl);
}

if (bta_av_cb.features & BTA_AV_FEAT_MASTER) {
if (bta_av_cb.features & BTA_AV_FEAT_CENTRAL) {
BTM_default_block_role_switch();
}
/* store peer addr other parameters */
Expand Down Expand Up @@ -1793,11 +1793,11 @@ void bta_av_do_start(tBTA_AV_SCB* p_scb, tBTA_AV_DATA* p_data) {
return;
}

/* disallow role switch during streaming, only if we are the master role
/* disallow role switch during streaming, only if we are the central role
* i.e. allow role switch, if we are slave.
* It would not hurt us, if the peer device wants us to be master */
* It would not hurt us, if the peer device wants us to be central */
if ((BTM_GetRole(p_scb->PeerAddress(), &cur_role) == BTM_SUCCESS) &&
(cur_role == HCI_ROLE_MASTER)) {
(cur_role == HCI_ROLE_CENTRAL)) {
BTM_block_role_switch_for(p_scb->PeerAddress());
}

Expand Down Expand Up @@ -1867,7 +1867,7 @@ void bta_av_str_stopped(tBTA_AV_SCB* p_scb, tBTA_AV_DATA* p_data) {
bta_av_cb.audio_open_cnt, p_data, start);

bta_sys_idle(BTA_ID_AV, bta_av_cb.audio_open_cnt, p_scb->PeerAddress());
if ((bta_av_cb.features & BTA_AV_FEAT_MASTER) == 0 ||
if ((bta_av_cb.features & BTA_AV_FEAT_CENTRAL) == 0 ||
bta_av_cb.audio_open_cnt == 1) {
BTM_unblock_role_switch_for(p_scb->PeerAddress());
}
Expand Down Expand Up @@ -2229,10 +2229,10 @@ void bta_av_start_ok(tBTA_AV_SCB* p_scb, tBTA_AV_DATA* p_data) {
if (!bta_av_link_role_ok(p_scb, A2DP_SET_ONE_BIT))
p_scb->q_tag = BTA_AV_Q_TAG_START;
else {
/* The wait flag may be set here while we are already master on the link */
/* The wait flag may be set here while we are already central on the link */
/* this could happen if a role switch complete event occurred during
* reconfig */
/* if we are now master on the link, there is no need to wait for the role
/* if we are now central on the link, there is no need to wait for the role
* switch, */
/* complete anymore so we can clear the wait for role switch flag */
p_scb->wait &= ~BTA_AV_WAIT_ROLE_SW_BITS;
Expand Down Expand Up @@ -2291,12 +2291,12 @@ void bta_av_start_ok(tBTA_AV_SCB* p_scb, tBTA_AV_DATA* p_data) {
{
/* If sink starts stream, disable sniff mode here */
if (!initiator) {
/* If souce is the master role, disable role switch during streaming.
/* If souce is the central role, disable role switch during streaming.
* Otherwise allow role switch, if source is slave.
* Because it would not hurt source, if the peer device wants source to be
* master */
* central */
if ((BTM_GetRole(p_scb->PeerAddress(), &cur_role) == BTM_SUCCESS) &&
(cur_role == HCI_ROLE_MASTER)) {
(cur_role == HCI_ROLE_CENTRAL)) {
BTM_block_role_switch_for(p_scb->PeerAddress());
}
}
Expand Down Expand Up @@ -2382,7 +2382,7 @@ void bta_av_str_closed(tBTA_AV_SCB* p_scb, tBTA_AV_DATA* p_data) {
__func__, p_scb->PeerAddress().ToString().c_str(), p_scb->hndl,
p_scb->open_status, p_scb->chnl, p_scb->co_started);

if ((bta_av_cb.features & BTA_AV_FEAT_MASTER) == 0 ||
if ((bta_av_cb.features & BTA_AV_FEAT_CENTRAL) == 0 ||
bta_av_cb.audio_open_cnt == 1) {
BTM_unblock_role_switch_for(p_scb->PeerAddress());
}
Expand Down Expand Up @@ -2493,7 +2493,7 @@ void bta_av_suspend_cfm(tBTA_AV_SCB* p_scb, tBTA_AV_DATA* p_data) {
}

bta_sys_idle(BTA_ID_AV, bta_av_cb.audio_open_cnt, p_scb->PeerAddress());
if ((bta_av_cb.features & BTA_AV_FEAT_MASTER) == 0 ||
if ((bta_av_cb.features & BTA_AV_FEAT_CENTRAL) == 0 ||
bta_av_cb.audio_open_cnt == 1) {
BTM_unblock_role_switch_for(p_scb->PeerAddress());
}
Expand Down
18 changes: 9 additions & 9 deletions bta/av/bta_av_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -949,7 +949,7 @@ static void bta_av_sco_chg_cback(tBTA_SYS_CONN_STATUS status, uint8_t id,
******************************************************************************/
bool bta_av_switch_if_needed(tBTA_AV_SCB* p_scb) {
// TODO: A workaround for devices that are connected first, become
// Master, and block follow-up role changes - b/72122792 .
// Central, and block follow-up role changes - b/72122792 .
return false;
#if 0
uint8_t role;
Expand All @@ -967,11 +967,11 @@ bool bta_av_switch_if_needed(tBTA_AV_SCB* p_scb) {
BTM_GetRole(p_scbi->PeerAddress(), &role);
/* this channel is open - clear the role switch link policy for this link
*/
if (HCI_ROLE_MASTER != role) {
if (bta_av_cb.features & BTA_AV_FEAT_MASTER)
if (HCI_ROLE_CENTRAL != role) {
if (bta_av_cb.features & BTA_AV_FEAT_CENTRAL)
BTM_block_role_switch_for(p_scbi->PeerAddress());
if (BTM_CMD_STARTED !=
BTM_SwitchRole(p_scbi->PeerAddress(), HCI_ROLE_MASTER)) {
BTM_SwitchRole(p_scbi->PeerAddress(), HCI_ROLE_CENTRAL)) {
/* can not switch role on SCBI
* start the timer on SCB - because this function is ONLY called when
* SCB gets API_OPEN */
Expand Down Expand Up @@ -1009,17 +1009,17 @@ bool bta_av_link_role_ok(tBTA_AV_SCB* p_scb, uint8_t bits) {
"features:0x%x",
__func__, p_scb->PeerAddress().ToString().c_str(), p_scb->hndl, role,
bta_av_cb.conn_audio, bits, bta_av_cb.features);
if (HCI_ROLE_MASTER != role &&
if (HCI_ROLE_CENTRAL != role &&
(A2DP_BitsSet(bta_av_cb.conn_audio) > bits ||
(bta_av_cb.features & BTA_AV_FEAT_MASTER))) {
if (bta_av_cb.features & BTA_AV_FEAT_MASTER)
(bta_av_cb.features & BTA_AV_FEAT_CENTRAL))) {
if (bta_av_cb.features & BTA_AV_FEAT_CENTRAL)
BTM_block_role_switch_for(p_scb->PeerAddress());

tBTM_STATUS status =
BTM_SwitchRole(p_scb->PeerAddress(), HCI_ROLE_MASTER);
BTM_SwitchRole(p_scb->PeerAddress(), HCI_ROLE_CENTRAL);
if (status != BTM_CMD_STARTED) {
/* can not switch role on SCB - start the timer on SCB */
LOG_ERROR("%s: peer %s BTM_SwitchRole(HCI_ROLE_MASTER) error: %d",
LOG_ERROR("%s: peer %s BTM_SwitchRole(HCI_ROLE_CENTRAL) error: %d",
__func__, p_scb->PeerAddress().ToString().c_str(), status);
}
if (status != BTM_MODE_UNSUPPORTED && status != BTM_DEV_BLACKLISTED) {
Expand Down
23 changes: 11 additions & 12 deletions bta/dm/bta_dm_act.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2202,11 +2202,11 @@ static void handle_role_change(const RawAddress& bd_addr, uint8_t new_role,
hci_status == HCI_SUCCESS) {
/* more than one connections and the AV connection is role switched
* to slave
* switch it back to master and remove the switch policy */
BTM_SwitchRole(bd_addr, HCI_ROLE_MASTER);
* switch it back to central and remove the switch policy */
BTM_SwitchRole(bd_addr, HCI_ROLE_CENTRAL);
need_policy_change = true;
} else if (p_bta_dm_cfg->avoid_scatter && (new_role == HCI_ROLE_MASTER)) {
/* if the link updated to be master include AV activities, remove
} else if (p_bta_dm_cfg->avoid_scatter && (new_role == HCI_ROLE_CENTRAL)) {
/* if the link updated to be central include AV activities, remove
* the switch policy */
need_policy_change = true;
}
Expand All @@ -2217,7 +2217,7 @@ static void handle_role_change(const RawAddress& bd_addr, uint8_t new_role,
} else {
/* there's AV no activity on this link and role switch happened
* check if AV is active
* if so, make sure the AV link is master */
* if so, make sure the AV link is central */
bta_dm_check_av();
}
bta_sys_notify_role_chg(bd_addr, new_role, hci_status);
Expand Down Expand Up @@ -2374,7 +2374,7 @@ void BTA_dm_acl_down(const RawAddress bd_addr, tBT_TRANSPORT transport) {
* Function bta_dm_check_av
*
* Description This function checks if AV is active
* if yes, make sure the AV link is master
* if yes, make sure the AV link is central
*
******************************************************************************/
static void bta_dm_check_av() {
Expand All @@ -2389,9 +2389,9 @@ static void bta_dm_check_av() {
p_dev->info);
if ((p_dev->conn_state == BTA_DM_CONNECTED) &&
(p_dev->info & BTA_DM_DI_AV_ACTIVE)) {
/* make master and take away the role switch policy */
BTM_SwitchRole(p_dev->peer_bdaddr, HCI_ROLE_MASTER);
/* else either already master or can not switch for some reasons */
/* make central and take away the role switch policy */
BTM_SwitchRole(p_dev->peer_bdaddr, HCI_ROLE_CENTRAL);
/* else either already central or can not switch for some reasons */
BTM_block_role_switch_for(p_dev->peer_bdaddr);
break;
}
Expand Down Expand Up @@ -2571,9 +2571,8 @@ static void bta_dm_adjust_roles(bool delay_role_switch) {
if (bta_dm_cb.device_list.peer_device[i].conn_state == BTA_DM_CONNECTED &&
bta_dm_cb.device_list.peer_device[i].transport ==
BT_TRANSPORT_BR_EDR) {

if ((bta_dm_cb.device_list.peer_device[i].pref_role ==
BTA_MASTER_ROLE_ONLY) ||
BTA_CENTRAL_ROLE_ONLY) ||
(br_count > 1)) {
/* Initiating immediate role switch with certain remote devices
has caused issues due to role switch colliding with link encryption
Expand All @@ -2588,7 +2587,7 @@ static void bta_dm_adjust_roles(bool delay_role_switch) {
BTA_SLAVE_ROLE_ONLY &&
!delay_role_switch) {
BTM_SwitchRole(bta_dm_cb.device_list.peer_device[i].peer_bdaddr,
HCI_ROLE_MASTER);
HCI_ROLE_CENTRAL);
} else {
alarm_set_on_mloop(bta_dm_cb.switch_delay_timer,
BTA_DM_SWITCH_DELAY_TIMER_MS,
Expand Down
12 changes: 6 additions & 6 deletions bta/dm/bta_dm_cfg.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
#define BTA_DM_LINK_TIMEOUT 8000
#endif

/* TRUE to avoid scatternet when av is streaming (be the master) */
/* TRUE to avoid scatternet when av is streaming (be the central) */
#ifndef BTA_DM_AVOID_SCATTER_A2DP
#define BTA_DM_AVOID_SCATTER_A2DP TRUE
#endif
Expand All @@ -62,7 +62,7 @@ const tBTA_DM_CFG bta_dm_cfg = {
BTA_DM_PAGE_TIMEOUT,
/* link supervision timeout in 625uS*/
BTA_DM_LINK_TIMEOUT,
/* true to avoid scatternet when av is streaming (be the master) */
/* true to avoid scatternet when av is streaming (be the central) */
BTA_DM_AVOID_SCATTER_A2DP};

#ifndef BTA_DM_SCATTERNET
Expand All @@ -76,12 +76,12 @@ const tBTA_DM_CFG bta_dm_cfg = {
#endif

#ifndef BTA_AV_ROLE
/* By default, AV role (backward BTA_MASTER_ROLE_PREF) */
#define BTA_AV_ROLE BTA_MASTER_ROLE_PREF
/* By default, AV role (backward BTA_CENTRAL_ROLE_PREF) */
#define BTA_AV_ROLE BTA_CENTRAL_ROLE_PREF
#endif

#ifndef BTA_PANU_ROLE
/* By default, AV role (backward BTA_MASTER_ROLE_PREF) */
/* By default, AV role (backward BTA_CENTRAL_ROLE_PREF) */
#define BTA_PANU_ROLE BTA_SLAVE_ROLE_ONLY
#endif
#define BTA_DM_NUM_RM_ENTRY 6
Expand All @@ -99,7 +99,7 @@ const tBTA_DM_RM bta_dm_rm_cfg[] = {
{BTA_ID_SYS, BTA_DM_NUM_RM_ENTRY, BTA_DM_SCATTERNET},
{BTA_ID_PAN, BTUI_PAN_ID_NAP, BTA_ANY_ROLE},
{BTA_ID_PAN, BTUI_PAN_ID_GN, BTA_ANY_ROLE},
{BTA_ID_PAN, BTA_APP_ID_PAN_MULTI, BTA_MASTER_ROLE_ONLY},
{BTA_ID_PAN, BTA_APP_ID_PAN_MULTI, BTA_CENTRAL_ROLE_ONLY},
{BTA_ID_PAN, BTUI_PAN_ID_PANU, BTA_PANU_ROLE},
{BTA_ID_HH, BTA_ALL_APP_ID, BTA_HH_ROLE},
{BTA_ID_AV, BTA_ALL_APP_ID, BTA_AV_ROLE}};
Expand Down
4 changes: 2 additions & 2 deletions bta/dm/bta_dm_int.h
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ typedef struct {
alarm_t* disable_timer;
uint32_t wbt_sdp_handle; /* WIDCOMM Extensions SDP record handle */
uint8_t wbt_scn; /* WIDCOMM Extensions SCN */
uint8_t num_master_only;
uint8_t num_central_only;
uint8_t pm_id;
tBTA_PM_TIMER pm_timer[BTA_DM_NUM_PM_TIMER];
uint8_t cur_av_count; /* current AV connecions */
Expand Down Expand Up @@ -342,7 +342,7 @@ typedef struct {
uint16_t page_timeout; /* timeout for page in slots */
uint16_t link_timeout; /* link supervision timeout in slots */
bool avoid_scatter; /* true to avoid scatternet when av is streaming (be the
master) */
central) */

} tBTA_DM_CFG;

Expand Down
2 changes: 1 addition & 1 deletion bta/gatt/bta_gattc_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ bool bta_gattc_check_bg_conn(tGATT_IF client_if, const RawAddress& remote_bda,
if (p_bg_tck->in_use && (p_bg_tck->remote_bda == remote_bda ||
p_bg_tck->remote_bda.IsEmpty())) {
if (((p_bg_tck->cif_mask & (1 << (client_if - 1))) != 0) &&
role == HCI_ROLE_MASTER)
role == HCI_ROLE_CENTRAL)
is_bg_conn = true;
}
}
Expand Down
14 changes: 7 additions & 7 deletions bta/include/bta_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@ typedef uint16_t tBTA_DM_CONN;

/* M/S preferred roles */
#define BTA_ANY_ROLE 0x00
#define BTA_MASTER_ROLE_PREF 0x01
#define BTA_MASTER_ROLE_ONLY 0x02
#define BTA_CENTRAL_ROLE_PREF 0x01
#define BTA_CENTRAL_ROLE_ONLY 0x02
#define BTA_SLAVE_ROLE_ONLY \
0x03 /* Used for PANU only, skip role switch to master */
0x03 /* Used for PANU only, skip role switch to central */

typedef uint8_t tBTA_PREF_ROLES;

Expand All @@ -131,11 +131,11 @@ enum {
BTA_DM_NO_SCATTERNET, /* Device doesn't support scatternet, it might
support "role switch during connection" for
an incoming connection, when it already has
another connection in master role */
another connection in central role */
BTA_DM_PARTIAL_SCATTERNET, /* Device supports partial scatternet. It can have
simulateous connection in Master and Slave roles
for short period of time */
BTA_DM_FULL_SCATTERNET /* Device can have simultaneous connection in master
simultaneous connection in Central and Slave
roles for short period of time */
BTA_DM_FULL_SCATTERNET /* Device can have simultaneous connection in central
and slave roles */

};
Expand Down
2 changes: 1 addition & 1 deletion bta/include/bta_av_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ typedef uint8_t tBTA_AV_STATUS;
#define BTA_AV_FEAT_MULTI_AV \
0x0080 /* use multi-av, if controller supports it */
#define BTA_AV_FEAT_BROWSE 0x0010 /* use browsing channel */
#define BTA_AV_FEAT_MASTER 0x0100 /* stream only as master role */
#define BTA_AV_FEAT_CENTRAL 0x0100 /* stream only as central role */
#define BTA_AV_FEAT_ADV_CTRL \
0x0200 /* remote control Advanced Control command/response */
#define BTA_AV_FEAT_DELAY_RPT 0x0400 /* allow delay reporting */
Expand Down
2 changes: 1 addition & 1 deletion bta/pan/bta_pan_act.cc
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ void bta_pan_conn_open(tBTA_PAN_SCB* p_scb, tBTA_PAN_DATA* p_data) {
p_scb->app_flow_enable = true;

/* If app_id is NAP/GN, check whether there are multiple connections.
If there are, provide a special app_id to dm to enforce master role only.
If there are, provide a special app_id to dm to enforce central role only.
*/
if (p_scb->app_id == bta_pan_cb.app_id[2] &&
bta_pan_has_multiple_connections(p_scb->app_id)) {
Expand Down
2 changes: 1 addition & 1 deletion btif/src/btif_bqr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ std::string BqrVseSubEvt::ToString() const {
ss << QualityReportIdToString(bqr_link_quality_event_.quality_report_id)
<< ", Handle: " << loghex(bqr_link_quality_event_.connection_handle)
<< ", " << PacketTypeToString(bqr_link_quality_event_.packet_types) << ", "
<< ((bqr_link_quality_event_.connection_role == 0) ? "Master" : "Slave ")
<< ((bqr_link_quality_event_.connection_role == 0) ? "Central" : "Slave ")
<< ", PwLv: " << std::to_string(bqr_link_quality_event_.tx_power_level)
<< ", RSSI: " << std::to_string(bqr_link_quality_event_.rssi)
<< ", SNR: " << std::to_string(bqr_link_quality_event_.snr)
Expand Down
2 changes: 1 addition & 1 deletion build/install_deps.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
CLANG_PACKAGE=clang
GNSHA1_URL="https://chromium.googlesource.com/chromium/buildtools/\
+/master/linux64/gn.sha1?format=TEXT"
+/central/linux64/gn.sha1?format=TEXT"

# Check if clang is already installed on current system
clang_path=`which clang`
Expand Down
4 changes: 2 additions & 2 deletions device/include/controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ typedef struct controller_t {
bool (*supports_interlaced_inquiry_scan)(void);
bool (*supports_rssi_with_inquiry_results)(void);
bool (*supports_extended_inquiry_response)(void);
bool (*supports_master_slave_role_switch)(void);
bool (*supports_central_slave_role_switch)(void);
bool (*supports_enhanced_setup_synchronous_connection)(void);
bool (*supports_enhanced_accept_synchronous_connection)(void);
bool (*supports_3_slot_packets)(void);
Expand Down Expand Up @@ -82,7 +82,7 @@ typedef struct controller_t {
bool (*supports_ble_connection_parameter_request)(void);
bool (*supports_ble_periodic_advertising_sync_transfer_sender)(void);
bool (*supports_ble_periodic_advertising_sync_transfer_recipient)(void);
bool (*supports_ble_connected_isochronous_stream_master)(void);
bool (*supports_ble_connected_isochronous_stream_central)(void);
bool (*supports_ble_connected_isochronous_stream_slave)(void);
bool (*supports_ble_isochronous_broadcaster)(void);
bool (*supports_ble_synchronized_receiver)(void);
Expand Down
12 changes: 6 additions & 6 deletions device/src/controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ static future_t* start_up(void) {
packet_parser->parse_ble_read_local_supported_features_response(
response, &features_ble);

iso_supported = HCI_LE_CIS_MASTER(features_ble.as_array) ||
iso_supported = HCI_LE_CIS_CENTRAL(features_ble.as_array) ||
HCI_LE_CIS_SLAVE(features_ble.as_array) ||
HCI_LE_ISO_BROADCASTER(features_ble.as_array);

Expand Down Expand Up @@ -393,7 +393,7 @@ static bool supports_extended_inquiry_response(void) {
return HCI_EXT_INQ_RSP_SUPPORTED(features_classic[0].as_array);
}

static bool supports_master_slave_role_switch(void) {
static bool supports_central_slave_role_switch(void) {
CHECK(readable);
return HCI_SWITCH_SUPPORTED(features_classic[0].as_array);
}
Expand Down Expand Up @@ -598,10 +598,10 @@ static bool supports_ble_periodic_advertising_sync_transfer_recipient(void) {
features_ble.as_array);
}

static bool supports_ble_connected_isochronous_stream_master(void) {
static bool supports_ble_connected_isochronous_stream_central(void) {
CHECK(readable);
CHECK(ble_supported);
return HCI_LE_CIS_MASTER(features_ble.as_array);
return HCI_LE_CIS_CENTRAL(features_ble.as_array);
}

static bool supports_ble_connected_isochronous_stream_slave(void) {
Expand Down Expand Up @@ -745,7 +745,7 @@ static const controller_t interface = {
supports_interlaced_inquiry_scan,
supports_rssi_with_inquiry_results,
supports_extended_inquiry_response,
supports_master_slave_role_switch,
supports_central_slave_role_switch,
supports_enhanced_setup_synchronous_connection,
supports_enhanced_accept_synchronous_connection,
supports_3_slot_packets,
Expand Down Expand Up @@ -784,7 +784,7 @@ static const controller_t interface = {
supports_ble_connection_parameter_request,
supports_ble_periodic_advertising_sync_transfer_sender,
supports_ble_periodic_advertising_sync_transfer_recipient,
supports_ble_connected_isochronous_stream_master,
supports_ble_connected_isochronous_stream_central,
supports_ble_connected_isochronous_stream_slave,
supports_ble_isochronous_broadcaster,
supports_ble_synchronized_receiver,
Expand Down
Loading

0 comments on commit cd51927

Please sign in to comment.