diff options
author | Robert Greenwalt <robdroid@android.com> | 2009-09-28 21:04:22 -0700 |
---|---|---|
committer | Robert Greenwalt <robdroid@android.com> | 2009-09-29 13:23:45 -0700 |
commit | c46c255f7f8aa3e70a607493c550ffb863666ef1 (patch) | |
tree | 7daaa1878fc490c8001fabd02b1b1954f6ffe6bb /telephony | |
parent | bd5b57227954e27ca05932721a6917c6edde17b3 (diff) | |
download | frameworks_base-c46c255f7f8aa3e70a607493c550ffb863666ef1.zip frameworks_base-c46c255f7f8aa3e70a607493c550ffb863666ef1.tar.gz frameworks_base-c46c255f7f8aa3e70a607493c550ffb863666ef1.tar.bz2 |
Fix the reporting of ActiveApnTypes on CDMA
Previous fix limiting what was reported active was too strict, leading to
DISCONNECTED messages not being accepted (apn list was empty).
bug: 2151520
Diffstat (limited to 'telephony')
-rw-r--r-- | telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java | 20 | ||||
-rw-r--r-- | telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java | 20 |
2 files changed, 27 insertions, 13 deletions
diff --git a/telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java b/telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java index 9407603..d0a9337 100644 --- a/telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java +++ b/telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java @@ -76,6 +76,9 @@ public final class CdmaDataConnectionTracker extends DataConnectionTracker { /** Currently active CdmaDataConnection */ private CdmaDataConnection mActiveDataConnection; + /** mimic of GSM's mActiveApn */ + private boolean mIsApnActive = false; + private boolean mPendingRestartRadio = false; private static final int TIME_DELAYED_TO_RESTART_RADIO = SystemProperties.getInt("ro.cdma.timetoradiorestart", 20000); @@ -245,8 +248,7 @@ public final class CdmaDataConnectionTracker extends DataConnectionTracker { @Override protected boolean isApnTypeActive(String type) { - return (isApnTypeAvailable(type) && - (state != State.IDLE)); + return (mIsApnActive && isApnTypeAvailable(type)); } @Override @@ -260,10 +262,15 @@ public final class CdmaDataConnectionTracker extends DataConnectionTracker { } protected String[] getActiveApnTypes() { - if (state != State.IDLE) { - return mSupportedApnTypes.clone(); + String[] result; + if (mIsApnActive) { + result = mSupportedApnTypes.clone(); + } else { + // TODO - should this return an empty array? See GSM too. + result = new String[1]; + result[0] = Phone.APN_TYPE_DEFAULT; } - return new String[0]; + return result; } protected String getActiveApnString() { @@ -386,6 +393,7 @@ public final class CdmaDataConnectionTracker extends DataConnectionTracker { if (!tearDown) { setState(State.IDLE); phone.notifyDataConnection(reason); + mIsApnActive = false; } } @@ -409,6 +417,7 @@ public final class CdmaDataConnectionTracker extends DataConnectionTracker { } mActiveDataConnection = conn; + mIsApnActive = true; Message msg = obtainMessage(); msg.what = EVENT_DATA_SETUP_COMPLETE; @@ -742,6 +751,7 @@ public final class CdmaDataConnectionTracker extends DataConnectionTracker { } phone.notifyDataConnection(reason); + mIsApnActive = false; if (retryAfterDisconnected(reason)) { trySetupData(reason); } diff --git a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java index c85b9bd..5bdf09f 100644 --- a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java +++ b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java @@ -596,32 +596,36 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker { } protected String getInterfaceName(String apnType) { - if (mActivePdp != null - && (apnType == null || mActiveApn.canHandleType(apnType))) { + if (mActivePdp != null && + (apnType == null || + (mActiveApn != null && mActiveApn.canHandleType(apnType)))) { return mActivePdp.getInterface(); } return null; } protected String getIpAddress(String apnType) { - if (mActivePdp != null - && (apnType == null || mActiveApn.canHandleType(apnType))) { + if (mActivePdp != null && + (apnType == null || + (mActiveApn != null && mActiveApn.canHandleType(apnType)))) { return mActivePdp.getIpAddress(); } return null; } public String getGateway(String apnType) { - if (mActivePdp != null - && (apnType == null || mActiveApn.canHandleType(apnType))) { + if (mActivePdp != null && + (apnType == null || + (mActiveApn != null && mActiveApn.canHandleType(apnType)))) { return mActivePdp.getGatewayAddress(); } return null; } protected String[] getDnsServers(String apnType) { - if (mActivePdp != null - && (apnType == null || mActiveApn.canHandleType(apnType))) { + if (mActivePdp != null && + (apnType == null || + (mActiveApn != null && mActiveApn.canHandleType(apnType)))) { return mActivePdp.getDnsServers(); } return null; |