Add register/unregister for selected satellite subscription changed event in PhoneInterfaceManager.
Bug: 378557737
Change-Id: Ie4a26b924ad6a3df4adb07f9207bdb97368f3316
Test: atest SatelliteManagerTest, SatelliteManagerTestOnMockService
FLAG: com.android.internal.telephony.flags.carrier_roaming_nb_iot_ntn
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index b0f88b2..6e7306a 100644
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -163,6 +163,7 @@
import android.telephony.satellite.ISatelliteProvisionStateCallback;
import android.telephony.satellite.ISatelliteSupportedStateCallback;
import android.telephony.satellite.ISatelliteTransmissionUpdateCallback;
+import android.telephony.satellite.ISelectedNbIotSatelliteSubscriptionCallback;
import android.telephony.satellite.NtnSignalStrength;
import android.telephony.satellite.NtnSignalStrengthCallback;
import android.telephony.satellite.SatelliteCapabilities;
@@ -13790,6 +13791,54 @@
}
/**
+ * Registers for selected satellite subscription changed event from the satellite service.
+ *
+ * @param callback The callback to handle the satellite subscription changed event.
+ *
+ * @return The {@link SatelliteManager.SatelliteResult} result of the operation.
+ *
+ * @throws SecurityException if the caller doesn't have required permission.
+ */
+ @Override
+ @SatelliteManager.SatelliteResult
+ public int registerForSelectedNbIotSatelliteSubscriptionChanged(
+ @NonNull ISelectedNbIotSatelliteSubscriptionCallback callback) {
+ enforceSatelliteCommunicationPermission(
+ "registerForSelectedNbIotSatelliteSubscriptionChanged");
+ final long identity = Binder.clearCallingIdentity();
+ try {
+ return mSatelliteController.registerForSelectedNbIotSatelliteSubscriptionChanged(
+ callback);
+ } finally {
+ Binder.restoreCallingIdentity(identity);
+ }
+ }
+
+ /**
+ * Unregisters for selected satellite subscription changed event from the satellite service.
+ * If callback was not registered before, the request will be ignored.
+ *
+ * @param callback The callback that was passed to {@link
+ * #registerForSelectedNbIotSatelliteSubscriptionChanged(
+ * ISelectedNbIotSatelliteSubscriptionCallback)}.
+ *
+ * @throws SecurityException if the caller doesn't have required permission.
+ */
+ @Override
+ public void unregisterForSelectedNbIotSatelliteSubscriptionChanged(
+ @NonNull ISelectedNbIotSatelliteSubscriptionCallback callback) {
+ enforceSatelliteCommunicationPermission(
+ "unregisterForSelectedNbIotSatelliteSubscriptionChanged");
+ final long identity = Binder.clearCallingIdentity();
+ try {
+ mSatelliteController.unregisterForSelectedNbIotSatelliteSubscriptionChanged(
+ callback);
+ } finally {
+ Binder.restoreCallingIdentity(identity);
+ }
+ }
+
+ /**
* Inform whether the device is aligned with the satellite in both real and demo mode.
*
* @param isAligned {@code true} Device is aligned with the satellite.