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

Commit ef3eccee authored by Andy Hung's avatar Andy Hung Committed by Automerger Merge Worker
Browse files

Merge "SpatializerHelper: Fix device compatibility with spatial audio" am:...

Merge "SpatializerHelper: Fix device compatibility with spatial audio" am: fe4b37a3 am: 7d35eaf6

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2209998



Change-Id: I9980559698ffc3496dbce5a78a6300cc12eac763
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents cf4f22e8 7d35eaf6
Loading
Loading
Loading
Loading
+6 −3
Original line number Original line Diff line number Diff line
@@ -709,8 +709,11 @@ public class SpatializerHelper {
    }
    }


    private boolean isDeviceCompatibleWithSpatializationModes(@NonNull AudioDeviceAttributes ada) {
    private boolean isDeviceCompatibleWithSpatializationModes(@NonNull AudioDeviceAttributes ada) {
        // modeForDevice will be neither transaural or binaural for devices that do not support
        // spatial audio. For instance mono devices like earpiece, speaker safe or sco must
        // not be included.
        final byte modeForDevice = (byte) SPAT_MODE_FOR_DEVICE_TYPE.get(ada.getType(),
        final byte modeForDevice = (byte) SPAT_MODE_FOR_DEVICE_TYPE.get(ada.getType(),
                /*default when type not found*/ SpatializationMode.SPATIALIZER_BINAURAL);
                /*default when type not found*/ -1);
        if ((modeForDevice == SpatializationMode.SPATIALIZER_BINAURAL && mBinauralSupported)
        if ((modeForDevice == SpatializationMode.SPATIALIZER_BINAURAL && mBinauralSupported)
                || (modeForDevice == SpatializationMode.SPATIALIZER_TRANSAURAL
                || (modeForDevice == SpatializationMode.SPATIALIZER_TRANSAURAL
                        && mTransauralSupported)) {
                        && mTransauralSupported)) {