use of com.android.settings.wifi.WifiConnectionPreferenceController in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class WifiConnectionPreferenceControllerTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
mContext = spy(RuntimeEnvironment.application);
WifiTrackerFactory.setTestingWifiTracker(mWifiTracker);
mLifecycleOwner = () -> mLifecycle;
mLifecycle = new Lifecycle(mLifecycleOwner);
when(mScreen.findPreference(eq(KEY))).thenReturn(mPreferenceCategory);
when(mScreen.getContext()).thenReturn(mContext);
mUpdateListener = () -> mOnChildUpdatedCount++;
mController = new WifiConnectionPreferenceController(mContext, mLifecycle, mUpdateListener, KEY, 0, 0);
}
use of com.android.settings.wifi.WifiConnectionPreferenceController in project android_packages_apps_Settings by omnirom.
the class MultiNetworkHeaderControllerTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
mContext = spy(ApplicationProvider.getApplicationContext());
when(mContext.getSystemService(SubscriptionManager.class)).thenReturn(mSubscriptionManager);
mHeaderController = new MultiNetworkHeaderController(mContext, KEY_HEADER) {
@Override
WifiConnectionPreferenceController createWifiController(Lifecycle lifecycle) {
return mWifiController;
}
@Override
SubscriptionsPreferenceController createSubscriptionsController(Lifecycle lifecycle) {
return mSubscriptionsController;
}
};
if (Looper.myLooper() == null) {
Looper.prepare();
}
mPreferenceManager = new PreferenceManager(mContext);
mPreferenceScreen = mPreferenceManager.createPreferenceScreen(mContext);
mPreferenceScreen.setInitialExpandedChildrenCount(EXPANDED_CHILDREN_COUNT);
when(mPreferenceCategory.getKey()).thenReturn(KEY_HEADER);
when(mPreferenceCategory.getPreferenceCount()).thenReturn(3);
mPreferenceScreen.addPreference(mPreferenceCategory);
}
use of com.android.settings.wifi.WifiConnectionPreferenceController in project android_packages_apps_Settings by omnirom.
the class WifiConnectionPreferenceControllerTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
mContext = spy(RuntimeEnvironment.application);
mLifecycleOwner = () -> mLifecycle;
mLifecycle = new Lifecycle(mLifecycleOwner);
when(mScreen.findPreference(eq(KEY))).thenReturn(mPreferenceCategory);
when(mScreen.getContext()).thenReturn(mContext);
mUpdateListener = () -> mOnChildUpdatedCount++;
mController = new WifiConnectionPreferenceController(mContext, mLifecycle, mUpdateListener, KEY, 0, 0);
mController.mWifiPickerTracker = mWifiPickerTracker;
}
Aggregations