Show Error dialog when WPS is interrupted
When WPS searching is interruptd by turning Wi-Fi off, Error dialog should be displayed. Bug: 29883134 Test: manual - tap WPS Push Button and turn Airplane mode on Change-Id: Ie6667c6b7d09540af21b015e0d5b991d818d2c77
This commit is contained in:
committed by
Yoshinori Hirano
parent
3a2e327741
commit
a15be47bd5
@@ -125,6 +125,7 @@ public class WpsDialog extends AlertDialog {
|
||||
|
||||
|
||||
mFilter = new IntentFilter();
|
||||
mFilter.addAction(WifiManager.WIFI_STATE_CHANGED_ACTION);
|
||||
mFilter.addAction(WifiManager.NETWORK_STATE_CHANGED_ACTION);
|
||||
mReceiver = new BroadcastReceiver() {
|
||||
@Override
|
||||
@@ -261,7 +262,18 @@ public class WpsDialog extends AlertDialog {
|
||||
|
||||
private void handleEvent(Context context, Intent intent) {
|
||||
String action = intent.getAction();
|
||||
if (WifiManager.NETWORK_STATE_CHANGED_ACTION.equals(action)) {
|
||||
if (WifiManager.WIFI_STATE_CHANGED_ACTION.equals(action)) {
|
||||
final int state = intent.getIntExtra(WifiManager.EXTRA_WIFI_STATE,
|
||||
WifiManager.WIFI_STATE_UNKNOWN);
|
||||
if (state == WifiManager.WIFI_STATE_DISABLED) {
|
||||
if (mTimer != null) {
|
||||
mTimer.cancel();
|
||||
mTimer = null;
|
||||
}
|
||||
String msg = mContext.getString(R.string.wifi_wps_failed_wifi_disconnected);
|
||||
updateDialog(DialogState.WPS_FAILED, msg);
|
||||
}
|
||||
} else if (WifiManager.NETWORK_STATE_CHANGED_ACTION.equals(action)) {
|
||||
NetworkInfo info = (NetworkInfo) intent.getParcelableExtra(
|
||||
WifiManager.EXTRA_NETWORK_INFO);
|
||||
final NetworkInfo.DetailedState state = info.getDetailedState();
|
||||
|
Reference in New Issue
Block a user