diff options
author | Tsu Chiang Chuang <tsu@google.com> | 2012-02-29 09:55:38 -0800 |
---|---|---|
committer | Tsu Chiang Chuang <tsu@google.com> | 2012-03-01 12:28:14 -0800 |
commit | 4b1afab106f3959ba56fba08fbdccee5d15068bc (patch) | |
tree | b0d8f1a2b75df37937e1d9437d4725d8e7707a5c /core/tests | |
parent | 4fe25f693ad311556fb232c352ed0b84d59343a5 (diff) | |
download | frameworks_base-4b1afab106f3959ba56fba08fbdccee5d15068bc.zip frameworks_base-4b1afab106f3959ba56fba08fbdccee5d15068bc.tar.gz frameworks_base-4b1afab106f3959ba56fba08fbdccee5d15068bc.tar.bz2 |
extend timeout to allow for more time for the device to connect.
Change-Id: If3929ca69a5025c7048d57276813c270229a76db
Diffstat (limited to 'core/tests')
-rw-r--r-- | core/tests/bandwidthtests/src/com/android/bandwidthtest/util/ConnectionUtil.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/core/tests/bandwidthtests/src/com/android/bandwidthtest/util/ConnectionUtil.java b/core/tests/bandwidthtests/src/com/android/bandwidthtest/util/ConnectionUtil.java index 8d778c4..75d3cce 100644 --- a/core/tests/bandwidthtests/src/com/android/bandwidthtest/util/ConnectionUtil.java +++ b/core/tests/bandwidthtests/src/com/android/bandwidthtest/util/ConnectionUtil.java @@ -59,7 +59,7 @@ public class ConnectionUtil { private static final int WAIT_FOR_SCAN_RESULT = 10 * 1000; // 10 seconds private static final int WIFI_SCAN_TIMEOUT = 50 * 1000; public static final int SHORT_TIMEOUT = 5 * 1000; - public static final int LONG_TIMEOUT = 120 * 1000; // 2 minutes + public static final int LONG_TIMEOUT = 5 * 60 * 1000; // 5 minutes private ConnectivityReceiver mConnectivityReceiver = null; private WifiReceiver mWifiReceiver = null; private DownloadReceiver mDownloadReceiver = null; @@ -458,7 +458,13 @@ public class ConnectionUtil { if (mNetworkInfo == null) { Log.v(LOG_TAG, "Do not have networkInfo! Force fetch of network info."); mNetworkInfo = mCM.getActiveNetworkInfo(); - Assert.assertNotNull(mNetworkInfo); + } + // Still null after force fetch? Maybe the network did not have time to be brought + // up yet. + if (mNetworkInfo == null) { + Log.v(LOG_TAG, "Failed to force fetch networkInfo. " + + "The network is still not ready. Wait for the next broadcast"); + continue; } if ((mNetworkInfo.getType() != networkType) || (mNetworkInfo.getState() != expectedState)) { |