Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f8fdb785 authored by Rishab's avatar Rishab
Browse files

Log RDI with metric ID during connection

Bug: 333598774
Test: m com.android.btservices and ran statsd_testdrive to verify atom
was logged
Flag: EXEMPT, Metrics Logging
Change-Id: I4291af353d36d2eb49340a98ebf3c275091696dd

Change-Id: I09b4f0180e6e2ce2e40c7bc3ed1461b84753ef60
parent 40d4610e
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -758,9 +758,14 @@ class AdapterProperties {
        BluetoothDevice device = connIntent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
        int state = connIntent.getIntExtra(BluetoothProfile.EXTRA_STATE, -1);
        int metricId = mService.getMetricId(device);
        byte[] remoteDeviceInfoBytes = MetricsLogger.getInstance().getRemoteDeviceInfoProto(device);
        if (state == BluetoothProfile.STATE_CONNECTING) {
            BluetoothStatsLog.write(BluetoothStatsLog.BLUETOOTH_DEVICE_NAME_REPORTED,
                    metricId, device.getName());
            BluetoothStatsLog.write(
                    BluetoothStatsLog.REMOTE_DEVICE_INFORMATION_WITH_METRIC_ID,
                    metricId,
                    remoteDeviceInfoBytes);
            MetricsLogger.getInstance()
                    .logAllowlistedDeviceNameHash(metricId, device.getName(), true);
        }