summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Brad Ebinger <breadley@google.com> 2020-12-04 22:07:44 +0000
committer Brad Ebinger <breadley@google.com> 2020-12-09 21:11:48 +0000
commit3011f5beb4468fb8e289f17623f01e9afe9f0e1d (patch)
treec340ba8a84bba5c4c3efdc253f0a2c715774f029
parent806aa0b3778b75d96920727de59867efaf1aeeec (diff)
Add SipDelegateConnection#closeDialog
Add an API for IMS application to notify the SipDelegate when to close the dialog and release all routing resources associated with it. Bug: 173833985 Test: atest CtsTelephonyTestCases:SipDelegateManagerTest Change-Id: I7638c1d3a8e117f604a83ea241c5ec158f33a186
-rw-r--r--core/api/system-current.txt1
-rw-r--r--telephony/java/android/telephony/ims/DelegateRegistrationState.java14
-rw-r--r--telephony/java/android/telephony/ims/SipDelegateConnection.java16
-rw-r--r--telephony/java/android/telephony/ims/aidl/ISipDelegate.aidl2
-rw-r--r--telephony/java/android/telephony/ims/aidl/SipDelegateConnectionAidlWrapper.java13
-rw-r--r--telephony/java/android/telephony/ims/stub/SipDelegate.java11
6 files changed, 46 insertions, 11 deletions
diff --git a/core/api/system-current.txt b/core/api/system-current.txt
index a48ad95ea40e..373d4bcd0219 100644
--- a/core/api/system-current.txt
+++ b/core/api/system-current.txt
@@ -11314,6 +11314,7 @@ package android.telephony.ims {
}
public interface SipDelegateConnection {
+ method public void closeDialog(@NonNull String);
method public void notifyMessageReceiveError(@NonNull String, int);
method public void notifyMessageReceived(@NonNull String);
method public void sendMessage(@NonNull android.telephony.ims.SipMessage, long);
diff --git a/telephony/java/android/telephony/ims/DelegateRegistrationState.java b/telephony/java/android/telephony/ims/DelegateRegistrationState.java
index 3558a9b79ce0..66281edc0de1 100644
--- a/telephony/java/android/telephony/ims/DelegateRegistrationState.java
+++ b/telephony/java/android/telephony/ims/DelegateRegistrationState.java
@@ -62,7 +62,8 @@ public final class DelegateRegistrationState implements Parcelable {
/**
* This feature tag is being deregistered because the PDN that the IMS registration is on is
*changing.
- * All open SIP dialogs need to be closed before the PDN change can proceed.
+ * All open SIP dialogs need to be closed before the PDN change can proceed using
+ * {@link SipDelegateConnection#closeDialog(String)}.
*/
public static final int DEREGISTERING_REASON_PDN_CHANGE = 3;
@@ -73,7 +74,8 @@ public final class DelegateRegistrationState implements Parcelable {
* a user triggered hange, such as data being enabled/disabled.
* <p>
* All open SIP dialogs associated with the new deprovisioned feature tag need to be closed
- * before the IMS registration modification can proceed.
+ * using {@link SipDelegateConnection#closeDialog(String)} before the IMS registration
+ * modification can proceed.
*/
public static final int DEREGISTERING_REASON_PROVISIONING_CHANGE = 4;
@@ -81,8 +83,8 @@ public final class DelegateRegistrationState implements Parcelable {
* This feature tag is deregistering because the SipDelegate associated with this feature tag
* needs to change its supported feature set.
* <p>
- * All open SIP Dialogs associated with this feature tag must be closed before this operation
- * can proceed.
+ * All open SIP Dialogs associated with this feature tag must be closed
+ * using {@link SipDelegateConnection#closeDialog(String)} before this operation can proceed.
*/
public static final int DEREGISTERING_REASON_FEATURE_TAGS_CHANGING = 5;
@@ -90,8 +92,8 @@ public final class DelegateRegistrationState implements Parcelable {
* This feature tag is deregistering because the SipDelegate is in the process of being
* destroyed.
* <p>
- * All open SIP Dialogs associated with this feature tag must be closed before this operation
- * can proceed.
+ * All open SIP Dialogs associated with this feature tag must be closed
+ * using {@link SipDelegateConnection#closeDialog(String)} before this operation can proceed.
*/
public static final int DEREGISTERING_REASON_DESTROY_PENDING = 6;
diff --git a/telephony/java/android/telephony/ims/SipDelegateConnection.java b/telephony/java/android/telephony/ims/SipDelegateConnection.java
index c3cc1edf590b..04a772cd873d 100644
--- a/telephony/java/android/telephony/ims/SipDelegateConnection.java
+++ b/telephony/java/android/telephony/ims/SipDelegateConnection.java
@@ -62,6 +62,22 @@ public interface SipDelegateConnection {
void notifyMessageReceived(@NonNull String viaTransactionId);
/**
+ * The SIP Dialog associated with the provided Call-ID is being closed and routing resources
+ * associated with the SIP dialog are free to be released.
+ * <p>
+ * Calling this method is also mandatory for situations where the framework IMS stack is waiting
+ * for pending SIP dialogs to be closed before it can perform a handover or apply a provisioning
+ * change. See {@link DelegateRegistrationState} for more information about
+ * the scenarios where this can occur.
+ * <p>
+ * This method will need to be called for each SIP dialog managed by this application when it is
+ * closed.
+ * @param callId The call-ID header value associated with the ongoing SIP Dialog that is
+ * closing.
+ */
+ void closeDialog(@NonNull String callId);
+
+ /**
* Notify the SIP delegate that the SIP message has been received from
* {@link DelegateMessageCallback#onMessageReceived(SipMessage)}, however there was an error
* processing it.
diff --git a/telephony/java/android/telephony/ims/aidl/ISipDelegate.aidl b/telephony/java/android/telephony/ims/aidl/ISipDelegate.aidl
index 5d6766a65155..ad75be439da8 100644
--- a/telephony/java/android/telephony/ims/aidl/ISipDelegate.aidl
+++ b/telephony/java/android/telephony/ims/aidl/ISipDelegate.aidl
@@ -26,7 +26,5 @@ oneway interface ISipDelegate {
void sendMessage(in SipMessage sipMessage, long configVersion);
void notifyMessageReceived(in String viaTransactionId);
void notifyMessageReceiveError(in String viaTransactionId, int reason);
-
- // only used by SipDelegate.
void closeDialog(in String callId);
}
diff --git a/telephony/java/android/telephony/ims/aidl/SipDelegateConnectionAidlWrapper.java b/telephony/java/android/telephony/ims/aidl/SipDelegateConnectionAidlWrapper.java
index 29ba8e2d50c4..a35039bd7668 100644
--- a/telephony/java/android/telephony/ims/aidl/SipDelegateConnectionAidlWrapper.java
+++ b/telephony/java/android/telephony/ims/aidl/SipDelegateConnectionAidlWrapper.java
@@ -199,6 +199,19 @@ public class SipDelegateConnectionAidlWrapper implements SipDelegateConnection,
}
}
+ @Override
+ public void closeDialog(String callId) {
+ try {
+ ISipDelegate conn = getSipDelegateBinder();
+ if (conn == null) {
+ return;
+ }
+ conn.closeDialog(callId);
+ } catch (RemoteException e) {
+ // Nothing to do here, app will eventually get remote death callback.
+ }
+ }
+
// Also called upon IImsRcsController death (telephony process dies).
@Override
public void binderDied() {
diff --git a/telephony/java/android/telephony/ims/stub/SipDelegate.java b/telephony/java/android/telephony/ims/stub/SipDelegate.java
index d7e7b62dd550..b036b5e71125 100644
--- a/telephony/java/android/telephony/ims/stub/SipDelegate.java
+++ b/telephony/java/android/telephony/ims/stub/SipDelegate.java
@@ -19,7 +19,9 @@ package android.telephony.ims.stub;
import android.annotation.NonNull;
import android.annotation.SystemApi;
import android.telephony.ims.DelegateMessageCallback;
+import android.telephony.ims.DelegateRegistrationState;
import android.telephony.ims.ImsService;
+import android.telephony.ims.SipDelegateConnection;
import android.telephony.ims.SipDelegateImsConfiguration;
import android.telephony.ims.SipDelegateManager;
import android.telephony.ims.SipMessage;
@@ -65,10 +67,13 @@ public interface SipDelegate {
* The framework is requesting that routing resources associated with the SIP dialog using the
* provided Call-ID to be cleaned up.
* <p>
- * Typically a SIP Dialog close event will be signalled by that dialog receiving a BYE or 200 OK
- * message, however, in some cases, the framework will request that the ImsService close the
+ * Typically, a SIP Dialog close event will be signalled by that dialog receiving a BYE or
+ * 200 OK message, however, the IMS application will still call
+ * {@link SipDelegateConnection#closeDialog(String)} to signal to the framework that resources
+ * can be released. In some cases, the framework will request that the ImsService close the
* dialog due to the open dialog holding up an event such as applying a provisioning change or
- * handing over to another transport type.
+ * handing over to another transport type. See {@link DelegateRegistrationState}.
+ *
* @param callId The call-ID header value associated with the ongoing SIP Dialog that the
* framework is requesting be closed.
*/