Skip to content
Snippets Groups Projects
Commit b9a19014 authored by David Duarte's avatar David Duarte Committed by Android (Google) Code Review
Browse files

Merge "[BluetoothMetrics] Adding dependent changes for direct LE-ACL L2CAP...

Merge "[BluetoothMetrics] Adding dependent changes for direct LE-ACL L2CAP fixed channel" into tm-qpr-dev
parents 5773c861 01bcd532
No related branches found
No related tags found
No related merge requests found
......@@ -75,6 +75,17 @@ void LEConnectionMetricState::AddStateChangedEvent(
end_timepoint = current_timestamp;
switch (state) {
case LeConnectionState::STATE_LE_ACL_START: {
int connection_type_cid = GetArgumentTypeFromList(argument_list, os::ArgumentType::L2CAP_CID);
if (connection_type_cid != -1) {
LeConnectionType connection_type = GetLeConnectionTypeFromCID(connection_type_cid);
if (connection_type != LeConnectionType::CONNECTION_TYPE_UNSPECIFIED) {
LOG_INFO("LEConnectionMetricsRemoteDevice: Populating the connection type\n");
input_connection_type = connection_type;
}
}
break;
}
case LeConnectionState::STATE_LE_ACL_END: {
int acl_status_code_from_args =
GetArgumentTypeFromList(argument_list, os::ArgumentType::ACL_STATUS_CODE);
......
......@@ -45,6 +45,29 @@ int GetArgumentTypeFromList(
return -1;
}
os::LeConnectionType GetLeConnectionTypeFromCID(int fixed_cid) {
switch(fixed_cid) {
case 3: {
return os::LeConnectionType::CONNECTION_TYPE_L2CAP_FIXED_CHNL_AMP;
}
case 4: {
return os::LeConnectionType::CONNECTION_TYPE_L2CAP_FIXED_CHNL_ATT;
}
case 5: {
return os::LeConnectionType::CONNECTION_TYPE_L2CAP_FIXED_CHNL_LE_SIGNALLING;
}
case 6: {
return os::LeConnectionType::CONNECTION_TYPE_L2CAP_FIXED_CHNL_SMP;
}
case 7: {
return os::LeConnectionType::CONNECTION_TYPE_L2CAP_FIXED_CHNL_SMP_BR_EDR;
}
default: {
return os::LeConnectionType::CONNECTION_TYPE_UNSPECIFIED;
}
}
}
} // namespace metrics
......
......@@ -8,5 +8,6 @@ namespace metrics {
bool GetBootId(std::string* boot_id);
int GetArgumentTypeFromList(
std::vector<std::pair<os::ArgumentType, int>>& argument_list, os::ArgumentType argumentType);
os::LeConnectionType GetLeConnectionTypeFromCID(int fixed_cid);
} // namespace metrics
}
......@@ -35,7 +35,10 @@
#include "device/include/controller.h" // TODO Remove
#include "gd/common/init_flags.h"
#include "gd/os/system_properties.h"
#include "gd/os/metrics.h"
#include "hci/include/btsnoop.h"
#include "main/shim/shim.h"
#include "main/shim/metrics_api.h"
#include "osi/include/allocator.h"
#include "osi/include/log.h"
#include "stack/btm/btm_sec.h"
......@@ -1349,6 +1352,16 @@ bool L2CA_ConnectFixedChnl(uint16_t fixed_cid, const RawAddress& rem_bda) {
}
if (transport == BT_TRANSPORT_LE) {
auto argument_list = std::vector<std::pair<bluetooth::os::ArgumentType, int>>();
argument_list.push_back(std::make_pair(bluetooth::os::ArgumentType::L2CAP_CID, fixed_cid));
bluetooth::shim::LogMetricBluetoothLEConnectionMetricEvent(
rem_bda,
android::bluetooth::le::LeConnectionOriginType::ORIGIN_NATIVE,
android::bluetooth::le::LeConnectionType::CONNECTION_TYPE_LE_ACL,
android::bluetooth::le::LeConnectionState::STATE_LE_ACL_START,
argument_list);
bool ret = l2cu_create_conn_le(p_lcb);
if (!ret) {
LOG_WARN("Unable to create fixed channel le connection fixed_cid:0x%04x",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment