Merge "Address API Council feedback for WifiAdapter/WPS APIs" into lmp-dev

This commit is contained in:
Vinit Deshpande
2014-09-03 00:59:56 +00:00
committed by Android (Google) Code Review

View File

@@ -57,7 +57,7 @@ public class WpsDialog extends AlertDialog {
private static final int WPS_TIMEOUT_S = 120; private static final int WPS_TIMEOUT_S = 120;
private WifiManager mWifiManager; private WifiManager mWifiManager;
private WifiManager.WpsListener mWpsListener; private WifiManager.WpsCallback mWpsListener;
private int mWpsSetup; private int mWpsSetup;
private final IntentFilter mFilter; private final IntentFilter mFilter;
@@ -81,8 +81,9 @@ public class WpsDialog extends AlertDialog {
mContext = context; mContext = context;
mWpsSetup = wpsSetup; mWpsSetup = wpsSetup;
class WpsListener implements WifiManager.WpsListener { class WpsListener extends WifiManager.WpsCallback {
public void onStartSuccess(String pin) {
public void onStarted(String pin) {
if (pin != null) { if (pin != null) {
updateDialog(DialogState.WPS_START, String.format( updateDialog(DialogState.WPS_START, String.format(
mContext.getString(R.string.wifi_wps_onstart_pin), pin)); mContext.getString(R.string.wifi_wps_onstart_pin), pin));
@@ -91,12 +92,13 @@ public class WpsDialog extends AlertDialog {
R.string.wifi_wps_onstart_pbc)); R.string.wifi_wps_onstart_pbc));
} }
} }
public void onCompletion() {
public void onSucceeded() {
updateDialog(DialogState.WPS_COMPLETE, updateDialog(DialogState.WPS_COMPLETE,
mContext.getString(R.string.wifi_wps_complete)); mContext.getString(R.string.wifi_wps_complete));
} }
public void onFailure(int reason) { public void onFailed(int reason) {
String msg; String msg;
switch (reason) { switch (reason) {
case WifiManager.WPS_OVERLAP_ERROR: case WifiManager.WPS_OVERLAP_ERROR: