diff options
author | 2025-03-18 18:16:16 -0700 | |
---|---|---|
committer | 2025-03-18 18:16:16 -0700 | |
commit | 4b2e942bbe3c67fed85711325c5dec8c501975f5 (patch) | |
tree | 01d409f57cbaffc0bebf50b1e8156e68d021e185 | |
parent | 6e8ea5395956e9374b17610d965362858ad54098 (diff) | |
parent | 69f71d053dd7cda7485f24935817fdfff544afdb (diff) |
Snap for 13235988 from 69f71d053dd7cda7485f24935817fdfff544afdb to 25Q2-release
Change-Id: I86a63aa6e4bfcfd9a55bd067f32ab0d18b21d14c
7 files changed, 262 insertions, 70 deletions
diff --git a/src/java/com/android/internal/telephony/Phone.java b/src/java/com/android/internal/telephony/Phone.java index a90addac6e..e136e5a0e4 100644 --- a/src/java/com/android/internal/telephony/Phone.java +++ b/src/java/com/android/internal/telephony/Phone.java @@ -5467,6 +5467,9 @@ public abstract class Phone extends Handler implements PhoneInternalInterface { public void setSatellitePlmn(int simSlot, @NonNull List<String> carrierPlmnList, @NonNull List<String> allSatellitePlmnList, Message result) { + logd("setSatellitePlmn: simSlot=" + simSlot + + " carrierPlmnList=" + carrierPlmnList.toString() + + " allSatellitePlmnList=" + allSatellitePlmnList.toString()); mCi.setSatellitePlmn(simSlot, carrierPlmnList, allSatellitePlmnList, result); } @@ -5480,6 +5483,8 @@ public abstract class Phone extends Handler implements PhoneInternalInterface { */ public void setSatelliteEnabledForCarrier(int simSlot, boolean satelliteEnabled, Message result) { + logd("setSatelliteEnabledForCarrier: simSlot=" + simSlot + + " satelliteEnabled=" + satelliteEnabled); mCi.setSatelliteEnabledForCarrier(simSlot, satelliteEnabled, result); } diff --git a/src/java/com/android/internal/telephony/configupdate/TelephonyConfigUpdateInstallReceiver.java b/src/java/com/android/internal/telephony/configupdate/TelephonyConfigUpdateInstallReceiver.java index 60afc799c8..8a34ec10cc 100644 --- a/src/java/com/android/internal/telephony/configupdate/TelephonyConfigUpdateInstallReceiver.java +++ b/src/java/com/android/internal/telephony/configupdate/TelephonyConfigUpdateInstallReceiver.java @@ -258,8 +258,6 @@ public class TelephonyConfigUpdateInstallReceiver extends ConfigUpdateInstallRec public ConfigParser getNewConfigParser(String domain, @Nullable byte[] data) { if (data == null) { Log.d(TAG, "content data is null"); - mConfigUpdaterMetricsStats.reportOemAndCarrierConfigError( - SatelliteConstants.CONFIG_UPDATE_RESULT_NO_DATA); return null; } switch (domain) { diff --git a/src/java/com/android/internal/telephony/satellite/SatelliteController.java b/src/java/com/android/internal/telephony/satellite/SatelliteController.java index be4308722f..f82c0c1db4 100644 --- a/src/java/com/android/internal/telephony/satellite/SatelliteController.java +++ b/src/java/com/android/internal/telephony/satellite/SatelliteController.java @@ -242,6 +242,8 @@ public class SatelliteController extends Handler { @VisibleForTesting(visibility = VisibleForTesting.Visibility.PRIVATE) public static final String NTN_SMS_SUPPORTED_BY_MESSAGES_APP_KEY = "ntn_sms_supported_by_messages_app_key"; + public static final String CARRIER_ROAMING_NTN_ALL_SATELLITE_PLMN_SET_KEY = + "carrier_roaming_ntn_all_satellite_plmn_set_key"; public static final long DEFAULT_CARRIER_EMERGENCY_CALL_WAIT_FOR_CONNECTION_TIMEOUT_MILLIS = TimeUnit.SECONDS.toMillis(30); @@ -319,6 +321,8 @@ public class SatelliteController extends Handler { private static final int CMD_LOCATION_SERVICE_STATE_CHANGED = 62; protected static final int EVENT_WAIT_FOR_UPDATE_SYSTEM_SELECTION_CHANNELS_RESPONSE_TIMED_OUT = 63; + private static final int CMD_GET_SATELLITE_ENABLED_FOR_CARRIER = 64; + private static final int EVENT_GET_SATELLITE_ENABLED_FOR_CARRIER_DONE = 65; @NonNull private static SatelliteController sInstance; @NonNull private final Context mContext; @@ -693,6 +697,10 @@ public class SatelliteController extends Handler { @GuardedBy("mNtnSmsSupportedByMessagesAppLock") private Boolean mNtnSmsSupportedByMessagesApp = null; + private final Object mCarrierRoamingNtnAllSatellitePlmnSetLock = new Object(); + @GuardedBy("mCarrierRoamingNtnAllSatellitePlmnSetLock") + private Set<String> mCarrierRoamingNtnAllSatellitePlmnSet = null; + private final Object mSatelliteModemStateLock = new Object(); @GuardedBy("mSatelliteModemStateLock") @SatelliteManager.SatelliteModemState @@ -979,9 +987,19 @@ public class SatelliteController extends Handler { loadSatelliteSharedPreferences(); if (mSharedPreferences != null) { - synchronized (mNtnSmsSupportedByMessagesAppLock) { - mNtnSmsSupportedByMessagesApp = mSharedPreferences.getBoolean( - NTN_SMS_SUPPORTED_BY_MESSAGES_APP_KEY, false); + try { + synchronized (mNtnSmsSupportedByMessagesAppLock) { + mNtnSmsSupportedByMessagesApp = mSharedPreferences.getBoolean( + NTN_SMS_SUPPORTED_BY_MESSAGES_APP_KEY, false); + } + + synchronized (mCarrierRoamingNtnAllSatellitePlmnSetLock) { + mCarrierRoamingNtnAllSatellitePlmnSet = mSharedPreferences.getStringSet( + CARRIER_ROAMING_NTN_ALL_SATELLITE_PLMN_SET_KEY, new HashSet<>()); + } + } catch (Exception ex) { + plogd("SatelliteController constructor: " + + "cannot get default shared preferences. e" + ex); } } @@ -1012,6 +1030,11 @@ public class SatelliteController extends Handler { mSatelliteOptimizedApplicationsTracker = new SatelliteOptimizedApplicationsTracker( getLooper(), mContext ); + + for (Phone phoneToSendRequest : PhoneFactory.getPhones()) { + sendRequestAsync(CMD_GET_SATELLITE_ENABLED_FOR_CARRIER, null, phoneToSendRequest); + } + logd("Satellite Tracker is created"); } @@ -1895,10 +1918,14 @@ public class SatelliteController extends Handler { int error = SatelliteServiceUtils.getSatelliteError(ar, "requestSetSatelliteEnabledForCarrier"); + plogd("EVENT_EVALUATE_SATELLITE_ATTACH_RESTRICTION_CHANGE_DONE: subId=" + + subId + " error:" + error); synchronized (mIsSatelliteEnabledLock) { if (error == SATELLITE_RESULT_SUCCESS) { boolean enableSatellite = mSatelliteAttachRestrictionForCarrierArray .getOrDefault(argument.subId, Collections.emptySet()).isEmpty(); + plogd("EVENT_EVALUATE_SATELLITE_ATTACH_RESTRICTION_CHANGE_DONE: " + + "satelliteAttachEnabledForCarrier=" + enableSatellite); mIsSatelliteAttachEnabledForCarrierArrayPerSub.put(subId, enableSatellite); } else { mIsSatelliteAttachEnabledForCarrierArrayPerSub.remove(subId); @@ -2253,6 +2280,43 @@ public class SatelliteController extends Handler { break; } + case CMD_GET_SATELLITE_ENABLED_FOR_CARRIER: { + request = (SatelliteControllerHandlerRequest) msg.obj; + Phone phone = request.phone; + int subId = phone.getSubId(); + onCompleted = obtainMessage(EVENT_GET_SATELLITE_ENABLED_FOR_CARRIER_DONE, + subId); + int simSlot = SubscriptionManager.getSlotIndex(subId); + plogd("CMD_GET_SATELLITE_ENABLED_FOR_CARRIER: subId=" + subId); + phone.isSatelliteEnabledForCarrier(simSlot, onCompleted); + break; + } + + case EVENT_GET_SATELLITE_ENABLED_FOR_CARRIER_DONE: { + ar = (AsyncResult) msg.obj; + + if (ar.result == null) { + loge("EVENT_GET_SATELLITE_ENABLED_FOR_CARRIER_DONE: result is null"); + } else { + int subId = (int) ar.userObj; + int error = SatelliteServiceUtils.getSatelliteError( + ar, "isSatelliteEnabledForCarrier"); + boolean satelliteEnabled = (boolean) ar.result; + plogd("EVENT_GET_SATELLITE_ENABLED_FOR_CARRIER_DONE: subId=" + subId + + " error=" + error + " satelliteEnabled=" + satelliteEnabled); + + if (error == SATELLITE_RESULT_SUCCESS) { + synchronized (mIsSatelliteEnabledLock) { + mIsSatelliteAttachEnabledForCarrierArrayPerSub.put( + subId, satelliteEnabled); + } + evaluateEnablingSatelliteForCarrier(subId, + SATELLITE_COMMUNICATION_RESTRICTION_REASON_USER, null); + } + } + break; + } + default: Log.w(TAG, "SatelliteControllerHandler: unexpected message code: " + msg.what); @@ -3836,9 +3900,7 @@ public class SatelliteController extends Handler { return new ArrayList<>(); } - synchronized (mSupportedSatelliteServicesLock) { - return mMergedPlmnListPerCarrier.get(subId, new ArrayList<>()).stream().toList(); - } + return getCarrierPlmnList(subId); } /** @@ -3893,25 +3955,28 @@ public class SatelliteController extends Handler { * @return The list of services supported by the carrier associated with the */ private List<Integer> getSatelliteSupportedServicesFromConfig(int subId, String plmn) { - synchronized (mSupportedSatelliteServicesLock) { - if (mSatelliteServicesSupportedByCarriersFromConfig.containsKey(subId)) { - Map<String, Set<Integer>> supportedServices = - mSatelliteServicesSupportedByCarriersFromConfig.get(subId); - if (supportedServices != null && supportedServices.containsKey(plmn)) { - return new ArrayList<>(supportedServices.get(plmn)); + if (plmn != null && !plmn.isEmpty()) { + synchronized (mSupportedSatelliteServicesLock) { + if (mSatelliteServicesSupportedByCarriersFromConfig.containsKey(subId)) { + Map<String, Set<Integer>> supportedServices = + mSatelliteServicesSupportedByCarriersFromConfig.get(subId); + if (supportedServices != null && supportedServices.containsKey(plmn)) { + return new ArrayList<>(supportedServices.get(plmn)); + } else { + loge("getSupportedSatelliteServices: subId=" + subId + + ", supportedServices " + + "does not contain key plmn=" + plmn); + } } else { - loge("getSupportedSatelliteServices: subId=" + subId + ", supportedServices " - + "does not contain key plmn=" + plmn); + loge("getSupportedSatelliteServices: " + + "mSatelliteServicesSupportedByCarriersFromConfig does not contain" + + " key subId=" + subId); } - } else { - loge("getSupportedSatelliteServices: " - + "mSatelliteServicesSupportedByCarriersFromConfig does not contain key " - + "subId=" + subId); } } - /* Returns default capabilities when carrier config does not contain service - capabilities for the given plmn */ + /* Returns default capabilities when carrier config does not contain service capabilities + for the given plmn */ PersistableBundle config = getPersistableBundle(subId); int [] defaultCapabilities = config.getIntArray( KEY_CARRIER_ROAMING_SATELLITE_DEFAULT_SERVICES_INT_ARRAY); @@ -3931,25 +3996,35 @@ public class SatelliteController extends Handler { * @param subId Subscription ID. * @param plmn The satellite plmn. * @return The list of services supported by the carrier associated with the {@code subId} for - * the satellite network {@code plmn}. + * the satellite network {@code plmn}. Returns empty list at invalid sub id. + * */ @NonNull public List<Integer> getSupportedSatelliteServicesForPlmn(int subId, String plmn) { + + if (!isValidSubscriptionId(subId)) { + logd("getSupportedSatelliteServices: invalid sub id"); + return new ArrayList<>(); + } synchronized (mSupportedSatelliteServicesLock) { - Map<String, List<Integer>> allowedServicesList - = mEntitlementServiceTypeMapPerCarrier.get(subId); - if (allowedServicesList != null && allowedServicesList.containsKey(plmn)) { - List<Integer> allowedServiceValues = new ArrayList<>(allowedServicesList.get(plmn)); - if (allowedServiceValues != null && !allowedServiceValues.isEmpty()) { - if (isDataServiceUpdateRequired(subId, plmn, allowedServiceValues)) { - logd("getSupportedSatelliteServices: data service added to satellite plmn"); - allowedServiceValues.add(NetworkRegistrationInfo.SERVICE_TYPE_DATA); - } - if (allowedServiceValues.contains(NetworkRegistrationInfo.SERVICE_TYPE_DATA) - && isMmsServiceUpdateRequired(subId, plmn, allowedServiceValues)) { - allowedServiceValues.add(NetworkRegistrationInfo.SERVICE_TYPE_MMS); + if (plmn != null && !plmn.isEmpty()) { + Map<String, List<Integer>> allowedServicesList = + mEntitlementServiceTypeMapPerCarrier.get(subId); + if (allowedServicesList != null && allowedServicesList.containsKey(plmn)) { + List<Integer> allowedServiceValues = new ArrayList<>( + allowedServicesList.get(plmn)); + if (allowedServiceValues != null && !allowedServiceValues.isEmpty()) { + if (isDataServiceUpdateRequired(subId, plmn, allowedServiceValues)) { + logd("getSupportedSatelliteServices: data service added to satellite" + + " plmn"); + allowedServiceValues.add(NetworkRegistrationInfo.SERVICE_TYPE_DATA); + } + if (allowedServiceValues.contains(NetworkRegistrationInfo.SERVICE_TYPE_DATA) + && isMmsServiceUpdateRequired(subId, plmn, allowedServiceValues)) { + allowedServiceValues.add(NetworkRegistrationInfo.SERVICE_TYPE_MMS); + } + return allowedServiceValues; } - return allowedServiceValues; } } @@ -4363,10 +4438,14 @@ public class SatelliteController extends Handler { updateAndNotifyChangesInCarrierRoamingNtnAvailableServices(subId, plmnServiceTypeMap); updatePlmnListPerCarrier(subId); + configureSatellitePlmnForCarrier(subId); + evaluateEnablingSatelliteForCarrier(subId, + SATELLITE_COMMUNICATION_RESTRICTION_REASON_USER, null); mSubscriptionManagerService.setSatelliteEntitlementInfo(subId, allowedPlmnList, barredPlmnList, plmnDataPlanMap, plmnServiceTypeMap, plmnDataServicePolicyMap, plmnVoiceServicePolicyMap); + } else { loge("onSatelliteEntitlementStatusUpdated: either invalid allowedPlmnList " + "or invalid barredPlmnList"); @@ -5295,15 +5374,93 @@ public class SatelliteController extends Handler { return; } + List<String> allPlmnList = new ArrayList<>(getAllPlmnSet()); + phone.setSatellitePlmn(phone.getPhoneId(), getCarrierPlmnList(subId), allPlmnList, + obtainMessage(EVENT_SET_SATELLITE_PLMN_INFO_DONE)); + } + + private Set<String> getAllPlmnSet() { + Set<String> allPlmnSetFromSubInfo = new HashSet<>(); + int[] activeSubIdArray = mSubscriptionManagerService.getActiveSubIdList(true); + for (int activeSubId : activeSubIdArray) { + allPlmnSetFromSubInfo.addAll(getCarrierPlmnList(activeSubId)); + allPlmnSetFromSubInfo.addAll(getBarredPlmnList(activeSubId)); + } + allPlmnSetFromSubInfo.addAll(mSatellitePlmnListFromOverlayConfig); + + Set<String> allPlmnListFromStorage = getCarrierRoamingNtnAllSatellitePlmnSetFromStorage(); + if (!allPlmnListFromStorage.containsAll(allPlmnSetFromSubInfo)) { + allPlmnListFromStorage.addAll(allPlmnSetFromSubInfo); + persistCarrierRoamingNtnAllSatellitePlmnSet(allPlmnListFromStorage); + } + + plogd("getAllPlmnList: " + allPlmnListFromStorage); + return allPlmnListFromStorage; + } + + private List<String> getCarrierPlmnList(int subId) { synchronized (mSupportedSatelliteServicesLock) { - List<String> carrierPlmnList = mMergedPlmnListPerCarrier.get(subId, - new ArrayList<>()).stream().toList(); - List<String> barredPlmnList = mEntitlementBarredPlmnListPerCarrier.get(subId, - new ArrayList<>()).stream().toList(); - int slotId = SubscriptionManager.getSlotIndex(subId); - phone.setSatellitePlmn(slotId, carrierPlmnList, SatelliteServiceUtils.mergeStrLists( - carrierPlmnList, mSatellitePlmnListFromOverlayConfig, barredPlmnList), - obtainMessage(EVENT_SET_SATELLITE_PLMN_INFO_DONE)); + return mMergedPlmnListPerCarrier.get(subId, new ArrayList<>()).stream().toList(); + } + } + + private List<String> getBarredPlmnList(int subId) { + synchronized (mSupportedSatelliteServicesLock) { + return mEntitlementBarredPlmnListPerCarrier.get( + subId, new ArrayList<>()).stream().toList(); + } + } + + private void persistCarrierRoamingNtnAllSatellitePlmnSet(Set<String> allSatellitePlmnSet) { + plogd("persistCarrierRoamingNtnAllSatellitePlmnSet"); + if (!loadSatelliteSharedPreferences()) return; + + if (mSharedPreferences == null) { + ploge("persistCarrierRoamingNtnAllSatellitePlmnSet: mSharedPreferences is null"); + } else { + try { + mSharedPreferences.edit().putStringSet( + CARRIER_ROAMING_NTN_ALL_SATELLITE_PLMN_SET_KEY, allSatellitePlmnSet) + .apply(); + } catch (Exception ex) { + plogd("persistCarrierRoamingNtnAllSatellitePlmnSet: ex=" + ex); + } + + synchronized (mCarrierRoamingNtnAllSatellitePlmnSetLock) { + mCarrierRoamingNtnAllSatellitePlmnSet = allSatellitePlmnSet; + } + } + } + + private Set<String> getCarrierRoamingNtnAllSatellitePlmnSetFromStorage() { + synchronized (mCarrierRoamingNtnAllSatellitePlmnSetLock) { + if (mCarrierRoamingNtnAllSatellitePlmnSet != null) { + plogd("getCarrierRoamingNtnAllSatellitePlmnSetFromStorage: " + + mCarrierRoamingNtnAllSatellitePlmnSet); + return mCarrierRoamingNtnAllSatellitePlmnSet; + } + } + + if (!loadSatelliteSharedPreferences()) return new HashSet<>(); + + if (mSharedPreferences == null) { + ploge("getCarrierRoamingNtnAllSatellitePlmnSetFromStorage: mSharedPreferences is null"); + return new HashSet<>(); + } else { + Set<String> allSatellitePlmnSet = new HashSet<>(); + try { + allSatellitePlmnSet = mSharedPreferences.getStringSet( + CARRIER_ROAMING_NTN_ALL_SATELLITE_PLMN_SET_KEY, new HashSet<>()); + } catch (Exception ex) { + plogd("getCarrierRoamingNtnAllSatellitePlmnSetFromStorage: ex=" + ex); + } + + synchronized (mCarrierRoamingNtnAllSatellitePlmnSetLock) { + mCarrierRoamingNtnAllSatellitePlmnSet = allSatellitePlmnSet; + plogd("getCarrierRoamingNtnAllSatellitePlmnSetFromStorage: " + + mCarrierRoamingNtnAllSatellitePlmnSet); + return mCarrierRoamingNtnAllSatellitePlmnSet; + } } } @@ -5485,6 +5642,7 @@ public class SatelliteController extends Handler { return; } + getSatelliteEnabledForCarrierAtModem(subId); updateCarrierConfig(subId); updateSatelliteESOSSupported(subId); updateSatelliteProvisionedStatePerSubscriberId(); @@ -5498,6 +5656,16 @@ public class SatelliteController extends Handler { updateRegionalSatelliteEarfcns(subId); } + private void getSatelliteEnabledForCarrierAtModem(int subId) { + Phone phone = SatelliteServiceUtils.getPhone(subId); + synchronized (mIsSatelliteEnabledLock) { + if (!mIsSatelliteAttachEnabledForCarrierArrayPerSub.containsKey(subId)) { + // Get enabled status from modem for new subscription + sendRequestAsync(CMD_GET_SATELLITE_ENABLED_FOR_CARRIER, null, phone); + } + } + } + // imsi, msisdn, default sms subId change private void handleSubscriptionsChanged() { sendMessageDelayed(obtainMessage(CMD_EVALUATE_ESOS_PROFILES_PRIORITIZATION), @@ -5505,9 +5673,10 @@ public class SatelliteController extends Handler { } private void processNewCarrierConfigData(int subId) { - configureSatellitePlmnForCarrier(subId); - setSatelliteAttachEnabledForCarrierOnSimLoaded(subId); updateRestrictReasonForEntitlementPerCarrier(subId); + configureSatellitePlmnForCarrier(subId); + evaluateEnablingSatelliteForCarrier(subId, + SATELLITE_COMMUNICATION_RESTRICTION_REASON_USER, null); } @VisibleForTesting(visibility = VisibleForTesting.Visibility.PRIVATE) @@ -5619,23 +5788,6 @@ public class SatelliteController extends Handler { } /** - * When a SIM is loaded, we need to check if users has enabled satellite attach for the carrier - * associated with the SIM, and evaluate if satellite should be enabled for the carrier. - * - * @param subId Subscription ID. - */ - private void setSatelliteAttachEnabledForCarrierOnSimLoaded(int subId) { - synchronized (mIsSatelliteEnabledLock) { - if (isSatelliteAttachEnabledForCarrierByUser(subId) - && !mIsSatelliteAttachEnabledForCarrierArrayPerSub.getOrDefault(subId, - false)) { - evaluateEnablingSatelliteForCarrier(subId, - SATELLITE_COMMUNICATION_RESTRICTION_REASON_USER, null); - } - } - } - - /** * Update the value of SimInfo.COLUMN_SATELLITE_ESOS_SUPPORTED stored in the database based * on the value in the carrier config. */ @@ -5933,7 +6085,7 @@ public class SatelliteController extends Handler { /** * Check whether satellite is enabled for carrier at modem. * - * @param subId Subscription ID to check for. + * @param subId subscription ID * @return {@code true} if satellite modem is enabled, {@code false} otherwise. */ private boolean isSatelliteEnabledForCarrierAtModem(int subId) { @@ -5976,7 +6128,13 @@ public class SatelliteController extends Handler { state and the current state are different. */ boolean isSatelliteExpectedToBeEnabled = !isSatelliteRestrictedForCarrier(subId) && isSatelliteSupportedViaCarrier(subId); - if (isSatelliteExpectedToBeEnabled != isSatelliteEnabledForCarrierAtModem(subId)) { + boolean isSatelliteEnabledForCarrierAtModem = isSatelliteEnabledForCarrierAtModem( + phone.getSubId()); + plogd("evaluateEnablingSatelliteForCarrier: subId=" + subId + " reason=" + reason + + " isSatelliteExpectedToBeEnabled=" + isSatelliteExpectedToBeEnabled + + " isSatelliteEnabledForCarrierAtModem=" + isSatelliteEnabledForCarrierAtModem); + + if (isSatelliteExpectedToBeEnabled != isSatelliteEnabledForCarrierAtModem) { int simSlot = SubscriptionManager.getSlotIndex(subId); RequestHandleSatelliteAttachRestrictionForCarrierArgument argument = new RequestHandleSatelliteAttachRestrictionForCarrierArgument(subId, @@ -8996,7 +9154,7 @@ public class SatelliteController extends Handler { * @return Supported modes {@link CarrierConfigManager.SATELLITE_DATA_SUPPORT_MODE} */ public int getSatelliteDataServicePolicyForPlmn(int subId, String plmn) { - if (plmn != null) { + if (plmn != null && isValidSubscriptionId(subId)) { synchronized (mSupportedSatelliteServicesLock) { Map<String, Integer> dataServicePolicy = mEntitlementDataServicePolicyMapPerCarrier.get( @@ -9059,4 +9217,23 @@ public class SatelliteController extends Handler { return new ArrayList<>(); } } + + /** + * Method to return the current satellite data service policy supported mode for the + * subscription id based on carrier config. + * + * @param subId current subscription id. + * + * @return Supported modes {@link SatelliteManager#SatelliteDataSupportMode} + * + * @hide + */ + @SatelliteManager.SatelliteDataSupportMode + public int getSatelliteDataSupportMode(int subId) { + if (!mFeatureFlags.carrierRoamingNbIotNtn()) { + return SatelliteManager.SATELLITE_DATA_SUPPORT_RESTRICTED; + } + + return getSatelliteDataServicePolicyForPlmn(subId, ""); + } } diff --git a/tests/telephonytests/src/com/android/internal/telephony/WapPushOverSmsTest.java b/tests/telephonytests/src/com/android/internal/telephony/WapPushOverSmsTest.java index 2fdd4424ab..db44cd3787 100644 --- a/tests/telephonytests/src/com/android/internal/telephony/WapPushOverSmsTest.java +++ b/tests/telephonytests/src/com/android/internal/telephony/WapPushOverSmsTest.java @@ -107,7 +107,7 @@ public class WapPushOverSmsTest extends TelephonyTest { eq(android.Manifest.permission.RECEIVE_WAP_PUSH), eq(AppOpsManager.OPSTR_RECEIVE_WAP_PUSH), nullable(Bundle.class), - isNull(InboundSmsHandler.SmsBroadcastReceiver.class), + isNull(), eq(MOCKED_MAIN_USER), anyInt()); Intent intent = intentArgumentCaptor.getValue(); diff --git a/tests/telephonytests/src/com/android/internal/telephony/data/KeepAliveTrackerTest.java b/tests/telephonytests/src/com/android/internal/telephony/data/KeepAliveTrackerTest.java index ceb08bf725..99308c3715 100644 --- a/tests/telephonytests/src/com/android/internal/telephony/data/KeepAliveTrackerTest.java +++ b/tests/telephonytests/src/com/android/internal/telephony/data/KeepAliveTrackerTest.java @@ -41,6 +41,7 @@ import com.android.internal.telephony.data.TelephonyNetworkAgent.TelephonyNetwor import org.junit.After; import org.junit.Before; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.ArgumentCaptor; @@ -51,6 +52,7 @@ import java.util.concurrent.TimeUnit; @RunWith(AndroidTestingRunner.class) @TestableLooper.RunWithLooper +@Ignore("Temporary ignore - this test is using reflection to modify the internals of NetworkAgent but these have changed for a bugfix") public class KeepAliveTrackerTest extends TelephonyTest { private KeepaliveTracker mKeepaliveTrackerUT; diff --git a/tests/telephonytests/src/com/android/internal/telephony/data/QosCallbackTrackerTest.java b/tests/telephonytests/src/com/android/internal/telephony/data/QosCallbackTrackerTest.java index d528d8588c..beb6bac1d4 100644 --- a/tests/telephonytests/src/com/android/internal/telephony/data/QosCallbackTrackerTest.java +++ b/tests/telephonytests/src/com/android/internal/telephony/data/QosCallbackTrackerTest.java @@ -47,6 +47,7 @@ import com.android.internal.telephony.metrics.RcsStats; import org.junit.After; import org.junit.Before; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; @@ -56,6 +57,7 @@ import java.util.ArrayList; @RunWith(AndroidTestingRunner.class) @TestableLooper.RunWithLooper +@Ignore("Temporary ignore - this test is using reflection to modify the internals of NetworkAgent but these have changed for a bugfix") public class QosCallbackTrackerTest extends TelephonyTest { class Filter implements QosCallbackTracker.IFilter { diff --git a/tests/telephonytests/src/com/android/internal/telephony/satellite/SatelliteControllerTest.java b/tests/telephonytests/src/com/android/internal/telephony/satellite/SatelliteControllerTest.java index 58c74f114a..26e0dc0e46 100644 --- a/tests/telephonytests/src/com/android/internal/telephony/satellite/SatelliteControllerTest.java +++ b/tests/telephonytests/src/com/android/internal/telephony/satellite/SatelliteControllerTest.java @@ -2287,7 +2287,7 @@ public class SatelliteControllerTest extends TelephonyTest { reset(mMockSatelliteModemInterface); reset(mPhone); - /* setSatellitePlmn() is called regardless whether satellite attach for carrier is + /* setSatellitePlmn() is called regardless whether satellite attach for carrier is supported. */ mCarrierConfigBundle.putBoolean(CarrierConfigManager.KEY_SATELLITE_ATTACH_SUPPORTED_BOOL, false); @@ -2304,6 +2304,7 @@ public class SatelliteControllerTest extends TelephonyTest { reset(mPhone); // Test empty config_satellite_providers and empty carrier PLMN list + // allSatellitePlmnList is stored in shared preference, so plmns will not be removed mCarrierConfigChangedListenerList.clear(); mContextFixture.putStringArrayResource( R.array.config_satellite_providers, EMPTY_STRING_ARRAY); @@ -2324,7 +2325,7 @@ public class SatelliteControllerTest extends TelephonyTest { carrierPlmnList = testSatelliteController.getSatellitePlmnsForCarrier(SUB_ID); assertTrue(carrierPlmnList.isEmpty()); verify(mPhone, times(1)).setSatellitePlmn(anyInt(), - eq(EMPTY_STRING_LIST), eq(EMPTY_STRING_LIST), any(Message.class)); + eq(EMPTY_STRING_LIST), eq(allSatellitePlmnList), any(Message.class)); reset(mMockSatelliteModemInterface); reset(mPhone); } @@ -3014,14 +3015,17 @@ public class SatelliteControllerTest extends TelephonyTest { // If the entitlement plmn list is empty and the overlay config plmn list and the carrier // plmn list are available, verify passing to the modem. reset(mMockSatelliteModemInterface); + reset(mPhone); entitlementPlmnList = new ArrayList<>(); mergedPlmnList = carrierConfigPlmnList; verifyPassingToModemAfterQueryCompleted(entitlementPlmnList, mergedPlmnList, overlayConfigPlmnList, barredPlmnList); + // If the entitlement plmn list is empty and the overlay config plmn list, the carrier // plmn list and the barred plmn list are available, verify passing to the modem. reset(mMockSatelliteModemInterface); + reset(mPhone); barredPlmnList = Arrays.stream(new String[]{"00105", "00107"}).toList(); verifyPassingToModemAfterQueryCompleted(entitlementPlmnList, mergedPlmnList, overlayConfigPlmnList, barredPlmnList); @@ -3037,6 +3041,7 @@ public class SatelliteControllerTest extends TelephonyTest { // If the entitlement plmn list is invalid, verify not passing to the modem. reset(mMockSatelliteModemInterface); + reset(mPhone); entitlementPlmnList = Arrays.stream(new String[]{"00101", "00102", ""}).toList(); mSatelliteControllerUT.onSatelliteEntitlementStatusUpdated(SUB_ID, false, entitlementPlmnList, barredPlmnList, new HashMap<>(), new HashMap<>(), @@ -3046,6 +3051,7 @@ public class SatelliteControllerTest extends TelephonyTest { // If the entitlement plmn list is invalid, verify not passing to the modem. reset(mMockSatelliteModemInterface); + reset(mPhone); entitlementPlmnList = Arrays.stream(new String[]{"00101", "00102", "123456789"}).toList(); mSatelliteControllerUT.onSatelliteEntitlementStatusUpdated(SUB_ID, false, entitlementPlmnList, barredPlmnList, new HashMap<>(), new HashMap<>(), @@ -3055,6 +3061,7 @@ public class SatelliteControllerTest extends TelephonyTest { // If the entitlement plmn list is invalid, verify not passing to the modem. reset(mMockSatelliteModemInterface); + reset(mPhone); entitlementPlmnList = Arrays.stream(new String[]{"00101", "00102", "12"}).toList(); mSatelliteControllerUT.onSatelliteEntitlementStatusUpdated(SUB_ID, false, entitlementPlmnList, barredPlmnList, new HashMap<>(), new HashMap<>(), @@ -3064,6 +3071,7 @@ public class SatelliteControllerTest extends TelephonyTest { // If the entitlement plmn list is invalid, verify not passing to the modem. reset(mMockSatelliteModemInterface); + reset(mPhone); entitlementPlmnList = Arrays.stream(new String[]{"00101", "00102", "1234"}).toList(); mSatelliteControllerUT.onSatelliteEntitlementStatusUpdated(SUB_ID, false, entitlementPlmnList, barredPlmnList, new HashMap<>(), new HashMap<>(), @@ -3089,7 +3097,7 @@ public class SatelliteControllerTest extends TelephonyTest { assertEquals(plmnListPerCarrier, allSatellitePlmnList); } verify(mPhone, times(1)).setSatellitePlmn(anyInt(), - eq(plmnListPerCarrier), eq(allSatellitePlmnList), any(Message.class)); + eq(plmnListPerCarrier), anyList(), any(Message.class)); } private void setConfigData(List<String> plmnList) { |