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

Commit 5cd53ead authored by Palash Ahuja's avatar Palash Ahuja Committed by Gerrit Code Review
Browse files

Merge "BluetoothMetrics: Method to log bluetooth event" into main

parents cd477cc1 bbcb319e
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 "";