diff options
| author | Wink Saville <wink@google.com> | 2013-08-08 15:46:46 -0700 |
|---|---|---|
| committer | Android Git Automerger <android-git-automerger@android.com> | 2013-08-08 15:46:46 -0700 |
| commit | 81b1fa6fc62190d64a6b76b4a5ee7cc2bf3172ac (patch) | |
| tree | 4e28a6fc5f21db6d7110fd583be4d87cd3a14eca | |
| parent | bc8bb009ae7144a81c66aeed985a929dbc4778e7 (diff) | |
| parent | 9b6363e5e6d37e3e8d103751d81613eeca32bbbf (diff) | |
| download | frameworks_base-81b1fa6fc62190d64a6b76b4a5ee7cc2bf3172ac.zip frameworks_base-81b1fa6fc62190d64a6b76b4a5ee7cc2bf3172ac.tar.gz frameworks_base-81b1fa6fc62190d64a6b76b4a5ee7cc2bf3172ac.tar.bz2 | |
am 9b6363e5: am cbad1243: Merge "Check that hipri has started." into jb-mr2-dev
* commit '9b6363e5e6d37e3e8d103751d81613eeca32bbbf':
Check that hipri has started.
| -rw-r--r-- | services/java/com/android/server/ConnectivityService.java | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/services/java/com/android/server/ConnectivityService.java b/services/java/com/android/server/ConnectivityService.java index cb4e89c..caab49e 100644 --- a/services/java/com/android/server/ConnectivityService.java +++ b/services/java/com/android/server/ConnectivityService.java @@ -3732,11 +3732,26 @@ public class ConnectivityService extends IConnectivityManager.Stub { // hipri connection so the default connection stays active. log("isMobileOk: start hipri url=" + params.mUrl); mCs.setEnableFailFastMobileData(DctConstants.ENABLED); - mCs.startUsingNetworkFeature(ConnectivityManager.TYPE_MOBILE, - Phone.FEATURE_ENABLE_HIPRI, new Binder()); // Continue trying to connect until time has run out long endTime = SystemClock.elapsedRealtime() + params.mTimeOutMs; + + // First wait until we can start using hipri + Binder binder = new Binder(); + while(SystemClock.elapsedRealtime() < endTime) { + int ret = mCs.startUsingNetworkFeature(ConnectivityManager.TYPE_MOBILE, + Phone.FEATURE_ENABLE_HIPRI, binder); + if ((ret == PhoneConstants.APN_ALREADY_ACTIVE) + || (ret == PhoneConstants.APN_REQUEST_STARTED)) { + log("isMobileOk: hipri started"); + break; + } + if (VDBG) log("isMobileOk: hipri not started yet"); + result = ConnectivityManager.CMP_RESULT_CODE_NO_CONNECTION; + sleep(1); + } + + // Continue trying to connect until time has run out while(SystemClock.elapsedRealtime() < endTime) { try { // Wait for hipri to connect. @@ -3745,8 +3760,10 @@ public class ConnectivityService extends IConnectivityManager.Stub { NetworkInfo.State state = mCs .getNetworkInfo(ConnectivityManager.TYPE_MOBILE_HIPRI).getState(); if (state != NetworkInfo.State.CONNECTED) { - log("isMobileOk: not connected ni=" + + if (VDBG) { + log("isMobileOk: not connected ni=" + mCs.getNetworkInfo(ConnectivityManager.TYPE_MOBILE_HIPRI)); + } sleep(1); result = ConnectivityManager.CMP_RESULT_CODE_NO_CONNECTION; continue; |
