Fix how browser determines if it has connectivity.
Rather than use the connectedness of the last network type to report status
we should use the EXTRA_NO_CONNECTIVITY info included with each status report
to see if there is any network connectivity.
bug: 2203128
diff --git a/src/com/android/browser/BrowserActivity.java b/src/com/android/browser/BrowserActivity.java
index 65b7911..5937881 100644
--- a/src/com/android/browser/BrowserActivity.java
+++ b/src/com/android/browser/BrowserActivity.java
@@ -366,11 +366,9 @@
public void onReceive(Context context, Intent intent) {
if (intent.getAction().equals(
ConnectivityManager.CONNECTIVITY_ACTION)) {
- NetworkInfo info =
- (NetworkInfo) intent.getParcelableExtra(
- ConnectivityManager.EXTRA_NETWORK_INFO);
- onNetworkToggle(
- (info != null) ? info.isConnected() : false);
+ boolean noConnectivity = intent.getBooleanExtra(
+ ConnectivityManager.EXTRA_NO_CONNECTIVITY, false);
+ onNetworkToggle(!noConnectivity);
}
}
};