aboutsummaryrefslogtreecommitdiffstats
path: root/src/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/java')
-rw-r--r--src/java/com/android/internal/telephony/dataconnection/DcTracker.java21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/java/com/android/internal/telephony/dataconnection/DcTracker.java b/src/java/com/android/internal/telephony/dataconnection/DcTracker.java
index 46572f846..92886c01f 100644
--- a/src/java/com/android/internal/telephony/dataconnection/DcTracker.java
+++ b/src/java/com/android/internal/telephony/dataconnection/DcTracker.java
@@ -1616,6 +1616,15 @@ public class DcTracker extends Handler {
}
}
+ if (apnContext.getApnType().equals(PhoneConstants.APN_TYPE_MMS)) {
+ CarrierConfigManager configManager = (CarrierConfigManager) mPhone.getContext()
+ .getSystemService(Context.CARRIER_CONFIG_SERVICE);
+ PersistableBundle pb = configManager.getConfigForSubId(mPhone.getSubId());
+ if (pb != null) {
+ isDataAllowed = pb.getBoolean("config_enable_mms_with_mobile_data_off");
+ }
+ }
+
if (apnContext.isConnectable()
&& (isEmergencyApn
|| (isDataAllowed && isDataAllowedForApn(apnContext) && !isEmergency()))) {
@@ -2579,6 +2588,13 @@ public class DcTracker extends Handler {
}
} else if (met) {
apnContext.setReason(Phone.REASON_DATA_DISABLED);
+ CarrierConfigManager configManager = (CarrierConfigManager) mPhone.getContext()
+ .getSystemService(Context.CARRIER_CONFIG_SERVICE);
+ PersistableBundle pb = configManager.getConfigForSubId(mPhone.getSubId());
+ boolean mmsWithMobileDataOff = false;
+ if (pb != null) {
+ mmsWithMobileDataOff = pb.getBoolean("config_enable_mms_with_mobile_data_off");
+ }
// If ConnectivityService has disabled this network, stop trying to bring
// it up, but do not tear it down - ConnectivityService will do that
// directly by talking with the DataConnection.
@@ -2588,7 +2604,10 @@ public class DcTracker extends Handler {
// request goes away. This applies to both CDMA and GSM because they both
// can declare the DUN APN sharable by default traffic, thus still satisfying
// those requests and not torn down organically.
- if (apnContext.getApnType() == PhoneConstants.APN_TYPE_DUN && teardownForDun()) {
+ if ((apnContext.getApnType() == PhoneConstants.APN_TYPE_DUN && teardownForDun())
+ || apnContext.getState() != DctConstants.State.CONNECTED
+ || (mmsWithMobileDataOff
+ && apnContext.getApnType().equals(PhoneConstants.APN_TYPE_MMS))) {
cleanup = true;
} else {
cleanup = false;