Add a new internal api for receiving the new intent in satellite CTS test which to configure intent component with the necessary values.
Bug: 362405259
Test: atest SatelliteManagerTest, SatelliteManagerTestOnMockService
Flag: com.android.internal.telephony.flags.carrier_roaming_nb_iot_ntn
Change-Id: Icebd22f0389d9154bca8711a4ce97b790f9688ad
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index 2cd0336..5dc64ab 100644
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -14410,4 +14410,37 @@
Binder.restoreCallingIdentity(identity);
}
}
+
+ /**
+ * This API can be used by only CTS to override the cached value for the device overlay config
+ * value :
+ * config_satellite_gateway_service_package and
+ * config_satellite_carrier_roaming_esos_provisioned_class.
+ * These values are set before sending an intent to broadcast there are any change to list of
+ * subscriber informations.
+ *
+ * @param name the name is one of the following that constitute an intent.
+ * Component package name, or component class name.
+ * @return {@code true} if the setting is successful, {@code false} otherwise.
+ */
+ @Override
+ public boolean setSatelliteSubscriberIdListChangedIntentComponent(String name) {
+ if (!mFeatureFlags.carrierRoamingNbIotNtn()) {
+ Log.d(LOG_TAG, "setSatelliteSubscriberIdListChangedIntentComponent:"
+ + " carrierRoamingNbIotNtn is disabled");
+ return false;
+ }
+ Log.d(LOG_TAG, "setSatelliteSubscriberIdListChangedIntentComponent");
+ TelephonyPermissions.enforceShellOnly(
+ Binder.getCallingUid(), "setSatelliteSubscriberIdListChangedIntentComponent");
+ TelephonyPermissions.enforceCallingOrSelfModifyPermissionOrCarrierPrivilege(mApp,
+ SubscriptionManager.INVALID_SUBSCRIPTION_ID,
+ "setSatelliteSubscriberIdListChangedIntentComponent");
+ final long identity = Binder.clearCallingIdentity();
+ try {
+ return mSatelliteController.setSatelliteSubscriberIdListChangedIntentComponent(name);
+ } finally {
+ Binder.restoreCallingIdentity(identity);
+ }
+ }
}