Loading src/com/android/settings/development/bluetooth/AbstractBluetoothDialogPreferenceController.java +2 −3 Original line number Diff line number Diff line Loading @@ -40,9 +40,8 @@ public abstract class AbstractBluetoothDialogPreferenceController extends private static final String TAG = "AbstractBtDlgCtr"; private static final int SOURCE_CODEC_TYPE_OPUS = 6; // TODO(b/240635097): remove in U protected static final int[] CODEC_TYPES = {SOURCE_CODEC_TYPE_OPUS, protected static final int[] CODEC_TYPES = { BluetoothCodecConfig.SOURCE_CODEC_TYPE_OPUS, BluetoothCodecConfig.SOURCE_CODEC_TYPE_LC3, BluetoothCodecConfig.SOURCE_CODEC_TYPE_LDAC, BluetoothCodecConfig.SOURCE_CODEC_TYPE_APTX_HD, Loading src/com/android/settings/development/bluetooth/BluetoothCodecDialogPreferenceController.java +2 −4 Original line number Diff line number Diff line Loading @@ -40,8 +40,6 @@ public class BluetoothCodecDialogPreferenceController extends private static final String KEY = "bluetooth_audio_codec_settings"; private static final String TAG = "BtCodecCtr"; private static final int SOURCE_CODEC_TYPE_OPUS = 6; // TODO remove in U private final Callback mCallback; public BluetoothCodecDialogPreferenceController(Context context, Lifecycle lifecycle, Loading Loading @@ -125,7 +123,7 @@ public class BluetoothCodecDialogPreferenceController extends codecPriorityValue = BluetoothCodecConfig.CODEC_PRIORITY_HIGHEST; break; case 7: codecTypeValue = SOURCE_CODEC_TYPE_OPUS; // TODO update in U codecTypeValue = BluetoothCodecConfig.SOURCE_CODEC_TYPE_OPUS; codecPriorityValue = BluetoothCodecConfig.CODEC_PRIORITY_HIGHEST; break; default: Loading Loading @@ -190,7 +188,7 @@ public class BluetoothCodecDialogPreferenceController extends case BluetoothCodecConfig.SOURCE_CODEC_TYPE_LDAC: index = 5; break; case SOURCE_CODEC_TYPE_OPUS: // TODO update in U case BluetoothCodecConfig.SOURCE_CODEC_TYPE_OPUS: index = 7; break; default: Loading tests/robotests/src/com/android/settings/development/bluetooth/BluetoothCodecDialogPreferenceControllerTest.java +8 −10 Original line number Diff line number Diff line Loading @@ -52,8 +52,6 @@ import java.util.List; @RunWith(RobolectricTestRunner.class) public class BluetoothCodecDialogPreferenceControllerTest { private static final int SOURCE_CODEC_TYPE_OPUS = 6; // TODO(b/240635097): remove in U private static final String DEVICE_ADDRESS = "00:11:22:33:44:55"; @Mock Loading Loading @@ -123,7 +121,7 @@ public class BluetoothCodecDialogPreferenceControllerTest { .setCodecType(BluetoothCodecConfig.SOURCE_CODEC_TYPE_LDAC) .build(); mCodecConfigOPUS = new BluetoothCodecConfig.Builder() .setCodecType(SOURCE_CODEC_TYPE_OPUS) .setCodecType(BluetoothCodecConfig.SOURCE_CODEC_TYPE_OPUS) .build(); when(mBluetoothAdapter.getActiveDevices(eq(BluetoothProfile.A2DP))) .thenReturn(Arrays.asList(mActiveDevice)); Loading @@ -143,8 +141,8 @@ public class BluetoothCodecDialogPreferenceControllerTest { mController.onBluetoothServiceConnected(mBluetoothA2dp); mController.writeConfigurationValues(0); // TODO(b/240635097): update in U verify(mBluetoothA2dpConfigStore).setCodecType(SOURCE_CODEC_TYPE_OPUS); verify(mBluetoothA2dpConfigStore).setCodecType( BluetoothCodecConfig.SOURCE_CODEC_TYPE_OPUS); } @Test Loading Loading @@ -176,8 +174,8 @@ public class BluetoothCodecDialogPreferenceControllerTest { verify(mBluetoothA2dpConfigStore).setCodecType(BluetoothCodecConfig.SOURCE_CODEC_TYPE_LDAC); mController.writeConfigurationValues(7); // TODO(b/240635097): update in U verify(mBluetoothA2dpConfigStore).setCodecType(SOURCE_CODEC_TYPE_OPUS); verify(mBluetoothA2dpConfigStore).setCodecType( BluetoothCodecConfig.SOURCE_CODEC_TYPE_OPUS); } @Test Loading Loading @@ -211,8 +209,8 @@ public class BluetoothCodecDialogPreferenceControllerTest { @Test public void getCurrentIndexByConfig_verifyOpusIndex() { assertThat(mController.getCurrentIndexByConfig(mCodecConfigOPUS)).isEqualTo( mController.convertCfgToBtnIndex(SOURCE_CODEC_TYPE_OPUS)); // TODO(b/240635097): update in U mController.convertCfgToBtnIndex( BluetoothCodecConfig.SOURCE_CODEC_TYPE_OPUS)); } Loading @@ -239,7 +237,7 @@ public class BluetoothCodecDialogPreferenceControllerTest { mController.onHDAudioEnabled(/* enabled= */ true); verify(mBluetoothA2dpConfigStore, atLeastOnce()).setCodecType( eq(SOURCE_CODEC_TYPE_OPUS)); // TODO(b/240635097): update in U eq(BluetoothCodecConfig.SOURCE_CODEC_TYPE_OPUS)); } @Test Loading Loading
src/com/android/settings/development/bluetooth/AbstractBluetoothDialogPreferenceController.java +2 −3 Original line number Diff line number Diff line Loading @@ -40,9 +40,8 @@ public abstract class AbstractBluetoothDialogPreferenceController extends private static final String TAG = "AbstractBtDlgCtr"; private static final int SOURCE_CODEC_TYPE_OPUS = 6; // TODO(b/240635097): remove in U protected static final int[] CODEC_TYPES = {SOURCE_CODEC_TYPE_OPUS, protected static final int[] CODEC_TYPES = { BluetoothCodecConfig.SOURCE_CODEC_TYPE_OPUS, BluetoothCodecConfig.SOURCE_CODEC_TYPE_LC3, BluetoothCodecConfig.SOURCE_CODEC_TYPE_LDAC, BluetoothCodecConfig.SOURCE_CODEC_TYPE_APTX_HD, Loading
src/com/android/settings/development/bluetooth/BluetoothCodecDialogPreferenceController.java +2 −4 Original line number Diff line number Diff line Loading @@ -40,8 +40,6 @@ public class BluetoothCodecDialogPreferenceController extends private static final String KEY = "bluetooth_audio_codec_settings"; private static final String TAG = "BtCodecCtr"; private static final int SOURCE_CODEC_TYPE_OPUS = 6; // TODO remove in U private final Callback mCallback; public BluetoothCodecDialogPreferenceController(Context context, Lifecycle lifecycle, Loading Loading @@ -125,7 +123,7 @@ public class BluetoothCodecDialogPreferenceController extends codecPriorityValue = BluetoothCodecConfig.CODEC_PRIORITY_HIGHEST; break; case 7: codecTypeValue = SOURCE_CODEC_TYPE_OPUS; // TODO update in U codecTypeValue = BluetoothCodecConfig.SOURCE_CODEC_TYPE_OPUS; codecPriorityValue = BluetoothCodecConfig.CODEC_PRIORITY_HIGHEST; break; default: Loading Loading @@ -190,7 +188,7 @@ public class BluetoothCodecDialogPreferenceController extends case BluetoothCodecConfig.SOURCE_CODEC_TYPE_LDAC: index = 5; break; case SOURCE_CODEC_TYPE_OPUS: // TODO update in U case BluetoothCodecConfig.SOURCE_CODEC_TYPE_OPUS: index = 7; break; default: Loading
tests/robotests/src/com/android/settings/development/bluetooth/BluetoothCodecDialogPreferenceControllerTest.java +8 −10 Original line number Diff line number Diff line Loading @@ -52,8 +52,6 @@ import java.util.List; @RunWith(RobolectricTestRunner.class) public class BluetoothCodecDialogPreferenceControllerTest { private static final int SOURCE_CODEC_TYPE_OPUS = 6; // TODO(b/240635097): remove in U private static final String DEVICE_ADDRESS = "00:11:22:33:44:55"; @Mock Loading Loading @@ -123,7 +121,7 @@ public class BluetoothCodecDialogPreferenceControllerTest { .setCodecType(BluetoothCodecConfig.SOURCE_CODEC_TYPE_LDAC) .build(); mCodecConfigOPUS = new BluetoothCodecConfig.Builder() .setCodecType(SOURCE_CODEC_TYPE_OPUS) .setCodecType(BluetoothCodecConfig.SOURCE_CODEC_TYPE_OPUS) .build(); when(mBluetoothAdapter.getActiveDevices(eq(BluetoothProfile.A2DP))) .thenReturn(Arrays.asList(mActiveDevice)); Loading @@ -143,8 +141,8 @@ public class BluetoothCodecDialogPreferenceControllerTest { mController.onBluetoothServiceConnected(mBluetoothA2dp); mController.writeConfigurationValues(0); // TODO(b/240635097): update in U verify(mBluetoothA2dpConfigStore).setCodecType(SOURCE_CODEC_TYPE_OPUS); verify(mBluetoothA2dpConfigStore).setCodecType( BluetoothCodecConfig.SOURCE_CODEC_TYPE_OPUS); } @Test Loading Loading @@ -176,8 +174,8 @@ public class BluetoothCodecDialogPreferenceControllerTest { verify(mBluetoothA2dpConfigStore).setCodecType(BluetoothCodecConfig.SOURCE_CODEC_TYPE_LDAC); mController.writeConfigurationValues(7); // TODO(b/240635097): update in U verify(mBluetoothA2dpConfigStore).setCodecType(SOURCE_CODEC_TYPE_OPUS); verify(mBluetoothA2dpConfigStore).setCodecType( BluetoothCodecConfig.SOURCE_CODEC_TYPE_OPUS); } @Test Loading Loading @@ -211,8 +209,8 @@ public class BluetoothCodecDialogPreferenceControllerTest { @Test public void getCurrentIndexByConfig_verifyOpusIndex() { assertThat(mController.getCurrentIndexByConfig(mCodecConfigOPUS)).isEqualTo( mController.convertCfgToBtnIndex(SOURCE_CODEC_TYPE_OPUS)); // TODO(b/240635097): update in U mController.convertCfgToBtnIndex( BluetoothCodecConfig.SOURCE_CODEC_TYPE_OPUS)); } Loading @@ -239,7 +237,7 @@ public class BluetoothCodecDialogPreferenceControllerTest { mController.onHDAudioEnabled(/* enabled= */ true); verify(mBluetoothA2dpConfigStore, atLeastOnce()).setCodecType( eq(SOURCE_CODEC_TYPE_OPUS)); // TODO(b/240635097): update in U eq(BluetoothCodecConfig.SOURCE_CODEC_TYPE_OPUS)); } @Test Loading