Merge "checkMobileProvisioning should not block." into klp-dev
This commit is contained in:
@@ -3987,40 +3987,6 @@ public class ConnectivityService extends IConnectivityManager.Stub {
|
|||||||
// Start off with notification off
|
// Start off with notification off
|
||||||
setProvNotificationVisible(false, ConnectivityManager.TYPE_NONE, null, null);
|
setProvNotificationVisible(false, ConnectivityManager.TYPE_NONE, null, null);
|
||||||
|
|
||||||
// See if we've alreadying determined if we've got a provsioning connection
|
|
||||||
// if so we don't need to do anything active
|
|
||||||
MobileDataStateTracker mdstDefault = (MobileDataStateTracker)
|
|
||||||
mNetTrackers[ConnectivityManager.TYPE_MOBILE];
|
|
||||||
boolean isDefaultProvisioning = mdstDefault.isProvisioningNetwork();
|
|
||||||
|
|
||||||
MobileDataStateTracker mdstHipri = (MobileDataStateTracker)
|
|
||||||
mNetTrackers[ConnectivityManager.TYPE_MOBILE_HIPRI];
|
|
||||||
boolean isHipriProvisioning = mdstHipri.isProvisioningNetwork();
|
|
||||||
|
|
||||||
if (isDefaultProvisioning || isHipriProvisioning) {
|
|
||||||
if (mIsNotificationVisible) {
|
|
||||||
if (DBG) {
|
|
||||||
log("checkMobileProvisioning: provisioning-ignore notification is visible");
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
NetworkInfo ni = null;
|
|
||||||
if (isDefaultProvisioning) {
|
|
||||||
ni = mdstDefault.getNetworkInfo();
|
|
||||||
}
|
|
||||||
if (isHipriProvisioning) {
|
|
||||||
ni = mdstHipri.getNetworkInfo();
|
|
||||||
}
|
|
||||||
String url = getMobileProvisioningUrl();
|
|
||||||
if ((ni != null) && (!TextUtils.isEmpty(url))) {
|
|
||||||
setProvNotificationVisible(true, ni.getType(), ni.getExtraInfo(), url);
|
|
||||||
} else {
|
|
||||||
if (DBG) log("checkMobileProvisioning: provisioning but no url, ignore");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
mIsCheckingMobileProvisioning.set(false);
|
|
||||||
return timeOutMs;
|
|
||||||
}
|
|
||||||
|
|
||||||
CheckMp checkMp = new CheckMp(mContext, this);
|
CheckMp checkMp = new CheckMp(mContext, this);
|
||||||
CheckMp.CallBack cb = new CheckMp.CallBack() {
|
CheckMp.CallBack cb = new CheckMp.CallBack() {
|
||||||
@Override
|
@Override
|
||||||
@@ -4154,8 +4120,26 @@ public class ConnectivityService extends IConnectivityManager.Stub {
|
|||||||
mParams = params;
|
mParams = params;
|
||||||
|
|
||||||
if (mCs.isNetworkSupported(ConnectivityManager.TYPE_MOBILE) == false) {
|
if (mCs.isNetworkSupported(ConnectivityManager.TYPE_MOBILE) == false) {
|
||||||
log("isMobileOk: not mobile capable");
|
|
||||||
result = CMP_RESULT_CODE_NO_CONNECTION;
|
result = CMP_RESULT_CODE_NO_CONNECTION;
|
||||||
|
log("isMobileOk: X not mobile capable result=" + result);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
// See if we've already determined we've got a provisioning connection,
|
||||||
|
// if so we don't need to do anything active.
|
||||||
|
MobileDataStateTracker mdstDefault = (MobileDataStateTracker)
|
||||||
|
mCs.mNetTrackers[ConnectivityManager.TYPE_MOBILE];
|
||||||
|
boolean isDefaultProvisioning = mdstDefault.isProvisioningNetwork();
|
||||||
|
log("isMobileOk: isDefaultProvisioning=" + isDefaultProvisioning);
|
||||||
|
|
||||||
|
MobileDataStateTracker mdstHipri = (MobileDataStateTracker)
|
||||||
|
mCs.mNetTrackers[ConnectivityManager.TYPE_MOBILE_HIPRI];
|
||||||
|
boolean isHipriProvisioning = mdstHipri.isProvisioningNetwork();
|
||||||
|
log("isMobileOk: isHipriProvisioning=" + isHipriProvisioning);
|
||||||
|
|
||||||
|
if (isDefaultProvisioning || isHipriProvisioning) {
|
||||||
|
result = CMP_RESULT_CODE_PROVISIONING_NETWORK;
|
||||||
|
log("isMobileOk: X default || hipri is provisioning result=" + result);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4217,8 +4201,8 @@ public class ConnectivityService extends IConnectivityManager.Stub {
|
|||||||
MobileDataStateTracker mdst = (MobileDataStateTracker)
|
MobileDataStateTracker mdst = (MobileDataStateTracker)
|
||||||
mCs.mNetTrackers[ConnectivityManager.TYPE_MOBILE_HIPRI];
|
mCs.mNetTrackers[ConnectivityManager.TYPE_MOBILE_HIPRI];
|
||||||
if (mdst.isProvisioningNetwork()) {
|
if (mdst.isProvisioningNetwork()) {
|
||||||
if (DBG) log("isMobileOk: isProvisioningNetwork is true");
|
|
||||||
result = CMP_RESULT_CODE_PROVISIONING_NETWORK;
|
result = CMP_RESULT_CODE_PROVISIONING_NETWORK;
|
||||||
|
if (DBG) log("isMobileOk: X isProvisioningNetwork result=" + result);
|
||||||
return result;
|
return result;
|
||||||
} else {
|
} else {
|
||||||
if (DBG) log("isMobileOk: isProvisioningNetwork is false, continue");
|
if (DBG) log("isMobileOk: isProvisioningNetwork is false, continue");
|
||||||
@@ -4233,8 +4217,8 @@ public class ConnectivityService extends IConnectivityManager.Stub {
|
|||||||
try {
|
try {
|
||||||
addresses = InetAddress.getAllByName(orgUri.getHost());
|
addresses = InetAddress.getAllByName(orgUri.getHost());
|
||||||
} catch (UnknownHostException e) {
|
} catch (UnknownHostException e) {
|
||||||
log("isMobileOk: UnknownHostException");
|
|
||||||
result = CMP_RESULT_CODE_NO_DNS;
|
result = CMP_RESULT_CODE_NO_DNS;
|
||||||
|
log("isMobileOk: X UnknownHostException result=" + result);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
log("isMobileOk: addresses=" + inetAddressesToString(addresses));
|
log("isMobileOk: addresses=" + inetAddressesToString(addresses));
|
||||||
@@ -4309,8 +4293,9 @@ public class ConnectivityService extends IConnectivityManager.Stub {
|
|||||||
|
|
||||||
if (responseCode == 204) {
|
if (responseCode == 204) {
|
||||||
// Return
|
// Return
|
||||||
log("isMobileOk: expected responseCode=" + responseCode);
|
|
||||||
result = CMP_RESULT_CODE_CONNECTABLE;
|
result = CMP_RESULT_CODE_CONNECTABLE;
|
||||||
|
log("isMobileOk: X expected responseCode=" + responseCode
|
||||||
|
+ " result=" + result);
|
||||||
return result;
|
return result;
|
||||||
} else {
|
} else {
|
||||||
// Retry to be sure this was redirected, we've gotten
|
// Retry to be sure this was redirected, we've gotten
|
||||||
@@ -4328,7 +4313,7 @@ public class ConnectivityService extends IConnectivityManager.Stub {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
log("isMobileOk: loops|timed out result=" + result);
|
log("isMobileOk: X loops|timed out result=" + result);
|
||||||
return result;
|
return result;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log("isMobileOk: Exception e=" + e);
|
log("isMobileOk: Exception e=" + e);
|
||||||
|
|||||||
Reference in New Issue
Block a user