Handle not fully connected networks.
Jeff Sharkey [Wed, 3 Oct 2012 18:26:56 +0000 (11:26 -0700)]
When checking network status, treat non-connected networks as
disconnected.  This handles cases like captive portal checks, and
slow DHCP servers.

Bug: 7264340
Change-Id: I0b466cee5d5cb73037f3fb209c583711b8f9eefd

src/com/android/providers/downloads/DownloadInfo.java

index e452e5b..b6d57a0 100644 (file)
@@ -342,7 +342,7 @@ public class DownloadInfo {
      */
     public int checkCanUseNetwork() {
         final NetworkInfo info = mSystemFacade.getActiveNetworkInfo(mUid);
-        if (info == null) {
+        if (info == null || !info.isConnected()) {
             return NETWORK_NO_CONNECTION;
         }
         if (DetailedState.BLOCKED.equals(info.getDetailedState())) {