Update datagram controller APIs used for CTS
Bug: 323571903
Test: atest SatelliteManagerTestOnMockService SatelliteControllerTest DatagramDispatcherTest
Manual test with SatelliteTestApp. SMS, MMS, call with live network.
Change-Id: I991645be8741831eeb4f240e9534b6f1e29db510
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index 60d93b6..eacdf78 100644
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -13670,20 +13670,43 @@
}
/**
- * This API can be used by only CTS to update the timeout duration in milliseconds whether
- * the device is aligned with the satellite for demo mode
+ * This API can be used by only CTS to override the timeout durations used by the
+ * DatagramController module.
*
* @param timeoutMillis The timeout duration in millisecond.
* @return {@code true} if the timeout duration is set successfully, {@code false} otherwise.
*/
- public boolean setSatelliteDeviceAlignedTimeoutDuration(long timeoutMillis) {
- Log.d(LOG_TAG, "setDeviceAlignedTimeoutDuration - " + timeoutMillis);
+ public boolean setDatagramControllerTimeoutDuration(
+ boolean reset, int timeoutType, long timeoutMillis) {
+ Log.d(LOG_TAG, "setDatagramControllerTimeoutDuration - " + timeoutMillis + ", reset="
+ + reset + ", timeoutMillis=" + timeoutMillis);
TelephonyPermissions.enforceShellOnly(
- Binder.getCallingUid(), "setDeviceAlignedTimeoutDuration");
+ Binder.getCallingUid(), "setDatagramControllerTimeoutDuration");
TelephonyPermissions.enforceCallingOrSelfModifyPermissionOrCarrierPrivilege(mApp,
SubscriptionManager.INVALID_SUBSCRIPTION_ID,
- "setDeviceAlignedTimeoutDuration");
- return mSatelliteController.setSatelliteDeviceAlignedTimeoutDuration(timeoutMillis);
+ "setDatagramControllerTimeoutDuration");
+ return mSatelliteController.setDatagramControllerTimeoutDuration(
+ reset, timeoutType, timeoutMillis);
+ }
+
+ /**
+ * This API can be used by only CTS to override the timeout durations used by the
+ * SatelliteController module.
+ *
+ * @param timeoutMillis The timeout duration in millisecond.
+ * @return {@code true} if the timeout duration is set successfully, {@code false} otherwise.
+ */
+ public boolean setSatelliteControllerTimeoutDuration(
+ boolean reset, int timeoutType, long timeoutMillis) {
+ Log.d(LOG_TAG, "setSatelliteControllerTimeoutDuration - " + timeoutMillis + ", reset="
+ + reset + ", timeoutMillis=" + timeoutMillis);
+ TelephonyPermissions.enforceShellOnly(
+ Binder.getCallingUid(), "setSatelliteControllerTimeoutDuration");
+ TelephonyPermissions.enforceCallingOrSelfModifyPermissionOrCarrierPrivilege(mApp,
+ SubscriptionManager.INVALID_SUBSCRIPTION_ID,
+ "setSatelliteControllerTimeoutDuration");
+ return mSatelliteController.setSatelliteControllerTimeoutDuration(
+ reset, timeoutType, timeoutMillis);
}
/**