am bcd5f33d: am 9b6363e5: am cbad1243: Merge "Check that hipri has started." into jb-mr2-dev
* commit 'bcd5f33d7eea7c09fe727d61613429c0d49c2086': Check that hipri has started.
This commit is contained in:
@@ -3916,11 +3916,26 @@ public class ConnectivityService extends IConnectivityManager.Stub {
|
|||||||
// hipri connection so the default connection stays active.
|
// hipri connection so the default connection stays active.
|
||||||
log("isMobileOk: start hipri url=" + params.mUrl);
|
log("isMobileOk: start hipri url=" + params.mUrl);
|
||||||
mCs.setEnableFailFastMobileData(DctConstants.ENABLED);
|
mCs.setEnableFailFastMobileData(DctConstants.ENABLED);
|
||||||
mCs.startUsingNetworkFeature(ConnectivityManager.TYPE_MOBILE,
|
|
||||||
Phone.FEATURE_ENABLE_HIPRI, new Binder());
|
|
||||||
|
|
||||||
// Continue trying to connect until time has run out
|
// Continue trying to connect until time has run out
|
||||||
long endTime = SystemClock.elapsedRealtime() + params.mTimeOutMs;
|
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) {
|
while(SystemClock.elapsedRealtime() < endTime) {
|
||||||
try {
|
try {
|
||||||
// Wait for hipri to connect.
|
// Wait for hipri to connect.
|
||||||
|
|||||||
Reference in New Issue
Block a user