Search in sources :

Example 6 with BluetoothA2dpConfigStore

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);
}
Also used : BluetoothA2dpConfigStore(com.android.settings.development.BluetoothA2dpConfigStore) Lifecycle(com.android.settingslib.core.lifecycle.Lifecycle) BluetoothCodecConfig(android.bluetooth.BluetoothCodecConfig) Before(org.junit.Before)

Example 7 with BluetoothA2dpConfigStore

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);
}
Also used : BluetoothA2dpConfigStore(com.android.settings.development.BluetoothA2dpConfigStore) SwitchPreference(androidx.preference.SwitchPreference) Lifecycle(com.android.settingslib.core.lifecycle.Lifecycle) Before(org.junit.Before)

Aggregations

BluetoothA2dpConfigStore (com.android.settings.development.BluetoothA2dpConfigStore)7 Lifecycle (com.android.settingslib.core.lifecycle.Lifecycle)7 Before (org.junit.Before)7 BluetoothCodecConfig (android.bluetooth.BluetoothCodecConfig)6 SwitchPreference (androidx.preference.SwitchPreference)1