Show password field when authentication failed.
- add onAuthenticationFailure() method to prepare appropriate UIs. - set "edit" boolean to true so that users can modify password when re-seleting a network. - keep mStatusText shown for simplicity. It has been hidden during "editing" phase, but we don't need to do that any more - modify Connect button handling so that the button hides/appears at appropriate time - manage visibility state of some fields so that we can "reset" the status when authentication failed - show keyboard again when password field re-appears Bug: 3330109 Change-Id: I1cdf0573280ab46882117e21501a43a447e50b40
This commit is contained in:
@@ -445,6 +445,10 @@ public class WifiSettings extends SettingsPreferenceFragment
|
||||
updateConnectionState(WifiInfo.getDetailedStateOf((SupplicantState)
|
||||
intent.getParcelableExtra(WifiManager.EXTRA_NEW_STATE)));
|
||||
}
|
||||
|
||||
if (mInXlSetupWizard) {
|
||||
((WifiSettingsForSetupWizardXL)getActivity()).onSupplicantStateChanged(intent);
|
||||
}
|
||||
} else if (WifiManager.NETWORK_STATE_CHANGED_ACTION.equals(action)) {
|
||||
NetworkInfo info = (NetworkInfo) intent.getParcelableExtra(
|
||||
WifiManager.EXTRA_NETWORK_INFO);
|
||||
@@ -588,11 +592,11 @@ public class WifiSettings extends SettingsPreferenceFragment
|
||||
}
|
||||
} else if (config.networkId != INVALID_NETWORK_ID) {
|
||||
if (mSelectedAccessPoint != null) {
|
||||
mWifiManager.saveNetwork(config);
|
||||
saveNetwork(config);
|
||||
}
|
||||
} else {
|
||||
if (configController.isEdit() || requireKeyStore(config)) {
|
||||
mWifiManager.saveNetwork(config);
|
||||
saveNetwork(config);
|
||||
} else {
|
||||
mWifiManager.connectNetwork(config);
|
||||
}
|
||||
@@ -606,6 +610,14 @@ public class WifiSettings extends SettingsPreferenceFragment
|
||||
updateAccessPoints();
|
||||
}
|
||||
|
||||
private void saveNetwork(WifiConfiguration config) {
|
||||
if (mInXlSetupWizard) {
|
||||
((WifiSettingsForSetupWizardXL)getActivity()).onSaveNetwork(config);
|
||||
} else {
|
||||
mWifiManager.saveNetwork(config);
|
||||
}
|
||||
}
|
||||
|
||||
/* package */ void forget() {
|
||||
mWifiManager.forgetNetwork(mSelectedAccessPoint.networkId);
|
||||
|
||||
|
Reference in New Issue
Block a user