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

Commit 11a3798e authored by Patty's avatar Patty
Browse files

Add Broadcast Profile bitmask to the supported mask if supported

Bug: 229197555
Tag: #feature
Test: atest BluetoothInstrumentationTests
Change-Id: I66290b4c8c9d949f024c5f0f9ed9e86f84303554
parent 788208c1
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -754,6 +754,10 @@ public class AdapterService extends Service {
            nonSupportedProfiles.add(BassClientService.class);
        }

        if (isLeAudioBroadcastSourceSupported()) {
            Config.addSupportedProfile(BluetoothProfile.LE_AUDIO_BROADCAST);
        }

        if (!nonSupportedProfiles.isEmpty()) {
            // Remove non-supported profiles from the supported list
            // since the controller doesn't support
+6 −1
Original line number Diff line number Diff line
@@ -66,6 +66,7 @@ public class Config {

    private static final String FEATURE_HEARING_AID = "settings_bluetooth_hearing_aid";
    private static final String FEATURE_BATTERY = "settings_bluetooth_battery";
    private static long sSupportedMask = 0;

    private static class ProfileConfig {
        Class mClass;
@@ -217,6 +218,10 @@ public class Config {
        sSupportedProfiles = profilesList.toArray(new Class[profilesList.size()]);
    }

    static void addSupportedProfile(int supportedProfile) {
        sSupportedMask |= (1 << supportedProfile);
    }

    static HashSet<Class> geLeAudioUnicastProfiles() {
        return mLeAudioUnicastProfiles;
    }
@@ -240,7 +245,7 @@ public class Config {
    }

    static long getSupportedProfilesBitMask() {
        long mask = 0;
        long mask = sSupportedMask;
        for (final Class profileClass : getSupportedProfiles()) {
            mask |= getProfileMask(profileClass);
        }