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

Commit 81f71862 authored by Jean-Michel Trivi's avatar Jean-Michel Trivi
Browse files

SpatializerHelper: fix routing check in canBeSpatialized

Fill in AudioDeviceAttributes array from ArrayList directly
when calling AudioSystem.canBeSpatialized() method.

Bug: 208931004
Test: atest SpatializerTester run on device that supports
     spatial audio, connected to audio device where
     spatialization is expected.
Change-Id: I41f9058765ee20243459af84cd40d870f26f3226
parent 990528e9
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -551,9 +551,9 @@ public class SpatializerHelper {
                logd("canBeSpatialized false due to usage:" + attributes.getUsage());
                return false;
        }
        AudioDeviceAttributes[] devices =
        AudioDeviceAttributes[] devices = new AudioDeviceAttributes[1];
        // going through adapter to take advantage of routing cache
                (AudioDeviceAttributes[]) mASA.getDevicesForAttributes(attributes).toArray();
        mASA.getDevicesForAttributes(attributes).toArray(devices);
        final boolean able = AudioSystem.canBeSpatialized(attributes, format, devices);
        logd("canBeSpatialized returning " + able);
        return able;