Register the handler for SIM refresh notification
Bug: 338130520
Test: atest SatelliteEntitlementControllerTest
Test: SIM refresh manual test b/346737925#comment6
Change-Id: Ib3f1a2cbf9946c0f52af4831b1fb5fe37e8121af
diff --git a/src/java/com/android/internal/telephony/satellite/SatelliteController.java b/src/java/com/android/internal/telephony/satellite/SatelliteController.java
index b7ff96f..a639822 100644
--- a/src/java/com/android/internal/telephony/satellite/SatelliteController.java
+++ b/src/java/com/android/internal/telephony/satellite/SatelliteController.java
@@ -133,7 +133,6 @@
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
-import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
@@ -2993,6 +2992,29 @@
}
/**
+ * Register the handler for SIM Refresh notifications.
+ * @param handler Handler for notification message.
+ * @param what User-defined message code.
+ */
+ public void registerIccRefresh(Handler handler, int what) {
+ for (Phone phone : PhoneFactory.getPhones()) {
+ CommandsInterface ci = phone.mCi;
+ ci.registerForIccRefresh(handler, what, null);
+ }
+ }
+
+ /**
+ * Unregister the handler for SIM Refresh notifications.
+ * @param handler Handler for notification message.
+ */
+ public void unRegisterIccRefresh(Handler handler) {
+ for (Phone phone : PhoneFactory.getPhones()) {
+ CommandsInterface ci = phone.mCi;
+ ci.unregisterForIccRefresh(handler);
+ }
+ }
+
+ /**
* To use the satellite service, update the EntitlementStatus and the PlmnAllowedList after
* receiving the satellite configuration from the entitlement server. If satellite
* entitlement is enabled, enable satellite for the carrier. Otherwise, disable satellite.