Loading src/java/com/android/internal/telephony/DeviceStateMonitor.java +21 −10 Original line number Diff line number Diff line Loading @@ -757,24 +757,35 @@ public class DeviceStateMonitor extends Handler { /** * Downlink reporting thresholds in kbps * * <p>Threshold values taken from FCC Speed Guide * <p>Threshold values taken from FCC Speed Guide when available * (https://www.fcc.gov/reports-research/guides/broadband-speed-guide) and Android WiFi speed * labels (https://support.google.com/pixelphone/answer/2819519#strength_speed). * */ private static final int[] LINK_CAPACITY_DOWNLINK_THRESHOLDS = new int[] { 100, // VoIP 500, // Web browsing 1000, // SD video streaming 5000, // HD video streaming 10000, // file downloading 20000, // 4K video streaming 50000, // LTE-Advanced speeds 100000, 200000, // 5G speeds 500000, 1000000 }; /** Uplink reporting thresholds in kbps */ private static final int[] LINK_CAPACITY_UPLINK_THRESHOLDS = new int[] { 100, // VoIP calls 500, 1000, 5000, 10000, 1000, // SD video calling 5000, // HD video calling 10000, // file uploading 20000, // 4K video calling 50000, 100000, 200000 }; } src/java/com/android/internal/telephony/SubscriptionInfoUpdater.java +0 −16 Original line number Diff line number Diff line Loading @@ -446,22 +446,6 @@ public class SubscriptionInfoUpdater extends Handler { SubscriptionController.getInstance().setAssociatedPlmns(ehplmns, hplmns, subId); } SubscriptionInfo subInfo = mSubscriptionManager.getActiveSubscriptionInfo(subId); String nameToSet; String simCarrierName = tm.getSimOperatorName(subId); if (subInfo != null && subInfo.getNameSource() != SubscriptionManager.NAME_SOURCE_USER_INPUT) { if (!TextUtils.isEmpty(simCarrierName)) { nameToSet = simCarrierName; } else { nameToSet = "CARD " + Integer.toString(slotId + 1); } logd("sim name = " + nameToSet); SubscriptionController.getInstance().setDisplayNameUsingSrc(nameToSet, subId, SubscriptionManager.NAME_SOURCE_DEFAULT_SOURCE); } /* Update preferred network type and network selection mode on SIM change. * Storing last subId in SharedPreference for now to detect SIM change. */ 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 tests/telephonytests/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ android_test { "mockito-target-minus-junit4", "platform-test-annotations", "services.core", "services.net", "telephony-common", "truth-prebuilt", ], Loading Loading
src/java/com/android/internal/telephony/DeviceStateMonitor.java +21 −10 Original line number Diff line number Diff line Loading @@ -757,24 +757,35 @@ public class DeviceStateMonitor extends Handler { /** * Downlink reporting thresholds in kbps * * <p>Threshold values taken from FCC Speed Guide * <p>Threshold values taken from FCC Speed Guide when available * (https://www.fcc.gov/reports-research/guides/broadband-speed-guide) and Android WiFi speed * labels (https://support.google.com/pixelphone/answer/2819519#strength_speed). * */ private static final int[] LINK_CAPACITY_DOWNLINK_THRESHOLDS = new int[] { 100, // VoIP 500, // Web browsing 1000, // SD video streaming 5000, // HD video streaming 10000, // file downloading 20000, // 4K video streaming 50000, // LTE-Advanced speeds 100000, 200000, // 5G speeds 500000, 1000000 }; /** Uplink reporting thresholds in kbps */ private static final int[] LINK_CAPACITY_UPLINK_THRESHOLDS = new int[] { 100, // VoIP calls 500, 1000, 5000, 10000, 1000, // SD video calling 5000, // HD video calling 10000, // file uploading 20000, // 4K video calling 50000, 100000, 200000 }; }
src/java/com/android/internal/telephony/SubscriptionInfoUpdater.java +0 −16 Original line number Diff line number Diff line Loading @@ -446,22 +446,6 @@ public class SubscriptionInfoUpdater extends Handler { SubscriptionController.getInstance().setAssociatedPlmns(ehplmns, hplmns, subId); } SubscriptionInfo subInfo = mSubscriptionManager.getActiveSubscriptionInfo(subId); String nameToSet; String simCarrierName = tm.getSimOperatorName(subId); if (subInfo != null && subInfo.getNameSource() != SubscriptionManager.NAME_SOURCE_USER_INPUT) { if (!TextUtils.isEmpty(simCarrierName)) { nameToSet = simCarrierName; } else { nameToSet = "CARD " + Integer.toString(slotId + 1); } logd("sim name = " + nameToSet); SubscriptionController.getInstance().setDisplayNameUsingSrc(nameToSet, subId, SubscriptionManager.NAME_SOURCE_DEFAULT_SOURCE); } /* Update preferred network type and network selection mode on SIM change. * Storing last subId in SharedPreference for now to detect SIM change. */ 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
tests/telephonytests/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ android_test { "mockito-target-minus-junit4", "platform-test-annotations", "services.core", "services.net", "telephony-common", "truth-prebuilt", ], Loading