summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorWink Saville <wink@google.com>2013-08-08 22:03:44 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-08-08 22:03:45 +0000
commitcbad1243ad901b8ffcb7497a8f440414b8d41898 (patch)
treef113b9de4fe967f142b60c140f834bd5cd244cc5 /services
parent7f09ec39b6fd7f24751f814649f12ea686cb28d4 (diff)
parent7f6ee2ec906d63a5c816a9189786b650e25f4793 (diff)
downloadframeworks_base-cbad1243ad901b8ffcb7497a8f440414b8d41898.zip
frameworks_base-cbad1243ad901b8ffcb7497a8f440414b8d41898.tar.gz
frameworks_base-cbad1243ad901b8ffcb7497a8f440414b8d41898.tar.bz2
Merge "Check that hipri has started." into jb-mr2-dev
Diffstat (limited to 'services')
-rw-r--r--services/java/com/android/server/ConnectivityService.java23
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;