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

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

BluetoothMetrics: Adding a separate call for

uploading the protos for BondStateMachine which
will help us verify if there exists an ACL Connection
right before the authentication procedure
Bug: 230023840
Test: m -j $(nproc)

Change-Id: I1b6b93741a53c5e8caabc0753c9d2fd4f56f51fd
parent c293a324
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -347,9 +347,19 @@ final class BondStateMachine extends StateMachine {
            boolean result;
            // If we have some data
            if (remoteP192Data != null || remoteP256Data != null) {
                BluetoothStatsLog.write(BluetoothStatsLog.BLUETOOTH_BOND_STATE_CHANGED,
                      mAdapterService.obfuscateAddress(dev), transport, dev.getType(),
                      BluetoothDevice.BOND_BONDING,
                      BluetoothProtoEnums.BOND_SUB_STATE_LOCAL_START_PAIRING_OOB,
                      BluetoothProtoEnums.UNBOND_REASON_UNKNOWN, mAdapterService.getMetricId(dev));
                result = mAdapterService.createBondOutOfBandNative(addr, transport,
                    remoteP192Data, remoteP256Data);
            } else {
                BluetoothStatsLog.write(BluetoothStatsLog.BLUETOOTH_BOND_STATE_CHANGED,
                      mAdapterService.obfuscateAddress(dev), transport, dev.getType(),
                      BluetoothDevice.BOND_BONDING,
                      BluetoothProtoEnums.BOND_SUB_STATE_LOCAL_START_PAIRING,
                      BluetoothProtoEnums.UNBOND_REASON_UNKNOWN, mAdapterService.getMetricId(dev));
                result = mAdapterService.createBondNative(addr, transport);
            }
            BluetoothStatsLog.write(BluetoothStatsLog.BLUETOOTH_DEVICE_NAME_REPORTED,