use of com.android.settings.development.BluetoothA2dpConfigStore in project android_packages_apps_Settings by omnirom.
the class AbstractBluetoothDialogPreferenceControllerTest method setup.
@Before
public void setup() {
MockitoAnnotations.initMocks(this);
mContext = RuntimeEnvironment.application;
mLifecycleOwner = () -> mLifecycle;
mLifecycle = new Lifecycle(mLifecycleOwner);
mBluetoothA2dpConfigStore = spy(new BluetoothA2dpConfigStore());
mActiveDevice = BluetoothAdapter.getDefaultAdapter().getRemoteDevice(DEVICE_ADDRESS);
mController = spy(new AbstractBluetoothDialogPreferenceControllerImpl(mContext, mLifecycle, mBluetoothA2dpConfigStore));
mPreference = spy(new BaseBluetoothDialogPreferenceImpl(mContext));
mCodecConfigAAC = new BluetoothCodecConfig(BluetoothCodecConfig.SOURCE_CODEC_TYPE_AAC);
mCodecConfigSBC = new BluetoothCodecConfig(BluetoothCodecConfig.SOURCE_CODEC_TYPE_SBC);
mCodecConfigs[0] = mCodecConfigAAC;
mCodecConfigs[1] = mCodecConfigSBC;
when(mScreen.findPreference(mController.getPreferenceKey())).thenReturn(mPreference);
mController.displayPreference(mScreen);
mCurrentConfig = mController.getCurrentConfigIndex();
when(mPreference.generateSummary(mCurrentConfig)).thenReturn(SUMMARY);
when(mBluetoothA2dp.getActiveDevice()).thenReturn(mActiveDevice);
}
use of com.android.settings.development.BluetoothA2dpConfigStore in project android_packages_apps_Settings by omnirom.
the class BluetoothHDAudioPreferenceControllerTest method setup.
@Before
public void setup() {
MockitoAnnotations.initMocks(this);
mContext = RuntimeEnvironment.application;
mLifecycleOwner = () -> mLifecycle;
mLifecycle = new Lifecycle(mLifecycleOwner);
mBluetoothA2dpConfigStore = spy(new BluetoothA2dpConfigStore());
mController = new BluetoothHDAudioPreferenceController(mContext, mLifecycle, mBluetoothA2dpConfigStore, mCallback);
mPreference = new SwitchPreference(mContext);
when(mScreen.findPreference(mController.getPreferenceKey())).thenReturn(mPreference);
mController.displayPreference(mScreen);
mActiveDevice = ShadowBluetoothDevice.newInstance(TEST_DEVICE_ADDRESS);
}
Aggregations