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

Commit f70e8421 authored by Josh Wu's avatar Josh Wu
Browse files

LEA: Report device model

Bug: 268298882
Test: atest BluetoothInstrumentationTests
Test: statsd_testdrive 162
Change-Id: Ib3686a2d6ca5b0e152401ca03c302f4cdd25a4c9
parent 78fcd2e0
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ import android.bluetooth.BluetoothHeadset;
import android.bluetooth.BluetoothHeadsetClient;
import android.bluetooth.BluetoothManager;
import android.bluetooth.BluetoothProfile;
import android.bluetooth.BluetoothProtoEnums;
import android.bluetooth.BluetoothSinkAudioPolicy;
import android.bluetooth.IBluetoothConnectionCallback;
import android.content.BroadcastReceiver;
@@ -73,6 +74,7 @@ final class RemoteDevices {

    private static final int UUID_INTENT_DELAY = 6000;
    private static final int MESSAGE_UUID_INTENT = 1;
    private static final String LOG_SOURCE_DIS = "DIS";

    private final HashMap<String, DeviceProperties> mDevices;
    private final HashMap<String, String> mDualDevicesMap;
@@ -935,6 +937,12 @@ final class RemoteDevices {
                            final String modelName = new String(val);
                            debugLog("Remote device model name: " + modelName);
                            deviceProperties.setModelName(modelName);
                            BluetoothStatsLog.write(
                                    BluetoothStatsLog.BLUETOOTH_DEVICE_INFO_REPORTED,
                                    mAdapterService.obfuscateAddress(bdDevice),
                                    BluetoothProtoEnums.DEVICE_INFO_INTERNAL, LOG_SOURCE_DIS, null,
                                    modelName, null, null, mAdapterService.getMetricId(bdDevice),
                                    bdDevice.getAddressType(), 0, 0, 0);
                            break;
                    }
                }