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

Commit 827637b3 authored by Alice Kuo's avatar Alice Kuo
Browse files

Use feature flag to guard Broadcast and Bass client enablement

Use leaudio_brodacast_feature_support to guard Broadcast and BASS
enablement.

Bug: 309382793
Bug: 316005152
Test: m com.android.btservices
Change-Id: I0af4f70b9e84c9aabc5122f70638cdec43ce1ce3
parent 9759a649
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package com.android.bluetooth.bass_client;

import static android.Manifest.permission.BLUETOOTH_CONNECT;

import static com.android.bluetooth.flags.Flags.leaudioBroadcastFeatureSupport;
import static com.android.bluetooth.Utils.enforceBluetoothPrivilegedPermission;

import android.bluetooth.BluetoothAdapter;
@@ -137,7 +138,8 @@ public class BassClientService extends ProfileService {
    }

    public static boolean isEnabled() {
        return BluetoothProperties.isProfileBapBroadcastAssistEnabled().orElse(false);
        return leaudioBroadcastFeatureSupport()
                && BluetoothProperties.isProfileBapBroadcastAssistEnabled().orElse(false);
    }

    void updatePeriodicAdvertisementResultMap(
+3 −1
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ package com.android.bluetooth.le_audio;
import static android.Manifest.permission.BLUETOOTH_CONNECT;
import static android.bluetooth.IBluetoothLeAudio.LE_AUDIO_GROUP_ID_INVALID;

import static com.android.bluetooth.flags.Flags.leaudioBroadcastFeatureSupport;
import static com.android.bluetooth.Utils.enforceBluetoothPrivilegedPermission;
import static com.android.modules.utils.build.SdkLevel.isAtLeastU;

@@ -279,7 +280,8 @@ public class LeAudioService extends ProfileService {
    }

    public static boolean isBroadcastEnabled() {
        return BluetoothProperties.isProfileBapBroadcastSourceEnabled().orElse(false);
        return leaudioBroadcastFeatureSupport()
                && BluetoothProperties.isProfileBapBroadcastSourceEnabled().orElse(false);
    }

    private boolean registerTmap() {