am deb62be2: Merge "Configure RAT dependent retry pattern in GSM DCT." into honeycomb-LTE
* commit 'deb62be2e87b19e9bbbc668f8d9327b12dba4a3b': Configure RAT dependent retry pattern in GSM DCT.
This commit is contained in:
@@ -34,6 +34,7 @@ import android.os.Messenger;
|
|||||||
import android.os.SystemProperties;
|
import android.os.SystemProperties;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
|
import android.telephony.ServiceState;
|
||||||
import android.provider.Settings.SettingNotFoundException;
|
import android.provider.Settings.SettingNotFoundException;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
@@ -993,6 +994,27 @@ public abstract class DataConnectionTracker extends Handler {
|
|||||||
protected void onSetDependencyMet(String apnType, boolean met) {
|
protected void onSetDependencyMet(String apnType, boolean met) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected String getReryConfig(boolean forDefault) {
|
||||||
|
int rt = mPhone.getServiceState().getRadioTechnology();
|
||||||
|
|
||||||
|
if ((rt == ServiceState.RADIO_TECHNOLOGY_IS95A) ||
|
||||||
|
(rt == ServiceState.RADIO_TECHNOLOGY_IS95B) ||
|
||||||
|
(rt == ServiceState.RADIO_TECHNOLOGY_1xRTT) ||
|
||||||
|
(rt == ServiceState.RADIO_TECHNOLOGY_EVDO_0) ||
|
||||||
|
(rt == ServiceState.RADIO_TECHNOLOGY_EVDO_A) ||
|
||||||
|
(rt == ServiceState.RADIO_TECHNOLOGY_EVDO_B) ||
|
||||||
|
(rt == ServiceState.RADIO_TECHNOLOGY_EHRPD)) {
|
||||||
|
// CDMA variant
|
||||||
|
return SystemProperties.get("ro.cdma.data_retry_config");
|
||||||
|
} else {
|
||||||
|
// Use GSM varient for all others.
|
||||||
|
if (forDefault) {
|
||||||
|
return SystemProperties.get("ro.gsm.data_retry_config");
|
||||||
|
} else {
|
||||||
|
return SystemProperties.get("ro.gsm.2nd_data_retry_config");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected void resetAllRetryCounts() {
|
protected void resetAllRetryCounts() {
|
||||||
for (DataConnection dc : mDataConnections.values()) {
|
for (DataConnection dc : mDataConnections.values()) {
|
||||||
|
|||||||
@@ -247,10 +247,11 @@ public class CdmaLteServiceStateTracker extends CdmaServiceStateTracker {
|
|||||||
boolean hasLocationChanged = !newCellLoc.equals(cellLoc);
|
boolean hasLocationChanged = !newCellLoc.equals(cellLoc);
|
||||||
|
|
||||||
boolean has4gHandoff =
|
boolean has4gHandoff =
|
||||||
((networkType == ServiceState.RADIO_TECHNOLOGY_LTE) &&
|
mNewDataConnectionState == ServiceState.STATE_IN_SERVICE &&
|
||||||
(newNetworkType == ServiceState.RADIO_TECHNOLOGY_EHRPD)) ||
|
(((networkType == ServiceState.RADIO_TECHNOLOGY_LTE) &&
|
||||||
((networkType == ServiceState.RADIO_TECHNOLOGY_EHRPD) &&
|
(newNetworkType == ServiceState.RADIO_TECHNOLOGY_EHRPD)) ||
|
||||||
(newNetworkType == ServiceState.RADIO_TECHNOLOGY_LTE));
|
((networkType == ServiceState.RADIO_TECHNOLOGY_EHRPD) &&
|
||||||
|
(newNetworkType == ServiceState.RADIO_TECHNOLOGY_LTE)));
|
||||||
|
|
||||||
boolean hasMultiApnSupport =
|
boolean hasMultiApnSupport =
|
||||||
(((newNetworkType == ServiceState.RADIO_TECHNOLOGY_LTE) ||
|
(((newNetworkType == ServiceState.RADIO_TECHNOLOGY_LTE) ||
|
||||||
@@ -391,7 +392,7 @@ public class CdmaLteServiceStateTracker extends CdmaServiceStateTracker {
|
|||||||
phone.notifyServiceStateChanged(ss);
|
phone.notifyServiceStateChanged(ss);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hasCdmaDataConnectionAttached) {
|
if (hasCdmaDataConnectionAttached || has4gHandoff) {
|
||||||
mAttachedRegistrants.notifyRegistrants();
|
mAttachedRegistrants.notifyRegistrants();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -609,9 +609,20 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
|
|||||||
for (DataConnectionAc dcac : mDataConnectionAsyncChannels.values()) {
|
for (DataConnectionAc dcac : mDataConnectionAsyncChannels.values()) {
|
||||||
if (dcac.getReconnectIntentSync() != null) {
|
if (dcac.getReconnectIntentSync() != null) {
|
||||||
cancelReconnectAlarm(dcac);
|
cancelReconnectAlarm(dcac);
|
||||||
if (dcac.dataConnection != null) {
|
}
|
||||||
dcac.dataConnection.resetRetryCount();
|
// update retry config for existing calls to match up
|
||||||
|
// ones for the new RAT.
|
||||||
|
if (dcac.dataConnection != null) {
|
||||||
|
Collection<ApnContext> apns = dcac.getApnListSync();
|
||||||
|
|
||||||
|
boolean hasDefault = false;
|
||||||
|
for (ApnContext apnContext : apns) {
|
||||||
|
if (apnContext.getApnType().equals(Phone.APN_TYPE_DEFAULT)) {
|
||||||
|
hasDefault = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
configureRetry(dcac.dataConnection, hasDefault);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -973,7 +984,7 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
|
|||||||
|
|
||||||
// configure retry count if no other Apn is using the same connection.
|
// configure retry count if no other Apn is using the same connection.
|
||||||
if (refCount == 0) {
|
if (refCount == 0) {
|
||||||
configureRetry(dc, apnContext.getApnType());
|
configureRetry(dc, apn.canHandleType(Phone.APN_TYPE_DEFAULT));
|
||||||
}
|
}
|
||||||
apnContext.setDataConnectionAc(dcac);
|
apnContext.setDataConnectionAc(dcac);
|
||||||
apnContext.setDataConnection(dc);
|
apnContext.setDataConnection(dc);
|
||||||
@@ -2026,20 +2037,18 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
|
|||||||
return conn;
|
return conn;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void configureRetry(DataConnection dc, String apnType) {
|
private void configureRetry(DataConnection dc, boolean forDefault) {
|
||||||
if ((dc == null) || (apnType == null)) return;
|
if (dc == null) return;
|
||||||
|
|
||||||
if (apnType.equals(Phone.APN_TYPE_DEFAULT)) {
|
if (!dc.configureRetry(getReryConfig(forDefault))) {
|
||||||
if (!dc.configureRetry(SystemProperties.get("ro.gsm.data_retry_config"))) {
|
if (forDefault) {
|
||||||
if (!dc.configureRetry(DEFAULT_DATA_RETRY_CONFIG)) {
|
if (!dc.configureRetry(DEFAULT_DATA_RETRY_CONFIG)) {
|
||||||
// Should never happen, log an error and default to a simple linear sequence.
|
// Should never happen, log an error and default to a simple linear sequence.
|
||||||
loge("configureRetry: Could not configure using " +
|
loge("configureRetry: Could not configure using " +
|
||||||
"DEFAULT_DATA_RETRY_CONFIG=" + DEFAULT_DATA_RETRY_CONFIG);
|
"DEFAULT_DATA_RETRY_CONFIG=" + DEFAULT_DATA_RETRY_CONFIG);
|
||||||
dc.configureRetry(20, 2000, 1000);
|
dc.configureRetry(20, 2000, 1000);
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
} else {
|
|
||||||
if (!dc.configureRetry(SystemProperties.get("ro.gsm.2nd_data_retry_config"))) {
|
|
||||||
if (!dc.configureRetry(SECONDARY_DATA_RETRY_CONFIG)) {
|
if (!dc.configureRetry(SECONDARY_DATA_RETRY_CONFIG)) {
|
||||||
// Should never happen, log an error and default to a simple sequence.
|
// Should never happen, log an error and default to a simple sequence.
|
||||||
loge("configureRetry: Could note configure using " +
|
loge("configureRetry: Could note configure using " +
|
||||||
|
|||||||
Reference in New Issue
Block a user