Add callback into vendor interface to receive modem state change event
Added a callback into vendor interface to receive the satellite supported state changed event.
Bug: 327652782
Test: SatelliteControllerTest, cts/SatelliteManagerTest, cts/SatelliteManagerTestOnMockService
manual basic call/sms/mms test includes regression test cases
Change-Id: I470e6f1a9b84306c6dc637b4f208a7546e338038
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index e18818c..c382a44 100644
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -159,6 +159,7 @@
import android.telephony.satellite.ISatelliteDatagramCallback;
import android.telephony.satellite.ISatelliteModemStateCallback;
import android.telephony.satellite.ISatelliteProvisionStateCallback;
+import android.telephony.satellite.ISatelliteSupportedStateCallback;
import android.telephony.satellite.ISatelliteTransmissionUpdateCallback;
import android.telephony.satellite.NtnSignalStrength;
import android.telephony.satellite.NtnSignalStrengthCallback;
@@ -13407,7 +13408,7 @@
*
* @param subId The subId of the subscription to request for.
* @param reason Reason for disallowing satellite communication for carrier.
- * @param callback Listener for the {@link SatelliteManager.SatelliteError} result of the
+ * @param callback Listener for the {@link SatelliteManager.SatelliteResult} result of the
* operation.
*
* @throws SecurityException if the caller doesn't have required permission.
@@ -13430,7 +13431,7 @@
*
* @param subId The subId of the subscription to request for.
* @param reason Reason for disallowing satellite communication.
- * @param callback Listener for the {@link SatelliteManager.SatelliteError} result of the
+ * @param callback Listener for the {@link SatelliteManager.SatelliteResult} result of the
* operation.
*
* @throws SecurityException if the caller doesn't have required permission.
@@ -13449,7 +13450,7 @@
/**
* Get reasons for disallowing satellite communication, as requested by
- * {@link #addSatelliteAttachRestrictionForCarrier(int, int, IIntegerConsumer)}.
+ * {@link #addAttachRestrictionForCarrier(int, int, IIntegerConsumer)}.
*
* @param subId The subId of the subscription to request for.
*
@@ -13585,6 +13586,40 @@
}
/**
+ * Registers for the satellite supported state changed.
+ *
+ * @param subId The subId of the subscription to register for supported state changed.
+ * @param callback The callback to handle the satellite supported state changed event.
+ *
+ * @return The {@link SatelliteManager.SatelliteResult} result of the operation.
+ *
+ * @throws SecurityException if the caller doesn't have the required permission.
+ */
+ @Override
+ @SatelliteManager.SatelliteResult public int registerForSatelliteSupportedStateChanged(
+ int subId, @NonNull ISatelliteSupportedStateCallback callback) {
+ enforceSatelliteCommunicationPermission("registerForSatelliteSupportedStateChanged");
+ return mSatelliteController.registerForSatelliteSupportedStateChanged(subId, callback);
+ }
+
+ /**
+ * Unregisters for the satellite supported state changed.
+ * If callback was not registered before, the request will be ignored.
+ *
+ * @param subId The subId of the subscription to unregister for supported state changed.
+ * @param callback The callback that was passed to
+ * {@link #registerForSatelliteSupportedStateChanged(int, ISatelliteSupportedStateCallback)}.
+ *
+ * @throws SecurityException if the caller doesn't have the required permission.
+ */
+ @Override
+ public void unregisterForSatelliteSupportedStateChanged(
+ int subId, @NonNull ISatelliteSupportedStateCallback callback) {
+ enforceSatelliteCommunicationPermission("unregisterForSatelliteSupportedStateChanged");
+ mSatelliteController.unregisterForSatelliteSupportedStateChanged(subId, callback);
+ }
+
+ /**
* This API can be used by only CTS to update satellite vendor service package name.
*
* @param servicePackageName The package name of the satellite vendor service.