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

Commit 7de61c7a authored by Jakub Tyszkowski's avatar Jakub Tyszkowski
Browse files

Bass: Fix BIS sync state channel map

There are 31 bits available in the channel map due
to 0xFFFFFFFF being a special value. This allows for
31 channels indexed from 1 to 31.

That means bit 0 is for channel 1 and so forth.

Bug: 240885642
Test: manual - logs verification
Tag: #feature
Change-Id: Ib48812123d29ee4500261b46d1987d6e9469c632
parent c0a22930
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -1225,7 +1225,11 @@ public class BassClientStateMachine extends StateMachine {
        int bisSync = 0;
        for (BluetoothLeBroadcastChannel channel : channels) {
            if (channel.isSelected()) {
                bisSync |= 1 << channel.getChannelIndex();
                if (channel.getChannelIndex() == 0) {
                    Log.e(TAG, "getBisSyncFromChannelPreference: invalid channel index=0");
                    continue;
                }
                bisSync |= 1 << (channel.getChannelIndex() - 1);
            }
        }