diff options
author | Irfan Sheriff <isheriff@google.com> | 2011-01-16 13:03:10 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-01-16 13:03:10 -0800 |
commit | 4de7499d7cee5ccbbe656ad4aa96102959356b65 (patch) | |
tree | 3eb106da85c0b9fffff3fa03defc36ee4496f727 /src | |
parent | f6bbf11a05b03201229fbc6ebe5a241692f212f2 (diff) | |
parent | dee5b268925641c2e8f6280ce817fafa7e76d953 (diff) | |
download | packages_apps_Settings-4de7499d7cee5ccbbe656ad4aa96102959356b65.zip packages_apps_Settings-4de7499d7cee5ccbbe656ad4aa96102959356b65.tar.gz packages_apps_Settings-4de7499d7cee5ccbbe656ad4aa96102959356b65.tar.bz2 |
Merge "Add feedback dialogs for WPS" into honeycomb
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/settings/wifi/WifiSettings.java | 34 |
1 files changed, 25 insertions, 9 deletions
diff --git a/src/com/android/settings/wifi/WifiSettings.java b/src/com/android/settings/wifi/WifiSettings.java index e47660a..4628863 100644 --- a/src/com/android/settings/wifi/WifiSettings.java +++ b/src/com/android/settings/wifi/WifiSettings.java @@ -37,7 +37,9 @@ import android.net.wifi.SupplicantState; import android.net.wifi.WifiConfiguration; import android.net.wifi.WifiInfo; import android.net.wifi.WifiManager; +import android.net.wifi.WpsResult; import android.net.wifi.WifiConfiguration.KeyMgmt; +import android.net.wifi.WpsConfiguration; import android.os.Bundle; import android.os.Handler; import android.os.Message; @@ -571,18 +573,32 @@ public class WifiSettings extends SettingsPreferenceFragment } /* package */ void submit(WifiConfigController configController) { - switch(configController.chosenNetworkSetupMethod()) { + int networkSetup = configController.chosenNetworkSetupMethod(); + switch(networkSetup) { case WifiConfigController.WPS_PBC: case WifiConfigController.WPS_PIN_FROM_ACCESS_POINT: - mWifiManager.startWps(configController.getWpsConfig()); - break; case WifiConfigController.WPS_PIN_FROM_DEVICE: - String pin = mWifiManager.startWps(configController.getWpsConfig()); - new AlertDialog.Builder(getActivity()) - .setTitle(R.string.wifi_wps_pin_method_configuration) - .setMessage(getResources().getString(R.string.wifi_wps_pin_output, pin)) - .setPositiveButton(android.R.string.ok, null) - .show(); + WpsResult result = mWifiManager.startWps(configController.getWpsConfig()); + AlertDialog.Builder dialog = new AlertDialog.Builder(getActivity()) + .setTitle(R.string.wifi_wps_setup_title) + .setPositiveButton(android.R.string.ok, null); + switch (result.status) { + case FAILURE: + dialog.setMessage(R.string.wifi_wps_failed); + dialog.show(); + break; + case IN_PROGRESS: + dialog.setMessage(R.string.wifi_wps_in_progress); + dialog.show(); + break; + default: + if (networkSetup == WifiConfigController.WPS_PIN_FROM_DEVICE) { + dialog.setMessage(getResources().getString(R.string.wifi_wps_pin_output, + result.pin)); + dialog.show(); + } + break; + } break; case WifiConfigController.MANUAL: final WifiConfiguration config = configController.getConfig(); |