Search in sources :

Example 21 with SwitchBarController

use of com.android.settings.widget.SwitchBarController in project android_packages_apps_Settings by omnirom.

the class BluetoothEnablerTest method setUp.

@Before
public void setUp() {
    MockitoAnnotations.initMocks(this);
    mContext = spy(RuntimeEnvironment.application);
    mRestrictedSwitchPreference = new RestrictedSwitchPreference(mContext);
    mSwitchController = spy(new SwitchBarController(new SwitchBar(mContext)));
    mBluetoothEnabler = new BluetoothEnabler(mContext, mSwitchController, mMetricsFeatureProvider, 123, mRestrictionUtils);
    mHolder = PreferenceViewHolder.createInstanceForTests(mock(View.class));
    mRestrictedSwitchPreference.onBindViewHolder(mHolder);
    mBluetoothEnabler.setToggleCallback(mCallback);
    mShadowBluetoothAdapter = Shadow.extract(BluetoothAdapter.getDefaultAdapter());
}
Also used : SwitchBar(com.android.settings.widget.SwitchBar) RestrictedSwitchPreference(com.android.settingslib.RestrictedSwitchPreference) SwitchBarController(com.android.settings.widget.SwitchBarController) Before(org.junit.Before)

Example 22 with SwitchBarController

use of com.android.settings.widget.SwitchBarController in project android_packages_apps_Settings by omnirom.

the class MultiUserSwitchBarControllerTest method setUp.

@Before
public void setUp() {
    mContext = RuntimeEnvironment.application;
    mUserManager = ShadowUserManager.getShadow();
    mSwitchBarController = spy(new SwitchBarController(new SwitchBar(mContext)));
    mUserManager.setSupportsMultipleUsers(true);
}
Also used : SwitchBar(com.android.settings.widget.SwitchBar) SwitchBarController(com.android.settings.widget.SwitchBarController) Before(org.junit.Before)

Aggregations

SwitchBarController (com.android.settings.widget.SwitchBarController)22 SettingsActivity (com.android.settings.SettingsActivity)15 SwitchBar (com.android.settings.widget.SwitchBar)14 Before (org.junit.Before)7 RestrictedSwitchPreference (com.android.settingslib.RestrictedSwitchPreference)2 Lifecycle (com.android.settingslib.core.lifecycle.Lifecycle)2 BluetoothPan (android.bluetooth.BluetoothPan)1 Context (android.content.Context)1 BluetoothSwitchPreferenceController (com.android.settings.bluetooth.BluetoothSwitchPreferenceController)1