Use updated WifiManager API

Change-Id: Ia02fc8a7eafa84fa4eddeeefafa7fecaac82903e
This commit is contained in:
Irfan Sheriff
2012-07-10 11:42:55 -07:00
parent 24d1058d00
commit 5cd1bbda7d
3 changed files with 14 additions and 21 deletions

View File

@@ -56,7 +56,6 @@ public class WpsDialog extends AlertDialog {
private static final int WPS_TIMEOUT_S = 120;
private WifiManager mWifiManager;
private WifiManager.Channel mChannel;
private WifiManager.WpsListener mWpsListener;
private int mWpsSetup;
@@ -155,7 +154,6 @@ public class WpsDialog extends AlertDialog {
});
mWifiManager = (WifiManager) mContext.getSystemService(Context.WIFI_SERVICE);
mChannel = mWifiManager.initialize(mContext, mContext.getMainLooper(), null);
setView(mView);
super.onCreate(savedInstanceState);
@@ -184,13 +182,13 @@ public class WpsDialog extends AlertDialog {
WpsInfo wpsConfig = new WpsInfo();
wpsConfig.setup = mWpsSetup;
mWifiManager.startWps(mChannel, wpsConfig, mWpsListener);
mWifiManager.startWps(wpsConfig, mWpsListener);
}
@Override
protected void onStop() {
if (mDialogState != DialogState.WPS_COMPLETE) {
mWifiManager.cancelWps(mChannel, null);
mWifiManager.cancelWps(null);
}
if (mReceiver != null) {