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

Commit 7d20a2da authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Bluetooth Metric Id: Add metric id allocation to Bluetooth metric calls" am: b457f4c9

Change-Id: I621c9722b854a7aa33111b43e463c2de01c06842
parents f34bde6e b457f4c9
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -925,12 +925,13 @@ public class A2dpService extends ProfileService {
                            boolean sameAudioFeedingParameters) {
        // Log codec config and capability metrics
        BluetoothCodecConfig codecConfig = codecStatus.getCodecConfig();
        int metricId = mAdapterService.getMetricId(device);
        BluetoothStatsLog.write(BluetoothStatsLog.BLUETOOTH_A2DP_CODEC_CONFIG_CHANGED,
                mAdapterService.obfuscateAddress(device), codecConfig.getCodecType(),
                codecConfig.getCodecPriority(), codecConfig.getSampleRate(),
                codecConfig.getBitsPerSample(), codecConfig.getChannelMode(),
                codecConfig.getCodecSpecific1(), codecConfig.getCodecSpecific2(),
                codecConfig.getCodecSpecific3(), codecConfig.getCodecSpecific4());
                codecConfig.getCodecSpecific3(), codecConfig.getCodecSpecific4(), metricId);
        BluetoothCodecConfig[] codecCapabilities = codecStatus.getCodecsSelectableCapabilities();
        for (BluetoothCodecConfig codecCapability : codecCapabilities) {
            BluetoothStatsLog.write(BluetoothStatsLog.BLUETOOTH_A2DP_CODEC_CAPABILITY_CHANGED,
@@ -938,7 +939,7 @@ public class A2dpService extends ProfileService {
                    codecCapability.getCodecPriority(), codecCapability.getSampleRate(),
                    codecCapability.getBitsPerSample(), codecCapability.getChannelMode(),
                    codecConfig.getCodecSpecific1(), codecConfig.getCodecSpecific2(),
                    codecConfig.getCodecSpecific3(), codecConfig.getCodecSpecific4());
                    codecConfig.getCodecSpecific3(), codecConfig.getCodecSpecific4(), metricId);
        }

        broadcastCodecConfig(device, codecStatus);
@@ -994,7 +995,8 @@ public class A2dpService extends ProfileService {
        }

        BluetoothStatsLog.write(BluetoothStatsLog.BLUETOOTH_ACTIVE_DEVICE_CHANGED,
                BluetoothProfile.A2DP, mAdapterService.obfuscateAddress(device));
                BluetoothProfile.A2DP, mAdapterService.obfuscateAddress(device),
                mAdapterService.getMetricId(device));
        Intent intent = new Intent(BluetoothA2dp.ACTION_ACTIVE_DEVICE_CHANGED);
        intent.putExtra(BluetoothDevice.EXTRA_DEVICE, device);
        intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT
+2 −1
Original line number Diff line number Diff line
@@ -581,7 +581,8 @@ class AdapterProperties {
                "PROFILE_CONNECTION_STATE_CHANGE: profile=" + profile + ", device=" + device + ", "
                        + prevState + " -> " + state);
        BluetoothStatsLog.write(BluetoothStatsLog.BLUETOOTH_CONNECTION_STATE_CHANGED, state,
                0 /* deprecated */, profile, mService.obfuscateAddress(device));
                0 /* deprecated */, profile, mService.obfuscateAddress(device),
                mService.getMetricId(device));

        if (!isNormalStateTransition(prevState, state)) {
            Log.w(TAG,
+4 −2
Original line number Diff line number Diff line
@@ -388,11 +388,13 @@ final class BondStateMachine extends StateMachine {
        }
        BluetoothStatsLog.write(BluetoothStatsLog.BLUETOOTH_BOND_STATE_CHANGED,
                mAdapterService.obfuscateAddress(device), 0, device.getType(),
                newState, BluetoothProtoEnums.BOND_SUB_STATE_UNKNOWN, reason);
                newState, BluetoothProtoEnums.BOND_SUB_STATE_UNKNOWN, reason,
                mAdapterService.getMetricId(device));
        BluetoothClass deviceClass = device.getBluetoothClass();
        int classOfDevice = deviceClass == null ? 0 : deviceClass.getClassOfDevice();
        BluetoothStatsLog.write(BluetoothStatsLog.BLUETOOTH_CLASS_OF_DEVICE_REPORTED,
                mAdapterService.obfuscateAddress(device), classOfDevice);
                mAdapterService.obfuscateAddress(device), classOfDevice,
                mAdapterService.getMetricId(device));
        mAdapterProperties.onBondStateChanged(device, newState);

        if (devProp != null && ((devProp.getDeviceType() == BluetoothDevice.DEVICE_TYPE_CLASSIC
+3 −2
Original line number Diff line number Diff line
@@ -652,12 +652,13 @@ final class RemoteDevices {

        int connectionState = newState == AbstractionLayer.BT_ACL_STATE_CONNECTED
                ? BluetoothAdapter.STATE_CONNECTED : BluetoothAdapter.STATE_DISCONNECTED;
        int metricId = sAdapterService.getMetricId(device);
        BluetoothStatsLog.write(BluetoothStatsLog.BLUETOOTH_ACL_CONNECTION_STATE_CHANGED,
                sAdapterService.obfuscateAddress(device), connectionState);
                sAdapterService.obfuscateAddress(device), connectionState, metricId);
        BluetoothClass deviceClass = device.getBluetoothClass();
        int classOfDevice = deviceClass == null ? 0 : deviceClass.getClassOfDevice();
        BluetoothStatsLog.write(BluetoothStatsLog.BLUETOOTH_CLASS_OF_DEVICE_REPORTED,
                sAdapterService.obfuscateAddress(device), classOfDevice);
                sAdapterService.obfuscateAddress(device), classOfDevice, metricId);

        if (intent != null) {
            intent.putExtra(BluetoothDevice.EXTRA_DEVICE, device);
+1 −1
Original line number Diff line number Diff line
@@ -1057,7 +1057,7 @@ public class DatabaseManager {
        BluetoothStatsLog.write(BluetoothStatsLog.BLUETOOTH_DEVICE_INFO_REPORTED,
                mAdapterService.obfuscateAddress(device),
                BluetoothProtoEnums.DEVICE_INFO_EXTERNAL, callingApp, manufacturerName, modelName,
                hardwareVersion, softwareVersion);
                hardwareVersion, softwareVersion, mAdapterService.getMetricId(device));
    }

    private void logMetadataChange(String address, String log) {
Loading