use of androidx.preference.PreferenceManager in project android_packages_apps_Settings by omnirom.
the class NetworkProviderSimsCategoryControllerTest method setUp.
@Before
public void setUp() throws Exception {
MockitoAnnotations.initMocks(this);
mContext = spy(ApplicationProvider.getApplicationContext());
if (Looper.myLooper() == null) {
Looper.prepare();
}
mPreferenceManager = new PreferenceManager(mContext);
mPreferenceScreen = mPreferenceManager.createPreferenceScreen(mContext);
mPreferenceCategory = new PreferenceCategory(mContext);
mPreferenceCategory.setKey(KEY_PREFERENCE_CATEGORY_SIM);
mPreferenceScreen.addPreference(mPreferenceCategory);
mCategoryController = new NetworkProviderSimsCategoryController(mContext, KEY_PREFERENCE_CATEGORY_SIM, mLifecycle);
}
use of androidx.preference.PreferenceManager in project android_packages_apps_Settings by omnirom.
the class ConnectedEthernetNetworkControllerTest method setUp.
@Before
public void setUp() {
mContext = spy(ApplicationProvider.getApplicationContext());
when(mContext.getSystemService(ConnectivityManager.class)).thenReturn(mock(ConnectivityManager.class));
when(mContext.getSystemService(Context.WIFI_SERVICE)).thenReturn(mock(WifiManager.class));
mController = new ConnectedEthernetNetworkController(mContext, mock(Lifecycle.class));
if (Looper.myLooper() == null) {
Looper.prepare();
}
final PreferenceManager preferenceManager = new PreferenceManager(mContext);
mScreen = preferenceManager.createPreferenceScreen(mContext);
mPreference = new Preference(mContext);
mPreference.setKey(ConnectedEthernetNetworkController.KEY);
mScreen.addPreference(mPreference);
}
use of androidx.preference.PreferenceManager in project android_packages_apps_Settings by omnirom.
the class StorageUsageProgressBarPreferenceControllerTest method setUp.
@Before
public void setUp() throws Exception {
if (Looper.myLooper() == null) {
Looper.prepare();
}
MockitoAnnotations.initMocks(this);
mContext = spy(ApplicationProvider.getApplicationContext());
when(mContext.getSystemService(StorageStatsManager.class)).thenReturn(mStorageStatsManager);
mController = new FakeStorageUsageProgressBarPreferenceController(mContext, "key");
final PreferenceManager preferenceManager = new PreferenceManager(mContext);
mPreferenceScreen = preferenceManager.createPreferenceScreen(mContext);
final UsageProgressBarPreference usageProgressBarPreference = new UsageProgressBarPreference(mContext);
usageProgressBarPreference.setKey(mController.getPreferenceKey());
mPreferenceScreen.addPreference(usageProgressBarPreference);
}
use of androidx.preference.PreferenceManager in project android_packages_apps_Settings by omnirom.
the class ChooseAccountPreferenceControllerTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
mContext = RuntimeEnvironment.application;
mController = spy(new ChooseAccountPreferenceController(mContext, "controller_key"));
mActivity = Robolectric.setupActivity(FragmentActivity.class);
mPreferenceManager = new PreferenceManager(mContext);
mPreferenceScreen = mPreferenceManager.createPreferenceScreen(mContext);
}
use of androidx.preference.PreferenceManager in project android_packages_apps_Settings by omnirom.
the class PaymentSettingsTest method isShowEmptyImage_hasVisiblePreference_returnFalse.
@Test
public void isShowEmptyImage_hasVisiblePreference_returnFalse() {
final PaymentSettings paymentSettings = new PaymentSettings();
final PreferenceManager preferenceManager = new PreferenceManager(mContext);
final PreferenceScreen screen = preferenceManager.createPreferenceScreen(mContext);
final Preference preference1 = new Preference(mContext);
screen.addPreference(preference1);
final Preference preference2 = new Preference(mContext);
screen.addPreference(preference2);
assertThat(paymentSettings.isShowEmptyImage(screen)).isFalse();
}
Aggregations