use of com.android.settings.widget.ValidatedEditTextPreference in project android_packages_apps_Settings by SudaMod.
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 DirtyUnicorns.
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 DirtyUnicorns.
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 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 Resurrection_packages_apps_Settings by ResurrectionRemix.
the class WifiTetherPasswordPreferenceController method updatePasswordDisplay.
private void updatePasswordDisplay(EditTextPreference preference) {
ValidatedEditTextPreference pref = (ValidatedEditTextPreference) preference;
pref.setText(mPassword);
if (!TextUtils.isEmpty(mPassword)) {
pref.setIsSummaryPassword(true);
pref.setSummary(mPassword);
pref.setVisible(true);
} else {
pref.setIsSummaryPassword(false);
pref.setSummary(R.string.wifi_hotspot_no_password_subtext);
pref.setVisible(false);
}
}
Aggregations