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

Commit bbcb319e authored by Palash Ahuja's avatar Palash Ahuja
Browse files

BluetoothMetrics: Method to log bluetooth event

Test: m com.android.btservices and statsd_testdrive
Bug: 345564021
Flag: EXEMPT, metrics related changes
Change-Id: Ic92285e173f7d567bbedaeb70faab932e762493d
parent 27c68aa4
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -546,6 +546,21 @@ public class MetricsLogger {
                BluetoothStatsLog.BLUETOOTH_HASHED_DEVICE_NAME_REPORTED, metricId, sha256);
    }

    public void logBluetoothEvent(BluetoothDevice device, int eventType, int state, int uid) {

        if (mAdapterService.getMetricId(device) == 0 || !mInitialized) {
            return;
        }

        BluetoothStatsLog.write(
                BluetoothStatsLog.BLUETOOTH_CROSS_LAYER_EVENT_REPORTED,
                eventType,
                state,
                uid,
                mAdapterService.getMetricId(device),
                getRemoteDeviceInfoProto(device));
    }

    protected static String getSha256String(String name) {
        if (name.isEmpty()) {
            return "";