Loading android/app/src/com/android/bluetooth/btservice/BondStateMachine.java +1 −0 Original line number Diff line number Diff line Loading @@ -545,6 +545,7 @@ final class BondStateMachine extends StateMachine { if (oldState == newState) { return; } MetricsLogger.getInstance().logBondStateMachineEvent(device, newState); BluetoothStatsLog.write( BluetoothStatsLog.BLUETOOTH_BOND_STATE_CHANGED, mAdapterService.obfuscateAddress(device), Loading android/app/src/com/android/bluetooth/btservice/MetricsLogger.java +25 −1 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ */ package com.android.bluetooth.btservice; import static com.android.bluetooth.BluetoothStatsLog.BLUETOOTH_CROSS_LAYER_EVENT_REPORTED__EVENT_TYPE__BOND; import static com.android.bluetooth.BluetoothStatsLog.BLUETOOTH_CROSS_LAYER_EVENT_REPORTED__EVENT_TYPE__PROFILE_CONNECTION; import static com.android.bluetooth.BluetoothStatsLog.BLUETOOTH_CROSS_LAYER_EVENT_REPORTED__EVENT_TYPE__PROFILE_CONNECTION_A2DP; import static com.android.bluetooth.BluetoothStatsLog.BLUETOOTH_CROSS_LAYER_EVENT_REPORTED__EVENT_TYPE__PROFILE_CONNECTION_A2DP_SINK; Loading @@ -31,6 +32,8 @@ import static com.android.bluetooth.BluetoothStatsLog.BLUETOOTH_CROSS_LAYER_EVEN import static com.android.bluetooth.BluetoothStatsLog.BLUETOOTH_CROSS_LAYER_EVENT_REPORTED__EVENT_TYPE__PROFILE_CONNECTION_PAN; import static com.android.bluetooth.BluetoothStatsLog.BLUETOOTH_CROSS_LAYER_EVENT_REPORTED__EVENT_TYPE__PROFILE_CONNECTION_PBAP_CLIENT; import static com.android.bluetooth.BluetoothStatsLog.BLUETOOTH_CROSS_LAYER_EVENT_REPORTED__EVENT_TYPE__PROFILE_CONNECTION_VOLUME_CONTROL; import static com.android.bluetooth.BluetoothStatsLog.BLUETOOTH_CROSS_LAYER_EVENT_REPORTED__STATE__STATE_BONDED; import static com.android.bluetooth.BluetoothStatsLog.BLUETOOTH_CROSS_LAYER_EVENT_REPORTED__STATE__STATE_NONE; import static com.android.bluetooth.BtRestrictedStatsLog.RESTRICTED_BLUETOOTH_DEVICE_NAME_REPORTED; import android.app.AlarmManager; Loading Loading @@ -782,7 +785,7 @@ public class MetricsLogger { public void logBluetoothEvent(BluetoothDevice device, int eventType, int state, int uid) { if (mAdapterService.getMetricId(device) == 0 || !mInitialized) { if (!mInitialized || mAdapterService.getMetricId(device) == 0) { return; } Loading Loading @@ -902,6 +905,27 @@ public class MetricsLogger { sessionStatus); } /** Logs Bond State Machine event */ public void logBondStateMachineEvent(BluetoothDevice device, int bondState) { switch (bondState) { case BluetoothDevice.BOND_NONE: logBluetoothEvent( device, BLUETOOTH_CROSS_LAYER_EVENT_REPORTED__EVENT_TYPE__BOND, BLUETOOTH_CROSS_LAYER_EVENT_REPORTED__STATE__STATE_NONE, 0); break; case BluetoothDevice.BOND_BONDED: logBluetoothEvent( device, BLUETOOTH_CROSS_LAYER_EVENT_REPORTED__EVENT_TYPE__BOND, BLUETOOTH_CROSS_LAYER_EVENT_REPORTED__STATE__STATE_BONDED, 0); break; default: } } /** Logs LE Audio Broadcast audio sync. */ public void logLeAudioBroadcastAudioSync( BluetoothDevice device, Loading system/btif/src/btif_dm.cc +0 −11 Original line number Diff line number Diff line Loading @@ -563,18 +563,7 @@ static void bond_state_changed(bt_status_t status, const RawAddress& bd_addr, if (pairing_cb.bond_type == BOND_TYPE_TEMPORARY) { state = BT_BOND_STATE_NONE; } else { if (state == BT_BOND_STATE_NONE) { bluetooth::os::LogMetricBluetoothEvent(ToGdAddress(bd_addr), android::bluetooth::EventType::BOND, android::bluetooth::State::STATE_NONE); } else if (state == BT_BOND_STATE_BONDED) { bluetooth::os::LogMetricBluetoothEvent(ToGdAddress(bd_addr), android::bluetooth::EventType::BOND, android::bluetooth::State::STATE_BONDED); } } log::info( "Bond state changed to state={}[0:none, 1:bonding, " "2:bonded],prev_state={}, sdp_attempts={}", Loading Loading
android/app/src/com/android/bluetooth/btservice/BondStateMachine.java +1 −0 Original line number Diff line number Diff line Loading @@ -545,6 +545,7 @@ final class BondStateMachine extends StateMachine { if (oldState == newState) { return; } MetricsLogger.getInstance().logBondStateMachineEvent(device, newState); BluetoothStatsLog.write( BluetoothStatsLog.BLUETOOTH_BOND_STATE_CHANGED, mAdapterService.obfuscateAddress(device), Loading
android/app/src/com/android/bluetooth/btservice/MetricsLogger.java +25 −1 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ */ package com.android.bluetooth.btservice; import static com.android.bluetooth.BluetoothStatsLog.BLUETOOTH_CROSS_LAYER_EVENT_REPORTED__EVENT_TYPE__BOND; import static com.android.bluetooth.BluetoothStatsLog.BLUETOOTH_CROSS_LAYER_EVENT_REPORTED__EVENT_TYPE__PROFILE_CONNECTION; import static com.android.bluetooth.BluetoothStatsLog.BLUETOOTH_CROSS_LAYER_EVENT_REPORTED__EVENT_TYPE__PROFILE_CONNECTION_A2DP; import static com.android.bluetooth.BluetoothStatsLog.BLUETOOTH_CROSS_LAYER_EVENT_REPORTED__EVENT_TYPE__PROFILE_CONNECTION_A2DP_SINK; Loading @@ -31,6 +32,8 @@ import static com.android.bluetooth.BluetoothStatsLog.BLUETOOTH_CROSS_LAYER_EVEN import static com.android.bluetooth.BluetoothStatsLog.BLUETOOTH_CROSS_LAYER_EVENT_REPORTED__EVENT_TYPE__PROFILE_CONNECTION_PAN; import static com.android.bluetooth.BluetoothStatsLog.BLUETOOTH_CROSS_LAYER_EVENT_REPORTED__EVENT_TYPE__PROFILE_CONNECTION_PBAP_CLIENT; import static com.android.bluetooth.BluetoothStatsLog.BLUETOOTH_CROSS_LAYER_EVENT_REPORTED__EVENT_TYPE__PROFILE_CONNECTION_VOLUME_CONTROL; import static com.android.bluetooth.BluetoothStatsLog.BLUETOOTH_CROSS_LAYER_EVENT_REPORTED__STATE__STATE_BONDED; import static com.android.bluetooth.BluetoothStatsLog.BLUETOOTH_CROSS_LAYER_EVENT_REPORTED__STATE__STATE_NONE; import static com.android.bluetooth.BtRestrictedStatsLog.RESTRICTED_BLUETOOTH_DEVICE_NAME_REPORTED; import android.app.AlarmManager; Loading Loading @@ -782,7 +785,7 @@ public class MetricsLogger { public void logBluetoothEvent(BluetoothDevice device, int eventType, int state, int uid) { if (mAdapterService.getMetricId(device) == 0 || !mInitialized) { if (!mInitialized || mAdapterService.getMetricId(device) == 0) { return; } Loading Loading @@ -902,6 +905,27 @@ public class MetricsLogger { sessionStatus); } /** Logs Bond State Machine event */ public void logBondStateMachineEvent(BluetoothDevice device, int bondState) { switch (bondState) { case BluetoothDevice.BOND_NONE: logBluetoothEvent( device, BLUETOOTH_CROSS_LAYER_EVENT_REPORTED__EVENT_TYPE__BOND, BLUETOOTH_CROSS_LAYER_EVENT_REPORTED__STATE__STATE_NONE, 0); break; case BluetoothDevice.BOND_BONDED: logBluetoothEvent( device, BLUETOOTH_CROSS_LAYER_EVENT_REPORTED__EVENT_TYPE__BOND, BLUETOOTH_CROSS_LAYER_EVENT_REPORTED__STATE__STATE_BONDED, 0); break; default: } } /** Logs LE Audio Broadcast audio sync. */ public void logLeAudioBroadcastAudioSync( BluetoothDevice device, Loading
system/btif/src/btif_dm.cc +0 −11 Original line number Diff line number Diff line Loading @@ -563,18 +563,7 @@ static void bond_state_changed(bt_status_t status, const RawAddress& bd_addr, if (pairing_cb.bond_type == BOND_TYPE_TEMPORARY) { state = BT_BOND_STATE_NONE; } else { if (state == BT_BOND_STATE_NONE) { bluetooth::os::LogMetricBluetoothEvent(ToGdAddress(bd_addr), android::bluetooth::EventType::BOND, android::bluetooth::State::STATE_NONE); } else if (state == BT_BOND_STATE_BONDED) { bluetooth::os::LogMetricBluetoothEvent(ToGdAddress(bd_addr), android::bluetooth::EventType::BOND, android::bluetooth::State::STATE_BONDED); } } log::info( "Bond state changed to state={}[0:none, 1:bonding, " "2:bonded],prev_state={}, sdp_attempts={}", Loading