Loading src/java/com/android/internal/telephony/Phone.java +5 −0 Original line number Diff line number Diff line Loading @@ -1447,6 +1447,11 @@ public interface Phone { */ boolean isDataConnectivityPossible(); /** * Report on whether on-demand data connectivity is allowed. */ boolean isOnDemandDataPossible(String apnType); /** * Report on whether data connectivity is allowed for an APN. */ Loading src/java/com/android/internal/telephony/PhoneBase.java +6 −0 Original line number Diff line number Diff line Loading @@ -1747,6 +1747,12 @@ public abstract class PhoneBase extends Handler implements Phone { return isDataConnectivityPossible(PhoneConstants.APN_TYPE_DEFAULT); } @Override public boolean isOnDemandDataPossible(String apnType) { return ((mDcTracker != null) && (mDcTracker.isOnDemandDataPossible(apnType))); } @Override public boolean isDataConnectivityPossible(String apnType) { return ((mDcTracker != null) && Loading src/java/com/android/internal/telephony/PhoneProxy.java +5 −0 Original line number Diff line number Diff line Loading @@ -1014,6 +1014,11 @@ public class PhoneProxy extends Handler implements Phone { return mActivePhone.isDataConnectivityPossible(PhoneConstants.APN_TYPE_DEFAULT); } @Override public boolean isOnDemandDataPossible(String apnType) { return mActivePhone.isOnDemandDataPossible(apnType); } @Override public boolean isDataConnectivityPossible(String apnType) { return mActivePhone.isDataConnectivityPossible(apnType); Loading src/java/com/android/internal/telephony/dataconnection/DcTracker.java +35 −14 Original line number Diff line number Diff line Loading @@ -743,6 +743,40 @@ public final class DcTracker extends DcTrackerBase { return (apnContext.getDcAc() != null); } @Override public boolean isOnDemandDataPossible(String apnType) { /* * Check if APN enabled * Check if MobileData is ON * Check if MobileData UI override present */ boolean flag = false; ApnContext apnContext = mApnContexts.get(apnType); if (apnContext == null) { return false; } boolean apnContextIsEnabled = apnContext.isEnabled(); DctConstants.State apnContextState = apnContext.getState(); boolean apnTypePossible = !(apnContextIsEnabled && (apnContextState == DctConstants.State.FAILED)); boolean userDataEnabled = mUserDataEnabled; if (PhoneConstants.APN_TYPE_MMS.equals(apnType)) { boolean mobileDataOffOveride = mPhone.getContext().getResources(). getBoolean(com.android.internal.R.bool.config_enable_mms_with_mobile_data_off); log("isOnDemandDataPossible MobileDataEnabled override = " + mobileDataOffOveride); userDataEnabled = (mUserDataEnabled || mobileDataOffOveride); } flag = apnTypePossible && userDataEnabled; log("isOnDemandDataPossible, possible =" + flag + ", apnContext = " + apnContext); return flag; } @Override public boolean isDataPossible(String apnType) { ApnContext apnContext = mApnContexts.get(apnType); Loading Loading @@ -2005,20 +2039,7 @@ public final class DcTracker extends DcTrackerBase { } } else if (met) { apnContext.setReason(Phone.REASON_DATA_DISABLED); // 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. // // This doesn't apply to DUN, however. Those connections have special // requirements from carriers and we need stop using them when the dun // 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()) { cleanup = true; } else { cleanup = false; } } else { apnContext.setReason(Phone.REASON_DATA_DEPENDENCY_UNMET); } Loading src/java/com/android/internal/telephony/dataconnection/DcTrackerBase.java +1 −0 Original line number Diff line number Diff line Loading @@ -765,6 +765,7 @@ public abstract class DcTrackerBase extends Handler { protected abstract void onCleanUpConnection(boolean tearDown, int apnId, String reason); protected abstract void onCleanUpAllConnections(String cause); public abstract boolean isDataPossible(String apnType); public abstract boolean isOnDemandDataPossible(String apnType); protected abstract boolean onUpdateIcc(); protected abstract void completeConnection(ApnContext apnContext); public abstract void setDataAllowed(boolean enable, Message response); Loading Loading
src/java/com/android/internal/telephony/Phone.java +5 −0 Original line number Diff line number Diff line Loading @@ -1447,6 +1447,11 @@ public interface Phone { */ boolean isDataConnectivityPossible(); /** * Report on whether on-demand data connectivity is allowed. */ boolean isOnDemandDataPossible(String apnType); /** * Report on whether data connectivity is allowed for an APN. */ Loading
src/java/com/android/internal/telephony/PhoneBase.java +6 −0 Original line number Diff line number Diff line Loading @@ -1747,6 +1747,12 @@ public abstract class PhoneBase extends Handler implements Phone { return isDataConnectivityPossible(PhoneConstants.APN_TYPE_DEFAULT); } @Override public boolean isOnDemandDataPossible(String apnType) { return ((mDcTracker != null) && (mDcTracker.isOnDemandDataPossible(apnType))); } @Override public boolean isDataConnectivityPossible(String apnType) { return ((mDcTracker != null) && Loading
src/java/com/android/internal/telephony/PhoneProxy.java +5 −0 Original line number Diff line number Diff line Loading @@ -1014,6 +1014,11 @@ public class PhoneProxy extends Handler implements Phone { return mActivePhone.isDataConnectivityPossible(PhoneConstants.APN_TYPE_DEFAULT); } @Override public boolean isOnDemandDataPossible(String apnType) { return mActivePhone.isOnDemandDataPossible(apnType); } @Override public boolean isDataConnectivityPossible(String apnType) { return mActivePhone.isDataConnectivityPossible(apnType); Loading
src/java/com/android/internal/telephony/dataconnection/DcTracker.java +35 −14 Original line number Diff line number Diff line Loading @@ -743,6 +743,40 @@ public final class DcTracker extends DcTrackerBase { return (apnContext.getDcAc() != null); } @Override public boolean isOnDemandDataPossible(String apnType) { /* * Check if APN enabled * Check if MobileData is ON * Check if MobileData UI override present */ boolean flag = false; ApnContext apnContext = mApnContexts.get(apnType); if (apnContext == null) { return false; } boolean apnContextIsEnabled = apnContext.isEnabled(); DctConstants.State apnContextState = apnContext.getState(); boolean apnTypePossible = !(apnContextIsEnabled && (apnContextState == DctConstants.State.FAILED)); boolean userDataEnabled = mUserDataEnabled; if (PhoneConstants.APN_TYPE_MMS.equals(apnType)) { boolean mobileDataOffOveride = mPhone.getContext().getResources(). getBoolean(com.android.internal.R.bool.config_enable_mms_with_mobile_data_off); log("isOnDemandDataPossible MobileDataEnabled override = " + mobileDataOffOveride); userDataEnabled = (mUserDataEnabled || mobileDataOffOveride); } flag = apnTypePossible && userDataEnabled; log("isOnDemandDataPossible, possible =" + flag + ", apnContext = " + apnContext); return flag; } @Override public boolean isDataPossible(String apnType) { ApnContext apnContext = mApnContexts.get(apnType); Loading Loading @@ -2005,20 +2039,7 @@ public final class DcTracker extends DcTrackerBase { } } else if (met) { apnContext.setReason(Phone.REASON_DATA_DISABLED); // 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. // // This doesn't apply to DUN, however. Those connections have special // requirements from carriers and we need stop using them when the dun // 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()) { cleanup = true; } else { cleanup = false; } } else { apnContext.setReason(Phone.REASON_DATA_DEPENDENCY_UNMET); } Loading
src/java/com/android/internal/telephony/dataconnection/DcTrackerBase.java +1 −0 Original line number Diff line number Diff line Loading @@ -765,6 +765,7 @@ public abstract class DcTrackerBase extends Handler { protected abstract void onCleanUpConnection(boolean tearDown, int apnId, String reason); protected abstract void onCleanUpAllConnections(String cause); public abstract boolean isDataPossible(String apnType); public abstract boolean isOnDemandDataPossible(String apnType); protected abstract boolean onUpdateIcc(); protected abstract void completeConnection(ApnContext apnContext); public abstract void setDataAllowed(boolean enable, Message response); Loading