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

Commit 55f76e39 authored by Pavlin Radoslavov's avatar Pavlin Radoslavov
Browse files

Add a missing null pointer check in the codec config comparison logic

Also, rearange the "if" logic into "else if" so it is more natural.

Bug: 74622467
Test: Manual with A2DP Offload enabled and LDAC Headset
Change-Id: I363c7b1aedf5c33f5cdeb56862385969ea8bde1c
(cherry picked from commit d4a798f85529dfe21b7500a4e67e46c633719c0c)
parent 07f08827
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -631,12 +631,13 @@ final class A2dpStateMachine extends StateMachine {
            if ((prevCodecConfig != null)
                    && (prevCodecConfig.getCodecType() != newCodecConfig.getCodecType())) {
                update = true;
            }
            if (!newCodecConfig.sameAudioFeedingParameters(prevCodecConfig)) {
            } else if (!newCodecConfig.sameAudioFeedingParameters(prevCodecConfig)) {
                update = true;
            }
            if ((newCodecConfig.getCodecType() == BluetoothCodecConfig.SOURCE_CODEC_TYPE_LDAC)
                    && prevCodecConfig.getCodecSpecific1() != newCodecConfig.getCodecSpecific1()) {
            } else if ((newCodecConfig.getCodecType()
                        == BluetoothCodecConfig.SOURCE_CODEC_TYPE_LDAC)
                    && (prevCodecConfig != null)
                    && (prevCodecConfig.getCodecSpecific1()
                        != newCodecConfig.getCodecSpecific1())) {
                update = true;
            }
            if (update) {