Loading tests/robotests/src/com/android/settings/development/bluetooth/AbstractBluetoothDialogPreferenceControllerTest.java +18 −10 Original line number Diff line number Diff line Loading @@ -121,7 +121,7 @@ public class AbstractBluetoothDialogPreferenceControllerTest { @Test public void onIndexUpdated_checkFlow() { mCodecStatus = new BluetoothCodecStatus(mCodecConfigAAC, null, null); mCodecStatus = new BluetoothCodecStatus.Builder().setCodecConfig(mCodecConfigAAC).build(); when(mBluetoothA2dp.getCodecStatus( mActiveDevice)).thenReturn(mCodecStatus); when(mBluetoothA2dpConfigStore.createCodecConfig()).thenReturn(mCodecConfigAAC); Loading Loading @@ -161,7 +161,7 @@ public class AbstractBluetoothDialogPreferenceControllerTest { @Test public void getCurrentCodecConfig_verifyConfig() { mCodecStatus = new BluetoothCodecStatus(mCodecConfigAAC, null, null); mCodecStatus = new BluetoothCodecStatus.Builder().setCodecConfig(mCodecConfigAAC).build(); when(mBluetoothA2dp.getCodecStatus( mActiveDevice)).thenReturn(mCodecStatus); mController.onBluetoothServiceConnected(mBluetoothA2dp); Loading @@ -171,8 +171,10 @@ public class AbstractBluetoothDialogPreferenceControllerTest { @Test public void getSelectableConfigs_verifyConfig() { mCodecStatus = new BluetoothCodecStatus(mCodecConfigAAC, null, Arrays.asList(mCodecConfigs)); mCodecStatus = new BluetoothCodecStatus.Builder() .setCodecConfig(mCodecConfigAAC) .setCodecsSelectableCapabilities(Arrays.asList(mCodecConfigs)) .build(); when(mBluetoothA2dp.getCodecStatus( mActiveDevice)).thenReturn(mCodecStatus); mController.onBluetoothServiceConnected(mBluetoothA2dp); Loading @@ -182,8 +184,10 @@ public class AbstractBluetoothDialogPreferenceControllerTest { @Test public void getSelectableByCodecType_verifyConfig() { mCodecStatus = new BluetoothCodecStatus(mCodecConfigAAC, null, Arrays.asList(mCodecConfigs)); mCodecStatus = new BluetoothCodecStatus.Builder() .setCodecConfig(mCodecConfigAAC) .setCodecsSelectableCapabilities(Arrays.asList(mCodecConfigs)) .build(); when(mBluetoothA2dp.getCodecStatus( mActiveDevice)).thenReturn(mCodecStatus); mController.onBluetoothServiceConnected(mBluetoothA2dp); Loading @@ -194,8 +198,10 @@ public class AbstractBluetoothDialogPreferenceControllerTest { @Test public void getSelectableByCodecType_unavailable() { mCodecStatus = new BluetoothCodecStatus(mCodecConfigAAC, null, Arrays.asList(mCodecConfigs)); mCodecStatus = new BluetoothCodecStatus.Builder() .setCodecConfig(mCodecConfigAAC) .setCodecsSelectableCapabilities(Arrays.asList(mCodecConfigs)) .build(); when(mBluetoothA2dp.getCodecStatus( mActiveDevice)).thenReturn(mCodecStatus); mController.onBluetoothServiceConnected(mBluetoothA2dp); Loading @@ -206,8 +212,10 @@ public class AbstractBluetoothDialogPreferenceControllerTest { @Test public void onBluetoothServiceConnected_verifyBluetoothA2dpConfigStore() { mCodecStatus = new BluetoothCodecStatus(mCodecConfigAAC, null, Arrays.asList(mCodecConfigs)); mCodecStatus = new BluetoothCodecStatus.Builder() .setCodecConfig(mCodecConfigAAC) .setCodecsSelectableCapabilities(Arrays.asList(mCodecConfigs)) .build(); when(mBluetoothA2dp.getCodecStatus( mActiveDevice)).thenReturn(mCodecStatus); mController.onBluetoothServiceConnected(mBluetoothA2dp); Loading tests/robotests/src/com/android/settings/development/bluetooth/BluetoothBitPerSampleDialogPreferenceControllerTest.java +8 −4 Original line number Diff line number Diff line Loading @@ -102,8 +102,10 @@ public class BluetoothBitPerSampleDialogPreferenceControllerTest { @Test public void writeConfigurationValues_selectDefault_setHighest() { BluetoothCodecConfig[] mCodecConfigs = {mCodecConfigAAC, mCodecConfigSBC}; mCodecStatus = new BluetoothCodecStatus(mCodecConfigAAC, null, Arrays.asList(mCodecConfigs)); mCodecStatus = new BluetoothCodecStatus.Builder() .setCodecConfig(mCodecConfigAAC) .setCodecsSelectableCapabilities(Arrays.asList(mCodecConfigs)) .build(); when(mBluetoothA2dp.getCodecStatus(mActiveDevice)).thenReturn(mCodecStatus); mController.onBluetoothServiceConnected(mBluetoothA2dp); Loading Loading @@ -132,8 +134,10 @@ public class BluetoothBitPerSampleDialogPreferenceControllerTest { @Test public void getSelectableIndex_verifyList() { BluetoothCodecConfig[] mCodecConfigs = {mCodecConfigAAC, mCodecConfigSBC}; mCodecStatus = new BluetoothCodecStatus(mCodecConfigAAC, null, Arrays.asList(mCodecConfigs)); mCodecStatus = new BluetoothCodecStatus.Builder() .setCodecConfig(mCodecConfigAAC) .setCodecsSelectableCapabilities(Arrays.asList(mCodecConfigs)) .build(); when(mBluetoothA2dp.getCodecStatus(mActiveDevice)).thenReturn(mCodecStatus); mController.onBluetoothServiceConnected(mBluetoothA2dp); List<Integer> indexList = new ArrayList<>(); Loading tests/robotests/src/com/android/settings/development/bluetooth/BluetoothChannelModeDialogPreferenceControllerTest.java +8 −4 Original line number Diff line number Diff line Loading @@ -102,8 +102,10 @@ public class BluetoothChannelModeDialogPreferenceControllerTest { @Test public void writeConfigurationValues_selectDefault_setHighest() { BluetoothCodecConfig[] mCodecConfigs = {mCodecConfigAAC, mCodecConfigSBC}; mCodecStatus = new BluetoothCodecStatus(mCodecConfigSBC, null, Arrays.asList(mCodecConfigs)); mCodecStatus = new BluetoothCodecStatus.Builder() .setCodecConfig(mCodecConfigSBC) .setCodecsSelectableCapabilities(Arrays.asList(mCodecConfigs)) .build(); when(mBluetoothA2dp.getCodecStatus(mActiveDevice)).thenReturn(mCodecStatus); mController.onBluetoothServiceConnected(mBluetoothA2dp); Loading @@ -129,8 +131,10 @@ public class BluetoothChannelModeDialogPreferenceControllerTest { @Test public void getSelectableIndex_verifyList() { BluetoothCodecConfig[] mCodecConfigs = {mCodecConfigAAC, mCodecConfigSBC}; mCodecStatus = new BluetoothCodecStatus(mCodecConfigSBC, null, Arrays.asList(mCodecConfigs)); mCodecStatus = new BluetoothCodecStatus.Builder() .setCodecConfig(mCodecConfigSBC) .setCodecsSelectableCapabilities(Arrays.asList(mCodecConfigs)) .build(); when(mBluetoothA2dp.getCodecStatus(mActiveDevice)).thenReturn(mCodecStatus); mController.onBluetoothServiceConnected(mBluetoothA2dp); List<Integer> indexList = new ArrayList<>(); Loading tests/robotests/src/com/android/settings/development/bluetooth/BluetoothCodecDialogPreferenceControllerTest.java +20 −12 Original line number Diff line number Diff line Loading @@ -126,8 +126,10 @@ public class BluetoothCodecDialogPreferenceControllerTest { @Test public void writeConfigurationValues_selectDefault_setHighest() { BluetoothCodecConfig[] mCodecConfigs = {mCodecConfigAAC, mCodecConfigSBC}; mCodecStatus = new BluetoothCodecStatus(mCodecConfigSBC, null, Arrays.asList(mCodecConfigs)); mCodecStatus = new BluetoothCodecStatus.Builder() .setCodecConfig(mCodecConfigSBC) .setCodecsSelectableCapabilities(Arrays.asList(mCodecConfigs)) .build(); when(mBluetoothA2dp.getCodecStatus(mActiveDevice)).thenReturn(mCodecStatus); when(mBluetoothA2dp.isOptionalCodecsEnabled(mActiveDevice)).thenReturn( BluetoothA2dp.OPTIONAL_CODECS_PREF_ENABLED); Loading @@ -141,8 +143,10 @@ public class BluetoothCodecDialogPreferenceControllerTest { public void writeConfigurationValues_checkCodec() { BluetoothCodecConfig[] mCodecConfigs = {mCodecConfigAAC, mCodecConfigSBC, mCodecConfigAPTX, mCodecConfigAPTXHD, mCodecConfigLDAC, mCodecConfigAAC, mCodecConfigSBC}; mCodecStatus = new BluetoothCodecStatus(mCodecConfigSBC, null, Arrays.asList(mCodecConfigs)); mCodecStatus = new BluetoothCodecStatus.Builder() .setCodecConfig(mCodecConfigSBC) .setCodecsSelectableCapabilities(Arrays.asList(mCodecConfigs)) .build(); when(mBluetoothA2dp.getCodecStatus(mActiveDevice)).thenReturn(mCodecStatus); mController.onBluetoothServiceConnected(mBluetoothA2dp); Loading @@ -169,8 +173,10 @@ public class BluetoothCodecDialogPreferenceControllerTest { public void writeConfigurationValues_resetHighestConfig() { BluetoothCodecConfig[] mCodecConfigs = {mCodecConfigAAC, mCodecConfigSBC, mCodecConfigAPTX, mCodecConfigAPTXHD, mCodecConfigLDAC, mCodecConfigAAC, mCodecConfigSBC}; mCodecStatus = new BluetoothCodecStatus(mCodecConfigAAC, null, Arrays.asList(mCodecConfigs)); mCodecStatus = new BluetoothCodecStatus.Builder() .setCodecConfig(mCodecConfigAAC) .setCodecsSelectableCapabilities(Arrays.asList(mCodecConfigs)) .build(); when(mBluetoothA2dp.getCodecStatus(mActiveDevice)).thenReturn(mCodecStatus); mController.onBluetoothServiceConnected(mBluetoothA2dp); mController.writeConfigurationValues(2); Loading Loading @@ -201,9 +207,10 @@ public class BluetoothCodecDialogPreferenceControllerTest { @Test public void onHDAudioEnabled_optionalCodecEnabled_setsCodecTypeAsAAC() { List<BluetoothCodecConfig> mCodecConfigs = Arrays.asList(mCodecConfigAAC, mCodecConfigSBC); mCodecStatus = new BluetoothCodecStatus(mCodecConfigAAC, /* codecsLocalCapabilities= */ null, mCodecConfigs); mCodecStatus = new BluetoothCodecStatus.Builder() .setCodecConfig(mCodecConfigAAC) .setCodecsSelectableCapabilities(mCodecConfigs) .build(); when(mBluetoothA2dp.getCodecStatus(mActiveDevice)).thenReturn(mCodecStatus); when(mBluetoothA2dp.isOptionalCodecsEnabled(mActiveDevice)).thenReturn( BluetoothA2dp.OPTIONAL_CODECS_PREF_ENABLED); Loading @@ -217,9 +224,10 @@ public class BluetoothCodecDialogPreferenceControllerTest { @Test public void onHDAudioEnabled_optionalCodecDisabled_setsCodecTypeAsSBC() { List<BluetoothCodecConfig> mCodecConfigs = Arrays.asList(mCodecConfigAAC, mCodecConfigSBC); mCodecStatus = new BluetoothCodecStatus(mCodecConfigAAC, /* codecsLocalCapabilities= */ null, mCodecConfigs); mCodecStatus = new BluetoothCodecStatus.Builder() .setCodecConfig(mCodecConfigAAC) .setCodecsSelectableCapabilities(mCodecConfigs) .build(); when(mBluetoothA2dp.getCodecStatus(mActiveDevice)).thenReturn(mCodecStatus); when(mBluetoothA2dp.isOptionalCodecsEnabled(mActiveDevice)).thenReturn( BluetoothA2dp.OPTIONAL_CODECS_PREF_DISABLED); Loading tests/robotests/src/com/android/settings/development/bluetooth/BluetoothQualityDialogPreferenceControllerTest.java +8 −4 Original line number Diff line number Diff line Loading @@ -122,8 +122,10 @@ public class BluetoothQualityDialogPreferenceControllerTest { @Test public void updateState_codeTypeIsLDAC_enablePreference() { BluetoothCodecConfig[] mCodecConfigs = {mCodecConfigAAC, mCodecConfigLDAC}; mCodecStatus = new BluetoothCodecStatus(mCodecConfigLDAC, null, Arrays.asList(mCodecConfigs)); mCodecStatus = new BluetoothCodecStatus.Builder() .setCodecConfig(mCodecConfigLDAC) .setCodecsSelectableCapabilities(Arrays.asList(mCodecConfigs)) .build(); when(mBluetoothA2dp.getCodecStatus(mActiveDevice)).thenReturn(mCodecStatus); mController.onBluetoothServiceConnected(mBluetoothA2dp); mController.updateState(mPreference); Loading @@ -134,8 +136,10 @@ public class BluetoothQualityDialogPreferenceControllerTest { @Test public void updateState_codeTypeAAC_disablePreference() { BluetoothCodecConfig[] mCodecConfigs = {mCodecConfigAAC, mCodecConfigLDAC}; mCodecStatus = new BluetoothCodecStatus(mCodecConfigAAC, null, Arrays.asList(mCodecConfigs)); mCodecStatus = new BluetoothCodecStatus.Builder() .setCodecConfig(mCodecConfigAAC) .setCodecsSelectableCapabilities(Arrays.asList(mCodecConfigs)) .build(); when(mBluetoothA2dp.getCodecStatus(mActiveDevice)).thenReturn(mCodecStatus); mController.onBluetoothServiceConnected(mBluetoothA2dp); mController.updateState(mPreference); Loading Loading
tests/robotests/src/com/android/settings/development/bluetooth/AbstractBluetoothDialogPreferenceControllerTest.java +18 −10 Original line number Diff line number Diff line Loading @@ -121,7 +121,7 @@ public class AbstractBluetoothDialogPreferenceControllerTest { @Test public void onIndexUpdated_checkFlow() { mCodecStatus = new BluetoothCodecStatus(mCodecConfigAAC, null, null); mCodecStatus = new BluetoothCodecStatus.Builder().setCodecConfig(mCodecConfigAAC).build(); when(mBluetoothA2dp.getCodecStatus( mActiveDevice)).thenReturn(mCodecStatus); when(mBluetoothA2dpConfigStore.createCodecConfig()).thenReturn(mCodecConfigAAC); Loading Loading @@ -161,7 +161,7 @@ public class AbstractBluetoothDialogPreferenceControllerTest { @Test public void getCurrentCodecConfig_verifyConfig() { mCodecStatus = new BluetoothCodecStatus(mCodecConfigAAC, null, null); mCodecStatus = new BluetoothCodecStatus.Builder().setCodecConfig(mCodecConfigAAC).build(); when(mBluetoothA2dp.getCodecStatus( mActiveDevice)).thenReturn(mCodecStatus); mController.onBluetoothServiceConnected(mBluetoothA2dp); Loading @@ -171,8 +171,10 @@ public class AbstractBluetoothDialogPreferenceControllerTest { @Test public void getSelectableConfigs_verifyConfig() { mCodecStatus = new BluetoothCodecStatus(mCodecConfigAAC, null, Arrays.asList(mCodecConfigs)); mCodecStatus = new BluetoothCodecStatus.Builder() .setCodecConfig(mCodecConfigAAC) .setCodecsSelectableCapabilities(Arrays.asList(mCodecConfigs)) .build(); when(mBluetoothA2dp.getCodecStatus( mActiveDevice)).thenReturn(mCodecStatus); mController.onBluetoothServiceConnected(mBluetoothA2dp); Loading @@ -182,8 +184,10 @@ public class AbstractBluetoothDialogPreferenceControllerTest { @Test public void getSelectableByCodecType_verifyConfig() { mCodecStatus = new BluetoothCodecStatus(mCodecConfigAAC, null, Arrays.asList(mCodecConfigs)); mCodecStatus = new BluetoothCodecStatus.Builder() .setCodecConfig(mCodecConfigAAC) .setCodecsSelectableCapabilities(Arrays.asList(mCodecConfigs)) .build(); when(mBluetoothA2dp.getCodecStatus( mActiveDevice)).thenReturn(mCodecStatus); mController.onBluetoothServiceConnected(mBluetoothA2dp); Loading @@ -194,8 +198,10 @@ public class AbstractBluetoothDialogPreferenceControllerTest { @Test public void getSelectableByCodecType_unavailable() { mCodecStatus = new BluetoothCodecStatus(mCodecConfigAAC, null, Arrays.asList(mCodecConfigs)); mCodecStatus = new BluetoothCodecStatus.Builder() .setCodecConfig(mCodecConfigAAC) .setCodecsSelectableCapabilities(Arrays.asList(mCodecConfigs)) .build(); when(mBluetoothA2dp.getCodecStatus( mActiveDevice)).thenReturn(mCodecStatus); mController.onBluetoothServiceConnected(mBluetoothA2dp); Loading @@ -206,8 +212,10 @@ public class AbstractBluetoothDialogPreferenceControllerTest { @Test public void onBluetoothServiceConnected_verifyBluetoothA2dpConfigStore() { mCodecStatus = new BluetoothCodecStatus(mCodecConfigAAC, null, Arrays.asList(mCodecConfigs)); mCodecStatus = new BluetoothCodecStatus.Builder() .setCodecConfig(mCodecConfigAAC) .setCodecsSelectableCapabilities(Arrays.asList(mCodecConfigs)) .build(); when(mBluetoothA2dp.getCodecStatus( mActiveDevice)).thenReturn(mCodecStatus); mController.onBluetoothServiceConnected(mBluetoothA2dp); Loading
tests/robotests/src/com/android/settings/development/bluetooth/BluetoothBitPerSampleDialogPreferenceControllerTest.java +8 −4 Original line number Diff line number Diff line Loading @@ -102,8 +102,10 @@ public class BluetoothBitPerSampleDialogPreferenceControllerTest { @Test public void writeConfigurationValues_selectDefault_setHighest() { BluetoothCodecConfig[] mCodecConfigs = {mCodecConfigAAC, mCodecConfigSBC}; mCodecStatus = new BluetoothCodecStatus(mCodecConfigAAC, null, Arrays.asList(mCodecConfigs)); mCodecStatus = new BluetoothCodecStatus.Builder() .setCodecConfig(mCodecConfigAAC) .setCodecsSelectableCapabilities(Arrays.asList(mCodecConfigs)) .build(); when(mBluetoothA2dp.getCodecStatus(mActiveDevice)).thenReturn(mCodecStatus); mController.onBluetoothServiceConnected(mBluetoothA2dp); Loading Loading @@ -132,8 +134,10 @@ public class BluetoothBitPerSampleDialogPreferenceControllerTest { @Test public void getSelectableIndex_verifyList() { BluetoothCodecConfig[] mCodecConfigs = {mCodecConfigAAC, mCodecConfigSBC}; mCodecStatus = new BluetoothCodecStatus(mCodecConfigAAC, null, Arrays.asList(mCodecConfigs)); mCodecStatus = new BluetoothCodecStatus.Builder() .setCodecConfig(mCodecConfigAAC) .setCodecsSelectableCapabilities(Arrays.asList(mCodecConfigs)) .build(); when(mBluetoothA2dp.getCodecStatus(mActiveDevice)).thenReturn(mCodecStatus); mController.onBluetoothServiceConnected(mBluetoothA2dp); List<Integer> indexList = new ArrayList<>(); Loading
tests/robotests/src/com/android/settings/development/bluetooth/BluetoothChannelModeDialogPreferenceControllerTest.java +8 −4 Original line number Diff line number Diff line Loading @@ -102,8 +102,10 @@ public class BluetoothChannelModeDialogPreferenceControllerTest { @Test public void writeConfigurationValues_selectDefault_setHighest() { BluetoothCodecConfig[] mCodecConfigs = {mCodecConfigAAC, mCodecConfigSBC}; mCodecStatus = new BluetoothCodecStatus(mCodecConfigSBC, null, Arrays.asList(mCodecConfigs)); mCodecStatus = new BluetoothCodecStatus.Builder() .setCodecConfig(mCodecConfigSBC) .setCodecsSelectableCapabilities(Arrays.asList(mCodecConfigs)) .build(); when(mBluetoothA2dp.getCodecStatus(mActiveDevice)).thenReturn(mCodecStatus); mController.onBluetoothServiceConnected(mBluetoothA2dp); Loading @@ -129,8 +131,10 @@ public class BluetoothChannelModeDialogPreferenceControllerTest { @Test public void getSelectableIndex_verifyList() { BluetoothCodecConfig[] mCodecConfigs = {mCodecConfigAAC, mCodecConfigSBC}; mCodecStatus = new BluetoothCodecStatus(mCodecConfigSBC, null, Arrays.asList(mCodecConfigs)); mCodecStatus = new BluetoothCodecStatus.Builder() .setCodecConfig(mCodecConfigSBC) .setCodecsSelectableCapabilities(Arrays.asList(mCodecConfigs)) .build(); when(mBluetoothA2dp.getCodecStatus(mActiveDevice)).thenReturn(mCodecStatus); mController.onBluetoothServiceConnected(mBluetoothA2dp); List<Integer> indexList = new ArrayList<>(); Loading
tests/robotests/src/com/android/settings/development/bluetooth/BluetoothCodecDialogPreferenceControllerTest.java +20 −12 Original line number Diff line number Diff line Loading @@ -126,8 +126,10 @@ public class BluetoothCodecDialogPreferenceControllerTest { @Test public void writeConfigurationValues_selectDefault_setHighest() { BluetoothCodecConfig[] mCodecConfigs = {mCodecConfigAAC, mCodecConfigSBC}; mCodecStatus = new BluetoothCodecStatus(mCodecConfigSBC, null, Arrays.asList(mCodecConfigs)); mCodecStatus = new BluetoothCodecStatus.Builder() .setCodecConfig(mCodecConfigSBC) .setCodecsSelectableCapabilities(Arrays.asList(mCodecConfigs)) .build(); when(mBluetoothA2dp.getCodecStatus(mActiveDevice)).thenReturn(mCodecStatus); when(mBluetoothA2dp.isOptionalCodecsEnabled(mActiveDevice)).thenReturn( BluetoothA2dp.OPTIONAL_CODECS_PREF_ENABLED); Loading @@ -141,8 +143,10 @@ public class BluetoothCodecDialogPreferenceControllerTest { public void writeConfigurationValues_checkCodec() { BluetoothCodecConfig[] mCodecConfigs = {mCodecConfigAAC, mCodecConfigSBC, mCodecConfigAPTX, mCodecConfigAPTXHD, mCodecConfigLDAC, mCodecConfigAAC, mCodecConfigSBC}; mCodecStatus = new BluetoothCodecStatus(mCodecConfigSBC, null, Arrays.asList(mCodecConfigs)); mCodecStatus = new BluetoothCodecStatus.Builder() .setCodecConfig(mCodecConfigSBC) .setCodecsSelectableCapabilities(Arrays.asList(mCodecConfigs)) .build(); when(mBluetoothA2dp.getCodecStatus(mActiveDevice)).thenReturn(mCodecStatus); mController.onBluetoothServiceConnected(mBluetoothA2dp); Loading @@ -169,8 +173,10 @@ public class BluetoothCodecDialogPreferenceControllerTest { public void writeConfigurationValues_resetHighestConfig() { BluetoothCodecConfig[] mCodecConfigs = {mCodecConfigAAC, mCodecConfigSBC, mCodecConfigAPTX, mCodecConfigAPTXHD, mCodecConfigLDAC, mCodecConfigAAC, mCodecConfigSBC}; mCodecStatus = new BluetoothCodecStatus(mCodecConfigAAC, null, Arrays.asList(mCodecConfigs)); mCodecStatus = new BluetoothCodecStatus.Builder() .setCodecConfig(mCodecConfigAAC) .setCodecsSelectableCapabilities(Arrays.asList(mCodecConfigs)) .build(); when(mBluetoothA2dp.getCodecStatus(mActiveDevice)).thenReturn(mCodecStatus); mController.onBluetoothServiceConnected(mBluetoothA2dp); mController.writeConfigurationValues(2); Loading Loading @@ -201,9 +207,10 @@ public class BluetoothCodecDialogPreferenceControllerTest { @Test public void onHDAudioEnabled_optionalCodecEnabled_setsCodecTypeAsAAC() { List<BluetoothCodecConfig> mCodecConfigs = Arrays.asList(mCodecConfigAAC, mCodecConfigSBC); mCodecStatus = new BluetoothCodecStatus(mCodecConfigAAC, /* codecsLocalCapabilities= */ null, mCodecConfigs); mCodecStatus = new BluetoothCodecStatus.Builder() .setCodecConfig(mCodecConfigAAC) .setCodecsSelectableCapabilities(mCodecConfigs) .build(); when(mBluetoothA2dp.getCodecStatus(mActiveDevice)).thenReturn(mCodecStatus); when(mBluetoothA2dp.isOptionalCodecsEnabled(mActiveDevice)).thenReturn( BluetoothA2dp.OPTIONAL_CODECS_PREF_ENABLED); Loading @@ -217,9 +224,10 @@ public class BluetoothCodecDialogPreferenceControllerTest { @Test public void onHDAudioEnabled_optionalCodecDisabled_setsCodecTypeAsSBC() { List<BluetoothCodecConfig> mCodecConfigs = Arrays.asList(mCodecConfigAAC, mCodecConfigSBC); mCodecStatus = new BluetoothCodecStatus(mCodecConfigAAC, /* codecsLocalCapabilities= */ null, mCodecConfigs); mCodecStatus = new BluetoothCodecStatus.Builder() .setCodecConfig(mCodecConfigAAC) .setCodecsSelectableCapabilities(mCodecConfigs) .build(); when(mBluetoothA2dp.getCodecStatus(mActiveDevice)).thenReturn(mCodecStatus); when(mBluetoothA2dp.isOptionalCodecsEnabled(mActiveDevice)).thenReturn( BluetoothA2dp.OPTIONAL_CODECS_PREF_DISABLED); Loading
tests/robotests/src/com/android/settings/development/bluetooth/BluetoothQualityDialogPreferenceControllerTest.java +8 −4 Original line number Diff line number Diff line Loading @@ -122,8 +122,10 @@ public class BluetoothQualityDialogPreferenceControllerTest { @Test public void updateState_codeTypeIsLDAC_enablePreference() { BluetoothCodecConfig[] mCodecConfigs = {mCodecConfigAAC, mCodecConfigLDAC}; mCodecStatus = new BluetoothCodecStatus(mCodecConfigLDAC, null, Arrays.asList(mCodecConfigs)); mCodecStatus = new BluetoothCodecStatus.Builder() .setCodecConfig(mCodecConfigLDAC) .setCodecsSelectableCapabilities(Arrays.asList(mCodecConfigs)) .build(); when(mBluetoothA2dp.getCodecStatus(mActiveDevice)).thenReturn(mCodecStatus); mController.onBluetoothServiceConnected(mBluetoothA2dp); mController.updateState(mPreference); Loading @@ -134,8 +136,10 @@ public class BluetoothQualityDialogPreferenceControllerTest { @Test public void updateState_codeTypeAAC_disablePreference() { BluetoothCodecConfig[] mCodecConfigs = {mCodecConfigAAC, mCodecConfigLDAC}; mCodecStatus = new BluetoothCodecStatus(mCodecConfigAAC, null, Arrays.asList(mCodecConfigs)); mCodecStatus = new BluetoothCodecStatus.Builder() .setCodecConfig(mCodecConfigAAC) .setCodecsSelectableCapabilities(Arrays.asList(mCodecConfigs)) .build(); when(mBluetoothA2dp.getCodecStatus(mActiveDevice)).thenReturn(mCodecStatus); mController.onBluetoothServiceConnected(mBluetoothA2dp); mController.updateState(mPreference); Loading