diff options
author | 2025-03-12 19:15:08 -0700 | |
---|---|---|
committer | 2025-03-12 19:15:08 -0700 | |
commit | 44383b8cfd8c1af401b90f01211ec3fcd10a9507 (patch) | |
tree | 03f3c53836ba80f2f899e8a3c8a47710c5379151 /src | |
parent | 996730611b89e2c771eee61b3fde9e8afc817ca7 (diff) | |
parent | 73f88f7b6e5399575ac39bcf9296c71a4e78fc73 (diff) |
Merge "Avoid PDN Tear down at Out of service scenario" into main
Diffstat (limited to 'src')
-rw-r--r-- | src/java/com/android/internal/telephony/data/DataNetworkController.java | 60 |
1 files changed, 40 insertions, 20 deletions
diff --git a/src/java/com/android/internal/telephony/data/DataNetworkController.java b/src/java/com/android/internal/telephony/data/DataNetworkController.java index 00612f74bd..6b916f2c7a 100644 --- a/src/java/com/android/internal/telephony/data/DataNetworkController.java +++ b/src/java/com/android/internal/telephony/data/DataNetworkController.java @@ -1640,8 +1640,14 @@ public class DataNetworkController extends Handler { evaluation.addDataDisallowedReason(DataDisallowedReason.DATA_CONFIG_NOT_READY); } - if (mFeatureFlags.dataServiceCheck() && !isDataServiceSupported(transport)) { - evaluation.addDataDisallowedReason(DataDisallowedReason.SERVICE_OPTION_NOT_SUPPORTED); + if (mFeatureFlags.dataServiceCheck()) { + NetworkRegistrationInfo nri = mServiceState.getNetworkRegistrationInfo( + NetworkRegistrationInfo.DOMAIN_PS, transport); + if (nri != null && !nri.getAvailableServices().contains( + NetworkRegistrationInfo.SERVICE_TYPE_DATA)) { + evaluation.addDataDisallowedReason( + DataDisallowedReason.SERVICE_OPTION_NOT_SUPPORTED); + } } // Check CS call state and see if concurrent voice/data is allowed. @@ -1977,9 +1983,14 @@ public class DataNetworkController extends Handler { evaluation.addDataDisallowedReason(DataDisallowedReason.CDMA_EMERGENCY_CALLBACK_MODE); } - if (mFeatureFlags.dataServiceCheck() - && !isDataServiceSupported(dataNetwork.getTransport())) { - evaluation.addDataDisallowedReason(DataDisallowedReason.SERVICE_OPTION_NOT_SUPPORTED); + if (mFeatureFlags.dataServiceCheck()) { + NetworkRegistrationInfo nri = mServiceState.getNetworkRegistrationInfo( + NetworkRegistrationInfo.DOMAIN_PS, dataNetwork.getTransport()); + if (nri != null && nri.isInService() && !nri.getAvailableServices().contains( + NetworkRegistrationInfo.SERVICE_TYPE_DATA)) { + evaluation.addDataDisallowedReason( + DataDisallowedReason.SERVICE_OPTION_NOT_SUPPORTED); + } } // If the network is satellite, then the network must be restricted. @@ -2177,21 +2188,6 @@ public class DataNetworkController extends Handler { } /** - * Check if the available services support data service. - * {@link NetworkRegistrationInfo#SERVICE_TYPE_DATA} service or not. - * - * @param transport The preferred transport type for the request. The transport here is - * WWAN/WLAN. - * @return {@code true} if data services is supported, otherwise {@code false}. - */ - private boolean isDataServiceSupported(@TransportType int transport) { - NetworkRegistrationInfo nri = mServiceState.getNetworkRegistrationInfo( - NetworkRegistrationInfo.DOMAIN_PS, transport); - return nri != null && nri.getAvailableServices().contains( - NetworkRegistrationInfo.SERVICE_TYPE_DATA); - } - - /** * Check if the transport from connectivity service can satisfy the network request. Note the * transport here is connectivity service's transport (Wifi, cellular, satellite, etc..), not * the widely used {@link AccessNetworkConstants#TRANSPORT_TYPE_WLAN WLAN}, @@ -3803,6 +3799,22 @@ public class DataNetworkController extends Handler { } /** + * Check if network available services list is changed + * + * @param oldNri Previous network registration info. + * @param newNri Current network registration info. + * @return {@code true} if available services list is changed else return false + */ + private boolean areNetworkAvailableServicesChanged(@NonNull NetworkRegistrationInfo oldNri, + @NonNull NetworkRegistrationInfo newNri) { + List<Integer> oldAvailableServicesList = oldNri.getAvailableServices(); + List<Integer> newAvailableServicesList = newNri.getAvailableServices(); + + return !(oldAvailableServicesList.size() == newAvailableServicesList.size() + && oldAvailableServicesList.stream().allMatch(newAvailableServicesList::contains)); + } + + /** * Check if needed to re-evaluate the existing data networks. * * @param oldNri Previous network registration info. @@ -3818,6 +3830,10 @@ public class DataNetworkController extends Handler { return false; } + if (areNetworkAvailableServicesChanged(oldNri, newNri)) { + return true; + } + if (oldNri.getAccessNetworkTechnology() != newNri.getAccessNetworkTechnology() // Some CarrierConfig disallows vops in nonVops area for specified home/roaming. || (oldNri.isRoaming() != newNri.isRoaming())) { @@ -3863,6 +3879,10 @@ public class DataNetworkController extends Handler { return false; } + if (areNetworkAvailableServicesChanged(oldPsNri, newPsNri)) { + return true; + } + if (oldPsNri == null || oldPsNri.getAccessNetworkTechnology() != newPsNri.getAccessNetworkTechnology() || (!oldPsNri.isInService() && newPsNri.isInService()) |