frameworks/base
Revision | deb62be2e87b19e9bbbc668f8d9327b12dba4a3b (tree) |
---|---|
Time | 2011-07-25 01:11:28 |
Author | Wink Saville <wink@goog...> |
Commiter | Android (Google) Code Review |
Merge "Configure RAT dependent retry pattern in GSM DCT." into honeycomb-LTE
@@ -34,6 +34,7 @@ import android.os.Messenger; | ||
34 | 34 | import android.os.SystemProperties; |
35 | 35 | import android.preference.PreferenceManager; |
36 | 36 | import android.provider.Settings; |
37 | +import android.telephony.ServiceState; | |
37 | 38 | import android.provider.Settings.SettingNotFoundException; |
38 | 39 | import android.text.TextUtils; |
39 | 40 | import android.util.Log; |
@@ -993,6 +994,27 @@ public abstract class DataConnectionTracker extends Handler { | ||
993 | 994 | protected void onSetDependencyMet(String apnType, boolean met) { |
994 | 995 | } |
995 | 996 | |
997 | + protected String getReryConfig(boolean forDefault) { | |
998 | + int rt = mPhone.getServiceState().getRadioTechnology(); | |
999 | + | |
1000 | + if ((rt == ServiceState.RADIO_TECHNOLOGY_IS95A) || | |
1001 | + (rt == ServiceState.RADIO_TECHNOLOGY_IS95B) || | |
1002 | + (rt == ServiceState.RADIO_TECHNOLOGY_1xRTT) || | |
1003 | + (rt == ServiceState.RADIO_TECHNOLOGY_EVDO_0) || | |
1004 | + (rt == ServiceState.RADIO_TECHNOLOGY_EVDO_A) || | |
1005 | + (rt == ServiceState.RADIO_TECHNOLOGY_EVDO_B) || | |
1006 | + (rt == ServiceState.RADIO_TECHNOLOGY_EHRPD)) { | |
1007 | + // CDMA variant | |
1008 | + return SystemProperties.get("ro.cdma.data_retry_config"); | |
1009 | + } else { | |
1010 | + // Use GSM varient for all others. | |
1011 | + if (forDefault) { | |
1012 | + return SystemProperties.get("ro.gsm.data_retry_config"); | |
1013 | + } else { | |
1014 | + return SystemProperties.get("ro.gsm.2nd_data_retry_config"); | |
1015 | + } | |
1016 | + } | |
1017 | + } | |
996 | 1018 | |
997 | 1019 | protected void resetAllRetryCounts() { |
998 | 1020 | for (DataConnection dc : mDataConnections.values()) { |
@@ -247,10 +247,11 @@ public class CdmaLteServiceStateTracker extends CdmaServiceStateTracker { | ||
247 | 247 | boolean hasLocationChanged = !newCellLoc.equals(cellLoc); |
248 | 248 | |
249 | 249 | boolean has4gHandoff = |
250 | - ((networkType == ServiceState.RADIO_TECHNOLOGY_LTE) && | |
251 | - (newNetworkType == ServiceState.RADIO_TECHNOLOGY_EHRPD)) || | |
252 | - ((networkType == ServiceState.RADIO_TECHNOLOGY_EHRPD) && | |
253 | - (newNetworkType == ServiceState.RADIO_TECHNOLOGY_LTE)); | |
250 | + mNewDataConnectionState == ServiceState.STATE_IN_SERVICE && | |
251 | + (((networkType == ServiceState.RADIO_TECHNOLOGY_LTE) && | |
252 | + (newNetworkType == ServiceState.RADIO_TECHNOLOGY_EHRPD)) || | |
253 | + ((networkType == ServiceState.RADIO_TECHNOLOGY_EHRPD) && | |
254 | + (newNetworkType == ServiceState.RADIO_TECHNOLOGY_LTE))); | |
254 | 255 | |
255 | 256 | boolean hasMultiApnSupport = |
256 | 257 | (((newNetworkType == ServiceState.RADIO_TECHNOLOGY_LTE) || |
@@ -391,7 +392,7 @@ public class CdmaLteServiceStateTracker extends CdmaServiceStateTracker { | ||
391 | 392 | phone.notifyServiceStateChanged(ss); |
392 | 393 | } |
393 | 394 | |
394 | - if (hasCdmaDataConnectionAttached) { | |
395 | + if (hasCdmaDataConnectionAttached || has4gHandoff) { | |
395 | 396 | mAttachedRegistrants.notifyRegistrants(); |
396 | 397 | } |
397 | 398 |
@@ -609,9 +609,20 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker { | ||
609 | 609 | for (DataConnectionAc dcac : mDataConnectionAsyncChannels.values()) { |
610 | 610 | if (dcac.getReconnectIntentSync() != null) { |
611 | 611 | cancelReconnectAlarm(dcac); |
612 | - if (dcac.dataConnection != null) { | |
613 | - dcac.dataConnection.resetRetryCount(); | |
612 | + } | |
613 | + // update retry config for existing calls to match up | |
614 | + // ones for the new RAT. | |
615 | + if (dcac.dataConnection != null) { | |
616 | + Collection<ApnContext> apns = dcac.getApnListSync(); | |
617 | + | |
618 | + boolean hasDefault = false; | |
619 | + for (ApnContext apnContext : apns) { | |
620 | + if (apnContext.getApnType().equals(Phone.APN_TYPE_DEFAULT)) { | |
621 | + hasDefault = true; | |
622 | + break; | |
623 | + } | |
614 | 624 | } |
625 | + configureRetry(dcac.dataConnection, hasDefault); | |
615 | 626 | } |
616 | 627 | } |
617 | 628 |
@@ -973,7 +984,7 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker { | ||
973 | 984 | |
974 | 985 | // configure retry count if no other Apn is using the same connection. |
975 | 986 | if (refCount == 0) { |
976 | - configureRetry(dc, apnContext.getApnType()); | |
987 | + configureRetry(dc, apn.canHandleType(Phone.APN_TYPE_DEFAULT)); | |
977 | 988 | } |
978 | 989 | apnContext.setDataConnectionAc(dcac); |
979 | 990 | apnContext.setDataConnection(dc); |
@@ -2026,20 +2037,18 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker { | ||
2026 | 2037 | return conn; |
2027 | 2038 | } |
2028 | 2039 | |
2029 | - private void configureRetry(DataConnection dc, String apnType) { | |
2030 | - if ((dc == null) || (apnType == null)) return; | |
2040 | + private void configureRetry(DataConnection dc, boolean forDefault) { | |
2041 | + if (dc == null) return; | |
2031 | 2042 | |
2032 | - if (apnType.equals(Phone.APN_TYPE_DEFAULT)) { | |
2033 | - if (!dc.configureRetry(SystemProperties.get("ro.gsm.data_retry_config"))) { | |
2043 | + if (!dc.configureRetry(getReryConfig(forDefault))) { | |
2044 | + if (forDefault) { | |
2034 | 2045 | if (!dc.configureRetry(DEFAULT_DATA_RETRY_CONFIG)) { |
2035 | 2046 | // Should never happen, log an error and default to a simple linear sequence. |
2036 | 2047 | loge("configureRetry: Could not configure using " + |
2037 | 2048 | "DEFAULT_DATA_RETRY_CONFIG=" + DEFAULT_DATA_RETRY_CONFIG); |
2038 | 2049 | dc.configureRetry(20, 2000, 1000); |
2039 | 2050 | } |
2040 | - } | |
2041 | - } else { | |
2042 | - if (!dc.configureRetry(SystemProperties.get("ro.gsm.2nd_data_retry_config"))) { | |
2051 | + } else { | |
2043 | 2052 | if (!dc.configureRetry(SECONDARY_DATA_RETRY_CONFIG)) { |
2044 | 2053 | // Should never happen, log an error and default to a simple sequence. |
2045 | 2054 | loge("configureRetry: Could note configure using " + |