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

Commit 3270184c authored by Eric Laurent's avatar Eric Laurent
Browse files

AudioDeviceInventory: fix sensor UUUID initialization for LE Audio

Update UuidUtils.uuidFromAudioDeviceAttributes() to handle LE Audio
devices.

Bug: 294278453
Test: connect LE Audio headset and verify UUID in audio dumpsys
Change-Id: I77016df212ceac73fd3b6d1ccb3d7ed4dac9d7b9
parent b712a758
Loading
Loading
Loading
Loading
+18 −20
Original line number Diff line number Diff line
@@ -45,8 +45,10 @@ class UuidUtils {
     *  Generate a headtracking UUID from AudioDeviceAttributes
     */
    public static UUID uuidFromAudioDeviceAttributes(AudioDeviceAttributes device) {
        switch (device.getInternalType()) {
            case AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP:
        if (!AudioSystem.isBluetoothA2dpOutDevice(device.getInternalType())
                && !AudioSystem.isBluetoothLeOutDevice(device.getInternalType())) {
            return null;
        }
        String address = device.getAddress().replace(":", "");
        if (address.length() != 12) {
            return null;
@@ -62,9 +64,5 @@ class UuidUtils {
            Slog.i(TAG, "uuidFromAudioDeviceAttributes lsb: " + Long.toHexString(lsb));
        }
        return new UUID(0, lsb);
            default:
                // Handle other device types here
                return null;
        }
    }
}