use of com.android.wifitrackerlib.WifiEntry in project android_packages_apps_Settings by omnirom.
the class NetworkProviderSettingsTest method createWifiDialog2.
private WifiDialog2 createWifiDialog2(int mode, WifiConfiguration config) {
final WifiEntry wifiEntry = mock(WifiEntry.class);
when(wifiEntry.canConnect()).thenReturn(true);
final WifiConfigController2 controller = mock(WifiConfigController2.class);
when(controller.getConfig()).thenReturn(config);
final WifiDialog2 wifiDialog2 = spy(WifiDialog2.createModal(mContext, null, /* listener */
wifiEntry, mode));
when(wifiDialog2.getController()).thenReturn(controller);
return wifiDialog2;
}
use of com.android.wifitrackerlib.WifiEntry in project android_packages_apps_Settings by omnirom.
the class NetworkProviderSettingsTest method createConnectedWifiEntryPreference_internetCellular_createFirstWifiPreference.
@Test
public void createConnectedWifiEntryPreference_internetCellular_createFirstWifiPreference() {
final WifiEntry wifiEntry = mock(WifiEntry.class);
doReturn(InternetUpdater.INTERNET_CELLULAR).when(mInternetUpdater).getInternetType();
final Preference p = mNetworkProviderSettings.createConnectedWifiEntryPreference(wifiEntry);
assertThat(p instanceof NetworkProviderSettings.FirstWifiEntryPreference).isTrue();
}
use of com.android.wifitrackerlib.WifiEntry in project android_packages_apps_Settings by omnirom.
the class NetworkProviderSettingsTest method onSubmit_modeConnectNoConfig_connectWifiEntry.
@Test
public void onSubmit_modeConnectNoConfig_connectWifiEntry() {
WifiDialog2 dialog = createWifiDialog2(MODE_CONNECT, null);
final WifiEntry wifiEntry = dialog.getWifiEntry();
mNetworkProviderSettings.onAttach(mContext);
mNetworkProviderSettings.onSubmit(dialog);
verify(mNetworkProviderSettings).connect(wifiEntry, false, /* editIfNoConfig */
false);
}
use of com.android.wifitrackerlib.WifiEntry in project android_packages_apps_Settings by omnirom.
the class WifiSliceTest method createWifiSliceItem.
private WifiSliceItem createWifiSliceItem(String title, @ConnectedState int connectedState) {
final WifiEntry wifiEntry = mock(WifiEntry.class);
when(wifiEntry.getTitle()).thenReturn(title);
when(wifiEntry.getKey()).thenReturn("key");
when(wifiEntry.getConnectedState()).thenReturn(connectedState);
when(wifiEntry.getLevel()).thenReturn(WifiEntry.WIFI_LEVEL_MAX);
return new WifiSliceItem(mContext, wifiEntry);
}
use of com.android.wifitrackerlib.WifiEntry in project android_packages_apps_Settings by omnirom.
the class SavedAccessPointsPreferenceController2Test method getAvailability_oneSavedAccessPoint_shouldAvailable.
@Test
public void getAvailability_oneSavedAccessPoint_shouldAvailable() {
final WifiEntry mockWifiEntry = mock(WifiEntry.class);
mController.mWifiEntries = Arrays.asList(mockWifiEntry);
assertThat(mController.getAvailabilityStatus()).isEqualTo(AVAILABLE);
}
Aggregations