Merge "SpatializerHelper: Fix device compatibility with spatial audio" am: fe4b37a3ac am: 7d35eaf6d7 am: ef3ecceecd

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

Change-Id: Ia88959055ee9a35b95e7635d0a63bb934a8942b2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Andy Hung
2022-09-08 19:07:11 +00:00
committed by Automerger Merge Worker

View File

@@ -713,8 +713,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)) {