use of com.android.settings.widget.ValidatedEditTextPreference in project android_packages_apps_Settings by LineageOS.
the class WifiTetherSSIDPreferenceController method displayPreference.
@Override
public void displayPreference(PreferenceScreen screen) {
super.displayPreference(screen);
final WifiConfiguration config = mWifiManager.getWifiApConfiguration();
if (config != null) {
mSSID = config.SSID;
} else {
mSSID = DEFAULT_SSID;
}
((ValidatedEditTextPreference) mPreference).setValidator(this);
updateSsidDisplay((EditTextPreference) mPreference);
}
use of com.android.settings.widget.ValidatedEditTextPreference in project android_packages_apps_Settings by LineageOS.
the class WifiTetherPasswordPreferenceControllerTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
mPreference = new ValidatedEditTextPreference(RuntimeEnvironment.application);
mConfig = new WifiConfiguration();
mConfig.SSID = "test_1234";
mConfig.preSharedKey = "test_password";
when(mContext.getSystemService(Context.WIFI_SERVICE)).thenReturn(mWifiManager);
when(mWifiManager.getWifiApConfiguration()).thenReturn(mConfig);
when(mContext.getSystemService(Context.CONNECTIVITY_SERVICE)).thenReturn(mConnectivityManager);
when(mConnectivityManager.getTetherableWifiRegexs()).thenReturn(new String[] { "1", "2" });
when(mContext.getResources()).thenReturn(RuntimeEnvironment.application.getResources());
when(mScreen.findPreference(anyString())).thenReturn(mPreference);
mController = new WifiTetherPasswordPreferenceController(mContext, mListener);
}
use of com.android.settings.widget.ValidatedEditTextPreference in project android_packages_apps_Settings by LineageOS.
the class WifiTetherSSIDPreferenceControllerTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
mPreference = new ValidatedEditTextPreference(RuntimeEnvironment.application);
when(mContext.getSystemService(Context.WIFI_SERVICE)).thenReturn(mWifiManager);
when(mContext.getSystemService(Context.CONNECTIVITY_SERVICE)).thenReturn(mConnectivityManager);
when(mConnectivityManager.getTetherableWifiRegexs()).thenReturn(new String[] { "1", "2" });
when(mContext.getResources()).thenReturn(RuntimeEnvironment.application.getResources());
when(mScreen.findPreference(anyString())).thenReturn(mPreference);
mController = new WifiTetherSSIDPreferenceController(mContext, mListener);
}
use of com.android.settings.widget.ValidatedEditTextPreference in project android_packages_apps_Settings by crdroidandroid.
the class WifiTetherPasswordPreferenceControllerTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
mPreference = new ValidatedEditTextPreference(RuntimeEnvironment.application);
mConfig = new WifiConfiguration();
mConfig.SSID = "test_1234";
mConfig.preSharedKey = "test_password";
when(mContext.getSystemService(Context.WIFI_SERVICE)).thenReturn(mWifiManager);
when(mWifiManager.getWifiApConfiguration()).thenReturn(mConfig);
when(mContext.getSystemService(Context.CONNECTIVITY_SERVICE)).thenReturn(mConnectivityManager);
when(mConnectivityManager.getTetherableWifiRegexs()).thenReturn(new String[] { "1", "2" });
when(mContext.getResources()).thenReturn(RuntimeEnvironment.application.getResources());
when(mScreen.findPreference(anyString())).thenReturn(mPreference);
mController = new WifiTetherPasswordPreferenceController(mContext, mListener);
}
use of com.android.settings.widget.ValidatedEditTextPreference in project android_packages_apps_Settings by SudaMod.
the class WifiTetherSSIDPreferenceController method displayPreference.
@Override
public void displayPreference(PreferenceScreen screen) {
super.displayPreference(screen);
final WifiConfiguration config = mWifiManager.getWifiApConfiguration();
if (config != null) {
mSSID = config.SSID;
} else {
mSSID = DEFAULT_SSID;
}
((ValidatedEditTextPreference) mPreference).setValidator(this);
updateSsidDisplay((EditTextPreference) mPreference);
}
Aggregations