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

Commit 8d6ec5ff 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 am: 08b8e5ec

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



Change-Id: I650d91e97a3f0bc03993860c3ea7ae88f4b02c03
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 356c1df1 08b8e5ec
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.