summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEmily Bernier <ember@google.com>2014-12-09 20:02:41 -0500
committerEmily Bernier <ember@google.com>2014-12-09 20:02:41 -0500
commit50ac12e222db3847e04938f2280ad5f38f7b82f2 (patch)
tree1f18b343cec7800a35ba3383513bc8cf0a91a209 /src
parent14ff2f7c30b8258807f44afb815ccc71dc574c1c (diff)
downloadpackages_apps_Settings-50ac12e222db3847e04938f2280ad5f38f7b82f2.tar.gz
packages_apps_Settings-50ac12e222db3847e04938f2280ad5f38f7b82f2.tar.bz2
packages_apps_Settings-50ac12e222db3847e04938f2280ad5f38f7b82f2.zip
Listen for CONNECTIVITY_ACTION broadcasts in WifiSetupActivity
In some cases, NETWORK_STATE_CHANGED_ACTION broadcasts are sent before the current network state has been updated in ConnectivityService. Listening for CONNECTIVITY_ACTION broadcasts as well ensures that we properly catch new connections and auto-advance appropriately. Bug: 18503725 Change-Id: Ia414d57d196d09171342fb3ae93c7e826cb1a1aa
Diffstat (limited to 'src')
-rw-r--r--src/com/android/settings/wifi/WifiSetupActivity.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/com/android/settings/wifi/WifiSetupActivity.java b/src/com/android/settings/wifi/WifiSetupActivity.java
index a036baed0..06a25d82b 100644
--- a/src/com/android/settings/wifi/WifiSetupActivity.java
+++ b/src/com/android/settings/wifi/WifiSetupActivity.java
@@ -68,13 +68,14 @@ public class WifiSetupActivity extends WifiPickerActivity
private SetupWizardNavBar mNavigationBar;
- private final IntentFilter mFilter = new IntentFilter(WifiManager.NETWORK_STATE_CHANGED_ACTION);
+ private IntentFilter mFilter = new IntentFilter();
private final BroadcastReceiver mReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
// Refresh the connection state with the latest connection info. Use the connection info
// from ConnectivityManager instead of the one attached in the intent to make sure
// we have the most up-to-date connection state. b/17511772
+
refreshConnectionState();
}
};
@@ -84,6 +85,8 @@ public class WifiSetupActivity extends WifiPickerActivity
super.onCreate(savedInstanceState);
final Intent intent = getIntent();
+ mFilter.addAction(WifiManager.NETWORK_STATE_CHANGED_ACTION);
+ mFilter.addAction(ConnectivityManager.CONNECTIVITY_ACTION);
mAutoFinishOnConnection = intent.getBooleanExtra(EXTRA_AUTO_FINISH_ON_CONNECT, false);
mAllowSkip = intent.getBooleanExtra(EXTRA_ALLOW_SKIP, true);
@@ -108,6 +111,7 @@ public class WifiSetupActivity extends WifiPickerActivity
getSystemService(Context.CONNECTIVITY_SERVICE);
boolean connected = connectivity != null &&
connectivity.getNetworkInfo(ConnectivityManager.TYPE_WIFI).isConnected();
+
refreshConnectionState(connected);
}