Bluetooth Codec Settings: Assure flag enabled

Assure flag a2dpOffloadCodecExtensibilitySettings is enabled before
calling BluetoothA2dp API.

Bug: 331612641
Tag: #feature
Test: atest SettingsRoboTests:com.android.settings.development.bluetooth.AbstractBluetoothListPreferenceController
Test: atest SettingsRoboTests:com.android.settings.development.bluetooth.BluetoothCodecListPreferenceControllerTest
Merged-In: Iac33a6c95a544230e034807b320c80a727ade307
Change-Id: I2b0ed6c7ac91401b958b206817aca55e0aa47170
This commit is contained in:
Jakub Rotkiewicz
2024-04-02 09:08:32 +00:00
parent b5d874d9eb
commit c923103142
2 changed files with 11 additions and 1 deletions

View File

@@ -35,12 +35,14 @@ import android.bluetooth.BluetoothCodecType;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothProfile;
import android.content.Context;
import android.platform.test.annotations.RequiresFlagsEnabled;
import androidx.lifecycle.LifecycleOwner;
import androidx.preference.ListPreference;
import androidx.preference.PreferenceScreen;
import com.android.settings.development.BluetoothA2dpConfigStore;
import com.android.settings.development.Flags;
import com.android.settingslib.core.lifecycle.Lifecycle;
import org.junit.Before;
@@ -57,7 +59,6 @@ import java.util.List;
@RunWith(RobolectricTestRunner.class)
public class BluetoothCodecListPreferenceControllerTest {
private static final String DEVICE_ADDRESS = "00:11:22:33:44:55";
@Mock private BluetoothA2dp mBluetoothA2dp;
@@ -245,6 +246,7 @@ public class BluetoothCodecListPreferenceControllerTest {
}
@Test
@RequiresFlagsEnabled(Flags.FLAG_A2DP_OFFLOAD_CODEC_EXTENSIBILITY_SETTINGS)
public void onPreferenceChange_notifyPreference() {
assertFalse(
mController.onPreferenceChange(