diff options
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; + } + } |