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

Commit 08b8e5ec authored by Aritra Sen's avatar Aritra Sen Committed by Automerger Merge Worker
Browse files

Merge "Add metric to measure connection change latency metric observed for the...

Merge "Add metric to measure connection change latency metric observed for the system." into main am: 5c61919b

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/2748803



Change-Id: If979537e33367e944b7479d39b94bd1a397346c7
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 36e785f8 5c61919b
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -90,6 +90,7 @@ class AdapterProperties {
    private static final long DEFAULT_DISCOVERY_TIMEOUT_MS = 12800;
    @VisibleForTesting static final int BLUETOOTH_NAME_MAX_LENGTH_BYTES = 248;
    private static final int BD_ADDR_LEN = 6; // in bytes
    private static final int SYSTEM_CONNECTION_LATENCY_METRIC = 65536;

    private volatile String mName;
    private volatile byte[] mAddress;
@@ -779,6 +780,15 @@ class AdapterProperties {
                    + BluetoothProfile.getProfileName(profile)
                    + ", device=" + device + ", " + prevState + " -> " + state);
        }
        BluetoothStatsLog.write(
                BluetoothStatsLog.BLUETOOTH_CONNECTION_STATE_CHANGED,
                state,
                0 /* deprecated */,
                profile,
                mService.obfuscateAddress(device),
                mService.getMetricId(device),
                0,
                SYSTEM_CONNECTION_LATENCY_METRIC);
        if (!validateProfileConnectionState(state) || !validateProfileConnectionState(prevState)) {
            // Previously, an invalid state was broadcast anyway,
            // with the invalid state converted to -1 in the intent.