diff options
author | Ricardo Cerqueira <github@cerqueira.org> | 2012-03-14 02:02:49 +0300 |
---|---|---|
committer | Gerrit Code Review <gerrit@review.cyanogenmod.com> | 2012-03-14 02:02:49 +0300 |
commit | f3b7e828ca534b7a0a95217df443fa78e5557adc (patch) | |
tree | f6ac42c14a709e0deca56767cef7f0cce7adb033 /telephony | |
parent | 4c78ff04081e63e48f74dd202d7b9bff33f0c219 (diff) | |
parent | bdbb263b5dc5170f9ca38e73da2de2cc4605a164 (diff) | |
download | frameworks_base-f3b7e828ca534b7a0a95217df443fa78e5557adc.zip frameworks_base-f3b7e828ca534b7a0a95217df443fa78e5557adc.tar.gz frameworks_base-f3b7e828ca534b7a0a95217df443fa78e5557adc.tar.bz2 |
Merge "Telephony: Add "singlepdp" RIL feature" into ics
Diffstat (limited to 'telephony')
-rw-r--r-- | telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java index 963db2c..caed614 100644 --- a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java +++ b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java @@ -475,6 +475,12 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker { if (DBG) log("enableApnType: return APN_ALREADY_ACTIVE"); return Phone.APN_ALREADY_ACTIVE; } + if (needsOldRilFeature("singlepdp") && !Phone.APN_TYPE_DEFAULT.equals(apnType)) { + ApnContext defContext = mApnContexts.get(Phone.APN_TYPE_DEFAULT); + if (defContext.isEnabled()) { + setEnabled(apnTypeToId(Phone.APN_TYPE_DEFAULT), false); + } + } setEnabled(apnTypeToId(apnType), true); if (DBG) { log("enableApnType: new apn request for type " + apnType + @@ -509,6 +515,9 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker { if (apnContext != null) { setEnabled(apnTypeToId(type), false); + if (needsOldRilFeature("singlepdp") && !Phone.APN_TYPE_DEFAULT.equals(type)) { + setEnabled(apnTypeToId(Phone.APN_TYPE_DEFAULT), true); + } if (apnContext.getState() != State.IDLE && apnContext.getState() != State.FAILED) { if (DBG) log("diableApnType: return APN_REQUEST_STARTED"); return Phone.APN_REQUEST_STARTED; @@ -2458,4 +2467,15 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker { protected void loge(String s) { Log.e(LOG_TAG, "[GsmDCT] " + s); } + + /** Maybe we should share this from RIL */ + protected boolean needsOldRilFeature(String feature) { + String[] features = SystemProperties.get("ro.telephony.ril.v3", "").split(","); + for (String found: features) { + if (found.equals(feature)) + return true; + } + return false; + } + } |