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

Commit c3f28877 authored by Andy Hung's avatar Andy Hung
Browse files

SpatializerHelper: Fix addCompatibleAudioDevice, removeCompatibleAudioDevice

Erroneous if check caused false device matches.

Test: enable/disable spatial audio wired headset in the settings
Bug: 231499448
Bug: 231658188
Change-Id: I0af5db0df72c3ea964e5e6b7fe85b3a7fc9f0959
parent 5e35dcd3
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -486,8 +486,7 @@ public class SpatializerHelper {

        for (SADeviceState deviceState : mSADevices) {
            if (deviceType == deviceState.mDeviceType
                    && (wireless && ada.getAddress().equals(deviceState.mDeviceAddress))
                    || !wireless) {
                    && (!wireless || ada.getAddress().equals(deviceState.mDeviceAddress))) {
                isInList = true;
                if (forceEnable) {
                    deviceState.mEnabled = true;
@@ -511,8 +510,7 @@ public class SpatializerHelper {

        for (SADeviceState deviceState : mSADevices) {
            if (deviceType == deviceState.mDeviceType
                    && (wireless && ada.getAddress().equals(deviceState.mDeviceAddress))
                    || !wireless) {
                    && (!wireless || ada.getAddress().equals(deviceState.mDeviceAddress))) {
                deviceState.mEnabled = false;
                break;
            }