summaryrefslogtreecommitdiff
path: root/cras/src/server/cras_server_metrics.c
diff options
context:
space:
mode:
authorHsin-Yu Chao <hychao@google.com>2019-10-30 15:47:47 +0800
committerCommit Bot <commit-bot@chromium.org>2019-11-04 06:00:23 +0000
commit099950d7bba47f90c872552870609a455e2c626a (patch)
tree4d31501dbfc37c3341ef668a842906e18404da96 /cras/src/server/cras_server_metrics.c
parent93e4d3212d9e8372226afcaeae82cd9f755f8776 (diff)
downloadadhd-099950d7bba47f90c872552870609a455e2c626a.tar.gz
CRAS: server_metrics - Add bluetooth wide-band mic type
The HFP wideband is now tracked under the general HFP device metrics type, so it's impossible for us to inspect the ratio of HFP wideband v.s legacy narrow band. This change adds a new device type for HFP wideband mic so we can get detailed breakdown of HFP device use cases. To summarize all these enums related to BT: For node type, we have: BLUETOOTH, BLUETOOTH_NB_MIC. This info is read by UI to assign different auto-select priority. Two node types are sufficient for Chrome UI use case. For metrics type, we want to track the usage per BT profile: A2DP, HFP, HSP and even down to WB or NB in HFP input. BUG=chromium:971568 TEST=bus-send --system --type=method_call --print-reply \ --dest=org.chromium.cras /org/chromium/cras \ org.chromium.cras.Control.GetNodes | grep -C 10 BLUETOOTH Change-Id: Id45f66703f5ba66540bfad14bfcb0bc089d07ed7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/adhd/+/1890111 Tested-by: Hsinyu Chao <hychao@chromium.org> Commit-Queue: Hsinyu Chao <hychao@chromium.org> Reviewed-by: Cheng-Yi Chiang <cychiang@chromium.org>
Diffstat (limited to 'cras/src/server/cras_server_metrics.c')
-rw-r--r--cras/src/server/cras_server_metrics.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/cras/src/server/cras_server_metrics.c b/cras/src/server/cras_server_metrics.c
index 034b892e..c47ea626 100644
--- a/cras/src/server/cras_server_metrics.c
+++ b/cras/src/server/cras_server_metrics.c
@@ -127,6 +127,7 @@ enum CRAS_METRICS_DEVICE_TYPE {
CRAS_METRICS_DEVICE_ABNORMAL_FALLBACK,
CRAS_METRICS_DEVICE_SILENT_HOTWORD,
CRAS_METRICS_DEVICE_UNKNOWN,
+ CRAS_METRICS_DEVICE_BLUETOOTH_WB_MIC,
};
struct cras_server_metrics_stream_config {
@@ -237,6 +238,8 @@ metrics_device_type_str(enum CRAS_METRICS_DEVICE_TYPE device_type)
return "Bluetooth";
case CRAS_METRICS_DEVICE_BLUETOOTH_NB_MIC:
return "BluetoothNarrowBandMic";
+ case CRAS_METRICS_DEVICE_BLUETOOTH_WB_MIC:
+ return "BluetoothWideBandMic";
case CRAS_METRICS_DEVICE_NO_DEVICE:
return "NoDevice";
/* Other dummy devices. */
@@ -315,7 +318,11 @@ get_metrics_device_type(struct cras_iodev *iodev)
case CRAS_BT_DEVICE_PROFILE_A2DP_SOURCE:
return CRAS_METRICS_DEVICE_A2DP;
case CRAS_BT_DEVICE_PROFILE_HFP_AUDIOGATEWAY:
- return CRAS_METRICS_DEVICE_HFP;
+ /* HFP narrow band has its own node type so we know
+ * this is wideband mic for sure. */
+ return (iodev->direction == CRAS_STREAM_INPUT) ?
+ CRAS_METRICS_DEVICE_BLUETOOTH_WB_MIC :
+ CRAS_METRICS_DEVICE_HFP;
case CRAS_BT_DEVICE_PROFILE_HSP_AUDIOGATEWAY:
return CRAS_METRICS_DEVICE_HSP;
default: