Loading system/bta/ag/bta_ag_act.cc +5 −3 Original line number Diff line number Diff line Loading @@ -176,9 +176,11 @@ void bta_ag_start_open(tBTA_AG_SCB* p_scb, const tBTA_AG_DATA& data) { RawAddress pending_bd_addr = {}; /* store parameters */ if (!data.IsEmpty()) { p_scb->peer_addr = data.api_open.bd_addr; p_scb->open_services = data.api_open.services; p_scb->cli_sec_mask = data.api_open.sec_mask; } /* Check if RFCOMM has any incoming connection to avoid collision. */ if (PORT_IsOpening(pending_bd_addr)) { Loading system/bta/ag/bta_ag_int.h +17 −0 Original line number Diff line number Diff line Loading @@ -164,6 +164,23 @@ union tBTA_AG_DATA { tBTA_AG_DISC_RESULT disc_result; tBTA_AG_RFC rfc; static const tBTA_AG_DATA kEmpty; /** * Check if two tBTA_AG_DATA are equal in memory * * @param rhs other tBTA_AG_DATA * @return true if both unions are equal in memory */ bool operator==(const tBTA_AG_DATA& rhs) const { return (std::memcmp(this, &rhs, sizeof(tBTA_AG_DATA)) == 0); } /** * Check if this union is empty by comparing it to the kEmpty constant * * @return true if this union is empty */ bool IsEmpty() const { return *this == kEmpty; } }; /* type for each profile */ Loading Loading
system/bta/ag/bta_ag_act.cc +5 −3 Original line number Diff line number Diff line Loading @@ -176,9 +176,11 @@ void bta_ag_start_open(tBTA_AG_SCB* p_scb, const tBTA_AG_DATA& data) { RawAddress pending_bd_addr = {}; /* store parameters */ if (!data.IsEmpty()) { p_scb->peer_addr = data.api_open.bd_addr; p_scb->open_services = data.api_open.services; p_scb->cli_sec_mask = data.api_open.sec_mask; } /* Check if RFCOMM has any incoming connection to avoid collision. */ if (PORT_IsOpening(pending_bd_addr)) { Loading
system/bta/ag/bta_ag_int.h +17 −0 Original line number Diff line number Diff line Loading @@ -164,6 +164,23 @@ union tBTA_AG_DATA { tBTA_AG_DISC_RESULT disc_result; tBTA_AG_RFC rfc; static const tBTA_AG_DATA kEmpty; /** * Check if two tBTA_AG_DATA are equal in memory * * @param rhs other tBTA_AG_DATA * @return true if both unions are equal in memory */ bool operator==(const tBTA_AG_DATA& rhs) const { return (std::memcmp(this, &rhs, sizeof(tBTA_AG_DATA)) == 0); } /** * Check if this union is empty by comparing it to the kEmpty constant * * @return true if this union is empty */ bool IsEmpty() const { return *this == kEmpty; } }; /* type for each profile */ Loading