Loading src/java/com/android/internal/telephony/dataconnection/DataConnection.java +2 −1 Original line number Diff line number Diff line Loading @@ -1127,7 +1127,8 @@ public class DataConnection extends StateMachine { // unmetered. for (ApnContext apnContext : mApnContexts.keySet()) { DataConnectionReasons dataConnectionReasons = new DataConnectionReasons(); boolean isDataAllowed = mDct.isDataAllowed(apnContext, dataConnectionReasons); boolean isDataAllowed = mDct.isDataAllowed(apnContext, DcTracker.REQUEST_TYPE_NORMAL, dataConnectionReasons); if (!isDataAllowed || !dataConnectionReasons.contains( DataConnectionReasons.DataAllowedReasonType.UNMETERED_APN)) { return false; Loading src/java/com/android/internal/telephony/dataconnection/DcTracker.java +6 −5 Original line number Diff line number Diff line Loading @@ -1221,7 +1221,7 @@ public class DcTracker extends Handler { * @return True if data connection is allowed, otherwise false. */ public boolean isDataAllowed(DataConnectionReasons dataConnectionReasons) { return isDataAllowed(null, dataConnectionReasons); return isDataAllowed(null, REQUEST_TYPE_NORMAL, dataConnectionReasons); } /** Loading @@ -1229,12 +1229,13 @@ public class DcTracker extends Handler { * * @param apnContext APN context. If passing null, then will only check general but not APN * specific conditions (e.g. APN state, metered/unmetered APN). * @param requestType Setup data request type. * @param dataConnectionReasons Data connection allowed or disallowed reasons as the output * param. It's okay to pass null here and no reasons will be * provided. * @return True if data connection is allowed, otherwise false. */ public boolean isDataAllowed(ApnContext apnContext, public boolean isDataAllowed(ApnContext apnContext, @RequestNetworkType int requestType, DataConnectionReasons dataConnectionReasons) { // Step 1: Get all environment conditions. // Step 2: Special handling for emergency APN. Loading Loading @@ -1305,7 +1306,7 @@ public class DcTracker extends Handler { reasons.add(DataDisallowedReasonType.IN_ECBM); } if (!(attachedState || mAutoAttachEnabled.get())) { if (!attachedState && !mAutoAttachEnabled.get() && requestType != REQUEST_TYPE_HANDOVER) { reasons.add(DataDisallowedReasonType.NOT_ATTACHED); } if (!recordsLoaded) { Loading Loading @@ -1453,7 +1454,7 @@ public class DcTracker extends Handler { } DataConnectionReasons dataConnectionReasons = new DataConnectionReasons(); boolean isDataAllowed = isDataAllowed(apnContext, dataConnectionReasons); boolean isDataAllowed = isDataAllowed(apnContext, requestType, dataConnectionReasons); String logStr = "trySetupData for APN type " + apnContext.getApnType() + ", reason: " + apnContext.getReason() + ", requestType=" + requestTypeToString(requestType) + ". " + dataConnectionReasons.toString(); Loading Loading @@ -4288,7 +4289,7 @@ public class DcTracker extends Handler { final ApnContext apnContext = mApnContextsByType.get(apnType); if (apnContext == null) return; if (isDataAllowed(apnContext, null)) { if (isDataAllowed(apnContext, REQUEST_TYPE_NORMAL, null)) { if (apnContext.getDataConnection() != null) { apnContext.getDataConnection().reevaluateRestrictedState(); } Loading Loading
src/java/com/android/internal/telephony/dataconnection/DataConnection.java +2 −1 Original line number Diff line number Diff line Loading @@ -1127,7 +1127,8 @@ public class DataConnection extends StateMachine { // unmetered. for (ApnContext apnContext : mApnContexts.keySet()) { DataConnectionReasons dataConnectionReasons = new DataConnectionReasons(); boolean isDataAllowed = mDct.isDataAllowed(apnContext, dataConnectionReasons); boolean isDataAllowed = mDct.isDataAllowed(apnContext, DcTracker.REQUEST_TYPE_NORMAL, dataConnectionReasons); if (!isDataAllowed || !dataConnectionReasons.contains( DataConnectionReasons.DataAllowedReasonType.UNMETERED_APN)) { return false; Loading
src/java/com/android/internal/telephony/dataconnection/DcTracker.java +6 −5 Original line number Diff line number Diff line Loading @@ -1221,7 +1221,7 @@ public class DcTracker extends Handler { * @return True if data connection is allowed, otherwise false. */ public boolean isDataAllowed(DataConnectionReasons dataConnectionReasons) { return isDataAllowed(null, dataConnectionReasons); return isDataAllowed(null, REQUEST_TYPE_NORMAL, dataConnectionReasons); } /** Loading @@ -1229,12 +1229,13 @@ public class DcTracker extends Handler { * * @param apnContext APN context. If passing null, then will only check general but not APN * specific conditions (e.g. APN state, metered/unmetered APN). * @param requestType Setup data request type. * @param dataConnectionReasons Data connection allowed or disallowed reasons as the output * param. It's okay to pass null here and no reasons will be * provided. * @return True if data connection is allowed, otherwise false. */ public boolean isDataAllowed(ApnContext apnContext, public boolean isDataAllowed(ApnContext apnContext, @RequestNetworkType int requestType, DataConnectionReasons dataConnectionReasons) { // Step 1: Get all environment conditions. // Step 2: Special handling for emergency APN. Loading Loading @@ -1305,7 +1306,7 @@ public class DcTracker extends Handler { reasons.add(DataDisallowedReasonType.IN_ECBM); } if (!(attachedState || mAutoAttachEnabled.get())) { if (!attachedState && !mAutoAttachEnabled.get() && requestType != REQUEST_TYPE_HANDOVER) { reasons.add(DataDisallowedReasonType.NOT_ATTACHED); } if (!recordsLoaded) { Loading Loading @@ -1453,7 +1454,7 @@ public class DcTracker extends Handler { } DataConnectionReasons dataConnectionReasons = new DataConnectionReasons(); boolean isDataAllowed = isDataAllowed(apnContext, dataConnectionReasons); boolean isDataAllowed = isDataAllowed(apnContext, requestType, dataConnectionReasons); String logStr = "trySetupData for APN type " + apnContext.getApnType() + ", reason: " + apnContext.getReason() + ", requestType=" + requestTypeToString(requestType) + ". " + dataConnectionReasons.toString(); Loading Loading @@ -4288,7 +4289,7 @@ public class DcTracker extends Handler { final ApnContext apnContext = mApnContextsByType.get(apnType); if (apnContext == null) return; if (isDataAllowed(apnContext, null)) { if (isDataAllowed(apnContext, REQUEST_TYPE_NORMAL, null)) { if (apnContext.getDataConnection() != null) { apnContext.getDataConnection().reevaluateRestrictedState(); } Loading