Loading flags/data.aconfig +11 −0 Original line number Diff line number Diff line Loading @@ -117,3 +117,14 @@ flag { purpose: PURPOSE_BUGFIX } } # OWNER=nagendranb TARGET=25Q2 flag { name: "data_service_check" namespace: "telephony" description: "Support data service check based on nri available services." bug:"381338283" metadata { purpose: PURPOSE_BUGFIX } } src/java/com/android/internal/telephony/data/DataNetwork.java +11 −1 Original line number Diff line number Diff line Loading @@ -105,6 +105,7 @@ import com.android.internal.telephony.flags.FeatureFlags; import com.android.internal.telephony.metrics.DataCallSessionStats; import com.android.internal.telephony.metrics.DataNetworkValidationStats; import com.android.internal.telephony.metrics.TelephonyMetrics; import com.android.internal.telephony.satellite.SatelliteController; import com.android.internal.util.ArrayUtils; import com.android.internal.util.FunctionalUtils; import com.android.internal.util.IState; Loading Loading @@ -2559,7 +2560,16 @@ public class DataNetwork extends StateMachine { // Configure the network as restricted/constrained for unrestricted satellite network. if (mFlags.satelliteInternet() && mIsSatellite && builder.build() .hasCapability(NetworkCapabilities.NET_CAPABILITY_NOT_RESTRICTED)) { switch (mDataConfigManager.getSatelliteDataSupportMode()) { int dataPolicy; if (mFlags.dataServiceCheck()) { final SatelliteController satelliteController = SatelliteController.getInstance(); dataPolicy = satelliteController.getSatelliteDataServicePolicyForPlmn(mSubId, mPhone.getServiceState().getOperatorNumeric()); } else { dataPolicy = mDataConfigManager.getSatelliteDataSupportMode(); } switch (dataPolicy) { case CarrierConfigManager.SATELLITE_DATA_SUPPORT_ONLY_RESTRICTED -> builder.removeCapability( NetworkCapabilities.NET_CAPABILITY_NOT_RESTRICTED); Loading src/java/com/android/internal/telephony/data/DataNetworkController.java +38 −4 Original line number Diff line number Diff line Loading @@ -111,6 +111,7 @@ import com.android.internal.telephony.data.DataStallRecoveryManager.DataStallRec import com.android.internal.telephony.data.LinkBandwidthEstimator.LinkBandwidthEstimatorCallback; import com.android.internal.telephony.flags.FeatureFlags; import com.android.internal.telephony.ims.ImsResolver; import com.android.internal.telephony.satellite.SatelliteController; import com.android.internal.telephony.subscription.SubscriptionInfoInternal; import com.android.internal.telephony.subscription.SubscriptionManagerService; import com.android.internal.telephony.util.TelephonyUtils; Loading Loading @@ -1646,6 +1647,10 @@ public class DataNetworkController extends Handler { evaluation.addDataDisallowedReason(DataDisallowedReason.DATA_CONFIG_NOT_READY); } if (mFeatureFlags.dataServiceCheck() && !isDataServiceSupported(transport)) { evaluation.addDataDisallowedReason(DataDisallowedReason.SERVICE_OPTION_NOT_SUPPORTED); } // Check CS call state and see if concurrent voice/data is allowed. if (hasCalling() && mPhone.getCallTracker().getState() != PhoneConstants.State.IDLE && !mPhone.getServiceStateTracker().isConcurrentVoiceAndDataAllowed()) { Loading Loading @@ -1979,6 +1984,11 @@ 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 the network is satellite, then the network must be restricted. if (mFeatureFlags.satelliteInternet()) { // The IWLAN data network should remain intact even when satellite is connected. Loading Loading @@ -2175,6 +2185,21 @@ public class DataNetworkController extends Handler { return evaluation; } /** * 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 Loading @@ -2196,11 +2221,20 @@ public class DataNetworkController extends Handler { return true; } // When the device is on satellite, only restricted/constrained network request can request // network. // When the device is on satellite, allow network request without bandwidth not constrained // to enable data connection with constrained network. if (mServiceState.isUsingNonTerrestrialNetwork() && networkRequest.hasCapability( NetworkCapabilities.NET_CAPABILITY_NOT_RESTRICTED)) { switch (mDataConfigManager.getSatelliteDataSupportMode()) { int dataPolicy; if (mFeatureFlags.dataServiceCheck()) { final SatelliteController satelliteController = SatelliteController.getInstance(); dataPolicy = satelliteController.getSatelliteDataServicePolicyForPlmn(mSubId, mPhone.getServiceState().getOperatorNumeric()); } else { dataPolicy = mDataConfigManager.getSatelliteDataSupportMode(); } switch (dataPolicy) { case CarrierConfigManager.SATELLITE_DATA_SUPPORT_ONLY_RESTRICTED -> { return false; } Loading Loading @@ -2381,7 +2415,7 @@ public class DataNetworkController extends Handler { // Matching the rules by the configured order. Bail out if find first matching rule. for (HandoverRule rule : handoverRules) { // Check if the rule is only for roaming and we are not roaming. // Check if the rule is only for roaming and we are not aroaming. if (rule.isOnlyForRoaming && !isRoaming) { // If the rule is for roaming only, and the device is not roaming, then bypass // this rule. Loading src/java/com/android/internal/telephony/satellite/SatelliteController.java +22 −2 Original line number Diff line number Diff line Loading @@ -8709,10 +8709,25 @@ public class SatelliteController extends Handler { return SATELLITE_DATA_PLAN_METERED; } /** * Check if the available satellite services support * {@link NetworkRegistrationInfo#SERVICE_TYPE_DATA} service or not. * * @return {@code true} if data services is supported, otherwise {@code false}. */ private boolean isSatelliteDataServicesAllowed(int subId, String plmn) { // validate is available services support data, for satellite internet bringup List<Integer> availableServices = getSupportedSatelliteServicesForPlmn(subId, plmn); return availableServices.stream().anyMatch(num -> num == NetworkRegistrationInfo.SERVICE_TYPE_DATA); } /** * Method to return the current satellite data service policy supported mode for the registered * plmn based on entitlement provisioning information. Note: If no information at * provisioning is supported this is overridden with operator carrier config information. * provisioning is supported this is overridden with operator carrier config information * if available satellite services support data else data service policy is marked as * restricted. * * @param subId current subscription id * @param plmn current registered plmn information Loading @@ -8731,9 +8746,14 @@ public class SatelliteController extends Handler { return dataServicePolicy.get(plmn); } } } if (isSatelliteDataServicesAllowed(subId, plmn)) { return getCarrierSatelliteDataSupportedModeFromConfig(subId); } } return CarrierConfigManager.SATELLITE_DATA_SUPPORT_ONLY_RESTRICTED; } /** * Method to return the current satellite voice service policy supported mode for the registered Loading tests/telephonytests/src/com/android/internal/telephony/TelephonyTest.java +1 −0 Original line number Diff line number Diff line Loading @@ -583,6 +583,7 @@ public abstract class TelephonyTest { doReturn(true).when(mFeatureFlags).minimalTelephonyCdmCheck(); doReturn(true).when(mFeatureFlags).hsumBroadcast(); doReturn(true).when(mFeatureFlags).hsumPackageManager(); doReturn(true).when(mFeatureFlags).dataServiceCheck(); WorkerThread.reset(); TelephonyManager.disableServiceHandleCaching(); Loading Loading
flags/data.aconfig +11 −0 Original line number Diff line number Diff line Loading @@ -117,3 +117,14 @@ flag { purpose: PURPOSE_BUGFIX } } # OWNER=nagendranb TARGET=25Q2 flag { name: "data_service_check" namespace: "telephony" description: "Support data service check based on nri available services." bug:"381338283" metadata { purpose: PURPOSE_BUGFIX } }
src/java/com/android/internal/telephony/data/DataNetwork.java +11 −1 Original line number Diff line number Diff line Loading @@ -105,6 +105,7 @@ import com.android.internal.telephony.flags.FeatureFlags; import com.android.internal.telephony.metrics.DataCallSessionStats; import com.android.internal.telephony.metrics.DataNetworkValidationStats; import com.android.internal.telephony.metrics.TelephonyMetrics; import com.android.internal.telephony.satellite.SatelliteController; import com.android.internal.util.ArrayUtils; import com.android.internal.util.FunctionalUtils; import com.android.internal.util.IState; Loading Loading @@ -2559,7 +2560,16 @@ public class DataNetwork extends StateMachine { // Configure the network as restricted/constrained for unrestricted satellite network. if (mFlags.satelliteInternet() && mIsSatellite && builder.build() .hasCapability(NetworkCapabilities.NET_CAPABILITY_NOT_RESTRICTED)) { switch (mDataConfigManager.getSatelliteDataSupportMode()) { int dataPolicy; if (mFlags.dataServiceCheck()) { final SatelliteController satelliteController = SatelliteController.getInstance(); dataPolicy = satelliteController.getSatelliteDataServicePolicyForPlmn(mSubId, mPhone.getServiceState().getOperatorNumeric()); } else { dataPolicy = mDataConfigManager.getSatelliteDataSupportMode(); } switch (dataPolicy) { case CarrierConfigManager.SATELLITE_DATA_SUPPORT_ONLY_RESTRICTED -> builder.removeCapability( NetworkCapabilities.NET_CAPABILITY_NOT_RESTRICTED); Loading
src/java/com/android/internal/telephony/data/DataNetworkController.java +38 −4 Original line number Diff line number Diff line Loading @@ -111,6 +111,7 @@ import com.android.internal.telephony.data.DataStallRecoveryManager.DataStallRec import com.android.internal.telephony.data.LinkBandwidthEstimator.LinkBandwidthEstimatorCallback; import com.android.internal.telephony.flags.FeatureFlags; import com.android.internal.telephony.ims.ImsResolver; import com.android.internal.telephony.satellite.SatelliteController; import com.android.internal.telephony.subscription.SubscriptionInfoInternal; import com.android.internal.telephony.subscription.SubscriptionManagerService; import com.android.internal.telephony.util.TelephonyUtils; Loading Loading @@ -1646,6 +1647,10 @@ public class DataNetworkController extends Handler { evaluation.addDataDisallowedReason(DataDisallowedReason.DATA_CONFIG_NOT_READY); } if (mFeatureFlags.dataServiceCheck() && !isDataServiceSupported(transport)) { evaluation.addDataDisallowedReason(DataDisallowedReason.SERVICE_OPTION_NOT_SUPPORTED); } // Check CS call state and see if concurrent voice/data is allowed. if (hasCalling() && mPhone.getCallTracker().getState() != PhoneConstants.State.IDLE && !mPhone.getServiceStateTracker().isConcurrentVoiceAndDataAllowed()) { Loading Loading @@ -1979,6 +1984,11 @@ 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 the network is satellite, then the network must be restricted. if (mFeatureFlags.satelliteInternet()) { // The IWLAN data network should remain intact even when satellite is connected. Loading Loading @@ -2175,6 +2185,21 @@ public class DataNetworkController extends Handler { return evaluation; } /** * 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 Loading @@ -2196,11 +2221,20 @@ public class DataNetworkController extends Handler { return true; } // When the device is on satellite, only restricted/constrained network request can request // network. // When the device is on satellite, allow network request without bandwidth not constrained // to enable data connection with constrained network. if (mServiceState.isUsingNonTerrestrialNetwork() && networkRequest.hasCapability( NetworkCapabilities.NET_CAPABILITY_NOT_RESTRICTED)) { switch (mDataConfigManager.getSatelliteDataSupportMode()) { int dataPolicy; if (mFeatureFlags.dataServiceCheck()) { final SatelliteController satelliteController = SatelliteController.getInstance(); dataPolicy = satelliteController.getSatelliteDataServicePolicyForPlmn(mSubId, mPhone.getServiceState().getOperatorNumeric()); } else { dataPolicy = mDataConfigManager.getSatelliteDataSupportMode(); } switch (dataPolicy) { case CarrierConfigManager.SATELLITE_DATA_SUPPORT_ONLY_RESTRICTED -> { return false; } Loading Loading @@ -2381,7 +2415,7 @@ public class DataNetworkController extends Handler { // Matching the rules by the configured order. Bail out if find first matching rule. for (HandoverRule rule : handoverRules) { // Check if the rule is only for roaming and we are not roaming. // Check if the rule is only for roaming and we are not aroaming. if (rule.isOnlyForRoaming && !isRoaming) { // If the rule is for roaming only, and the device is not roaming, then bypass // this rule. Loading
src/java/com/android/internal/telephony/satellite/SatelliteController.java +22 −2 Original line number Diff line number Diff line Loading @@ -8709,10 +8709,25 @@ public class SatelliteController extends Handler { return SATELLITE_DATA_PLAN_METERED; } /** * Check if the available satellite services support * {@link NetworkRegistrationInfo#SERVICE_TYPE_DATA} service or not. * * @return {@code true} if data services is supported, otherwise {@code false}. */ private boolean isSatelliteDataServicesAllowed(int subId, String plmn) { // validate is available services support data, for satellite internet bringup List<Integer> availableServices = getSupportedSatelliteServicesForPlmn(subId, plmn); return availableServices.stream().anyMatch(num -> num == NetworkRegistrationInfo.SERVICE_TYPE_DATA); } /** * Method to return the current satellite data service policy supported mode for the registered * plmn based on entitlement provisioning information. Note: If no information at * provisioning is supported this is overridden with operator carrier config information. * provisioning is supported this is overridden with operator carrier config information * if available satellite services support data else data service policy is marked as * restricted. * * @param subId current subscription id * @param plmn current registered plmn information Loading @@ -8731,9 +8746,14 @@ public class SatelliteController extends Handler { return dataServicePolicy.get(plmn); } } } if (isSatelliteDataServicesAllowed(subId, plmn)) { return getCarrierSatelliteDataSupportedModeFromConfig(subId); } } return CarrierConfigManager.SATELLITE_DATA_SUPPORT_ONLY_RESTRICTED; } /** * Method to return the current satellite voice service policy supported mode for the registered Loading
tests/telephonytests/src/com/android/internal/telephony/TelephonyTest.java +1 −0 Original line number Diff line number Diff line Loading @@ -583,6 +583,7 @@ public abstract class TelephonyTest { doReturn(true).when(mFeatureFlags).minimalTelephonyCdmCheck(); doReturn(true).when(mFeatureFlags).hsumBroadcast(); doReturn(true).when(mFeatureFlags).hsumPackageManager(); doReturn(true).when(mFeatureFlags).dataServiceCheck(); WorkerThread.reset(); TelephonyManager.disableServiceHandleCaching(); Loading