Loading src/java/com/android/internal/telephony/satellite/SatelliteController.java +17 −5 Original line number Diff line number Diff line Loading @@ -9221,11 +9221,14 @@ public class SatelliteController extends Handler { if (isValidSubscriptionId(subId)) { Map<String, Integer> dataServicePolicy; synchronized (mSupportedSatelliteServicesLock) { dataServicePolicy = mEntitlementDataServicePolicyMapPerCarrier.get(subId); dataServicePolicy = getConfigForSubId(subId).getBoolean( KEY_SATELLITE_ENTITLEMENT_SUPPORTED_BOOL, false) ? mEntitlementDataServicePolicyMapPerCarrier.get(subId) : null; } plogd("getSatelliteDataServicePolicyForPlmn: dataServicePolicy=" + dataServicePolicy); if (dataServicePolicy != null) { if (dataServicePolicy != null && !dataServicePolicy.isEmpty()) { if (!TextUtils.isEmpty(plmn) && dataServicePolicy.containsKey(plmn)) { plogd("getSatelliteDataServicePolicyForPlmn: " + "return policy using dataServicePolicy map"); Loading @@ -9240,11 +9243,20 @@ public class SatelliteController extends Handler { preferredPolicy = policy; } } // when invoked getSatelliteDataServicePolicyPlmn() with empty plmn and data // service policy not provisioned i.e.data service policy info is empty with // or without plmn key, then ignore setting preferred data supported mode policy // as restricted and fallback to carrier configured data supported mode for the // subscription id. if (preferredPolicy > CarrierConfigManager.SATELLITE_DATA_SUPPORT_ONLY_RESTRICTED) { plogd("getSatelliteDataServicePolicyForPlmn: " + "return preferredPolicy=" + preferredPolicy); return preferredPolicy; } } } if (isSatelliteDataServicesAllowed(subId, plmn)) { plogd("getSatelliteDataServicePolicyForPlmn: return data support mode from config"); Loading tests/telephonytests/src/com/android/internal/telephony/satellite/SatelliteControllerTest.java +41 −0 Original line number Diff line number Diff line Loading @@ -6591,6 +6591,8 @@ public class SatelliteControllerTest extends TelephonyTest { List<String> overlayConfigPlmnList = new ArrayList<>(); replaceInstance(SatelliteController.class, "mSatellitePlmnListFromOverlayConfig", mSatelliteControllerUT, overlayConfigPlmnList); // With Satellite entitlement support bool true with entitlement data service policy mCarrierConfigBundle.putBoolean( CarrierConfigManager.KEY_SATELLITE_ENTITLEMENT_SUPPORTED_BOOL, true); mCarrierConfigBundle.putBoolean(CarrierConfigManager.KEY_SATELLITE_ATTACH_SUPPORTED_BOOL, Loading Loading @@ -6624,6 +6626,45 @@ public class SatelliteControllerTest extends TelephonyTest { dataSupportModeForPlmn = mSatelliteControllerUT .getSatelliteDataServicePolicyForPlmn(SUB_ID, null); assertEquals(SATELLITE_DATA_SUPPORT_ALL, dataSupportModeForPlmn); // When satellite entitlement bool is false , validate the value is read from carrier // config, when data services is supported mCarrierConfigBundle.putBoolean( CarrierConfigManager.KEY_SATELLITE_ENTITLEMENT_SUPPORTED_BOOL, false); setConfigData(new ArrayList<>()); PersistableBundle carrierSupportedSatelliteServicesPerProvider = new PersistableBundle(); List<String> carrierConfigPlmnList = List.of("00101"); carrierSupportedSatelliteServicesPerProvider.putIntArray( carrierConfigPlmnList.get(0), new int[]{2, 3, 5}); mCarrierConfigBundle.putPersistableBundle(CarrierConfigManager .KEY_CARRIER_SUPPORTED_SATELLITE_SERVICES_PER_PROVIDER_BUNDLE, carrierSupportedSatelliteServicesPerProvider); mCarrierConfigBundle.putInt( CarrierConfigManager.KEY_SATELLITE_DATA_SUPPORT_MODE_INT, SATELLITE_DATA_SUPPORT_ALL); invokeCarrierConfigChanged(); // satellite data service policy for plmn is as per carrier config set when // satellite entitlement boolean is false with satellite entitlement data available dataSupportModeForPlmn = mSatelliteControllerUT .getSatelliteDataServicePolicyForPlmn(SUB_ID, "00101"); assertEquals(SATELLITE_DATA_SUPPORT_ALL, dataSupportModeForPlmn); // Empty data service policy map case, validate the value is read from carrier // config, when data services is supported dataServicePolicyMap = new HashMap<>(); mSatelliteControllerUT.onSatelliteEntitlementStatusUpdated(SUB_ID, true, entitlementPlmnList, barredPlmnList, new HashMap<>(), new HashMap<>(), dataServicePolicyMap, new HashMap<>(), mIIntegerConsumer); mCarrierConfigBundle.putInt( CarrierConfigManager.KEY_SATELLITE_DATA_SUPPORT_MODE_INT, SATELLITE_DATA_SUPPORT_BANDWIDTH_CONSTRAINED); // satellite data service policy is as per carrier config set when data entitlement // policy is empty dataSupportModeForPlmn = mSatelliteControllerUT .getSatelliteDataServicePolicyForPlmn(SUB_ID, "00101"); assertEquals(SATELLITE_DATA_SUPPORT_BANDWIDTH_CONSTRAINED, dataSupportModeForPlmn); } @Test Loading Loading
src/java/com/android/internal/telephony/satellite/SatelliteController.java +17 −5 Original line number Diff line number Diff line Loading @@ -9221,11 +9221,14 @@ public class SatelliteController extends Handler { if (isValidSubscriptionId(subId)) { Map<String, Integer> dataServicePolicy; synchronized (mSupportedSatelliteServicesLock) { dataServicePolicy = mEntitlementDataServicePolicyMapPerCarrier.get(subId); dataServicePolicy = getConfigForSubId(subId).getBoolean( KEY_SATELLITE_ENTITLEMENT_SUPPORTED_BOOL, false) ? mEntitlementDataServicePolicyMapPerCarrier.get(subId) : null; } plogd("getSatelliteDataServicePolicyForPlmn: dataServicePolicy=" + dataServicePolicy); if (dataServicePolicy != null) { if (dataServicePolicy != null && !dataServicePolicy.isEmpty()) { if (!TextUtils.isEmpty(plmn) && dataServicePolicy.containsKey(plmn)) { plogd("getSatelliteDataServicePolicyForPlmn: " + "return policy using dataServicePolicy map"); Loading @@ -9240,11 +9243,20 @@ public class SatelliteController extends Handler { preferredPolicy = policy; } } // when invoked getSatelliteDataServicePolicyPlmn() with empty plmn and data // service policy not provisioned i.e.data service policy info is empty with // or without plmn key, then ignore setting preferred data supported mode policy // as restricted and fallback to carrier configured data supported mode for the // subscription id. if (preferredPolicy > CarrierConfigManager.SATELLITE_DATA_SUPPORT_ONLY_RESTRICTED) { plogd("getSatelliteDataServicePolicyForPlmn: " + "return preferredPolicy=" + preferredPolicy); return preferredPolicy; } } } if (isSatelliteDataServicesAllowed(subId, plmn)) { plogd("getSatelliteDataServicePolicyForPlmn: return data support mode from config"); Loading
tests/telephonytests/src/com/android/internal/telephony/satellite/SatelliteControllerTest.java +41 −0 Original line number Diff line number Diff line Loading @@ -6591,6 +6591,8 @@ public class SatelliteControllerTest extends TelephonyTest { List<String> overlayConfigPlmnList = new ArrayList<>(); replaceInstance(SatelliteController.class, "mSatellitePlmnListFromOverlayConfig", mSatelliteControllerUT, overlayConfigPlmnList); // With Satellite entitlement support bool true with entitlement data service policy mCarrierConfigBundle.putBoolean( CarrierConfigManager.KEY_SATELLITE_ENTITLEMENT_SUPPORTED_BOOL, true); mCarrierConfigBundle.putBoolean(CarrierConfigManager.KEY_SATELLITE_ATTACH_SUPPORTED_BOOL, Loading Loading @@ -6624,6 +6626,45 @@ public class SatelliteControllerTest extends TelephonyTest { dataSupportModeForPlmn = mSatelliteControllerUT .getSatelliteDataServicePolicyForPlmn(SUB_ID, null); assertEquals(SATELLITE_DATA_SUPPORT_ALL, dataSupportModeForPlmn); // When satellite entitlement bool is false , validate the value is read from carrier // config, when data services is supported mCarrierConfigBundle.putBoolean( CarrierConfigManager.KEY_SATELLITE_ENTITLEMENT_SUPPORTED_BOOL, false); setConfigData(new ArrayList<>()); PersistableBundle carrierSupportedSatelliteServicesPerProvider = new PersistableBundle(); List<String> carrierConfigPlmnList = List.of("00101"); carrierSupportedSatelliteServicesPerProvider.putIntArray( carrierConfigPlmnList.get(0), new int[]{2, 3, 5}); mCarrierConfigBundle.putPersistableBundle(CarrierConfigManager .KEY_CARRIER_SUPPORTED_SATELLITE_SERVICES_PER_PROVIDER_BUNDLE, carrierSupportedSatelliteServicesPerProvider); mCarrierConfigBundle.putInt( CarrierConfigManager.KEY_SATELLITE_DATA_SUPPORT_MODE_INT, SATELLITE_DATA_SUPPORT_ALL); invokeCarrierConfigChanged(); // satellite data service policy for plmn is as per carrier config set when // satellite entitlement boolean is false with satellite entitlement data available dataSupportModeForPlmn = mSatelliteControllerUT .getSatelliteDataServicePolicyForPlmn(SUB_ID, "00101"); assertEquals(SATELLITE_DATA_SUPPORT_ALL, dataSupportModeForPlmn); // Empty data service policy map case, validate the value is read from carrier // config, when data services is supported dataServicePolicyMap = new HashMap<>(); mSatelliteControllerUT.onSatelliteEntitlementStatusUpdated(SUB_ID, true, entitlementPlmnList, barredPlmnList, new HashMap<>(), new HashMap<>(), dataServicePolicyMap, new HashMap<>(), mIIntegerConsumer); mCarrierConfigBundle.putInt( CarrierConfigManager.KEY_SATELLITE_DATA_SUPPORT_MODE_INT, SATELLITE_DATA_SUPPORT_BANDWIDTH_CONSTRAINED); // satellite data service policy is as per carrier config set when data entitlement // policy is empty dataSupportModeForPlmn = mSatelliteControllerUT .getSatelliteDataServicePolicyForPlmn(SUB_ID, "00101"); assertEquals(SATELLITE_DATA_SUPPORT_BANDWIDTH_CONSTRAINED, dataSupportModeForPlmn); } @Test Loading