summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Daniel Bright <dbright@google.com> 2021-01-05 23:56:41 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2021-01-05 23:56:41 +0000
commit1637b855bce658941311579c138c26f92018c3b6 (patch)
tree315bcbb471069f4798c8ea8c5603cdd0bb0a4cf0
parent6ca0a72bf8d859ba83542eabd0adf8d85e156120 (diff)
parent54c80ca1f5bf250f2e3683c3f51f64c4268e8445 (diff)
Merge "Add callSessionIntiating + callSessionInitatingFailed" am: cc7c94c433 am: 54c80ca1f5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1520003 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I057d27f999ff11fe3ebc571cb8f338fa8e883419
-rw-r--r--core/api/system-current.txt4
-rwxr-xr-xtelephony/java/android/telephony/ims/ImsCallSession.java39
-rw-r--r--telephony/java/android/telephony/ims/ImsCallSessionListener.java49
-rw-r--r--telephony/java/android/telephony/ims/aidl/IImsCallSessionListener.aidl2
4 files changed, 87 insertions, 7 deletions
diff --git a/core/api/system-current.txt b/core/api/system-current.txt
index cc819fa2e078..05f01433afef 100644
--- a/core/api/system-current.txt
+++ b/core/api/system-current.txt
@@ -11126,7 +11126,9 @@ package android.telephony.ims {
method public void callSessionHoldFailed(android.telephony.ims.ImsReasonInfo);
method public void callSessionHoldReceived(android.telephony.ims.ImsCallProfile);
method public void callSessionInitiated(android.telephony.ims.ImsCallProfile);
- method public void callSessionInitiatedFailed(android.telephony.ims.ImsReasonInfo);
+ method @Deprecated public void callSessionInitiatedFailed(android.telephony.ims.ImsReasonInfo);
+ method public void callSessionInitiating(@NonNull android.telephony.ims.ImsCallProfile);
+ method public void callSessionInitiatingFailed(@NonNull android.telephony.ims.ImsReasonInfo);
method public void callSessionInviteParticipantsRequestDelivered();
method public void callSessionInviteParticipantsRequestFailed(android.telephony.ims.ImsReasonInfo);
method @Deprecated public void callSessionMayHandover(int, int);
diff --git a/telephony/java/android/telephony/ims/ImsCallSession.java b/telephony/java/android/telephony/ims/ImsCallSession.java
index a3efb799029a..0aff99709a52 100755
--- a/telephony/java/android/telephony/ims/ImsCallSession.java
+++ b/telephony/java/android/telephony/ims/ImsCallSession.java
@@ -101,10 +101,29 @@ public class ImsCallSession {
*/
public static class Listener {
/**
- * Called when a request is sent out to initiate a new session
- * and 1xx response is received from the network.
+ * Called when the session is initiating.
*
- * @param session the session object that carries out the IMS session
+ * see: {@link ImsCallSessionListener#callSessionInitiating(ImsCallProfile)}
+ */
+ public void callSessionInitiating(ImsCallSession session,
+ ImsCallProfile profile) {
+ // no-op
+ }
+
+ /**
+ * Called when the session failed before initiating was called.
+ *
+ * see: {@link ImsCallSessionListener#callSessionInitiatingFailed(ImsReasonInfo)}
+ */
+ public void callSessionInitiatingFailed(ImsCallSession session,
+ ImsReasonInfo reasonInfo) {
+ // no-op
+ }
+
+ /**
+ * Called when the session is progressing.
+ *
+ * see: {@link ImsCallSessionListener#callSessionProgressing(ImsStreamMediaProfile)}
*/
public void callSessionProgressing(ImsCallSession session,
ImsStreamMediaProfile profile) {
@@ -1179,6 +1198,13 @@ public class ImsCallSession {
* Notifies the result of the basic session operation (setup / terminate).
*/
@Override
+ public void callSessionInitiating(ImsCallProfile profile) {
+ if (mListener != null) {
+ mListener.callSessionInitiating(ImsCallSession.this, profile);
+ }
+ }
+
+ @Override
public void callSessionProgressing(ImsStreamMediaProfile profile) {
if (mListener != null) {
mListener.callSessionProgressing(ImsCallSession.this, profile);
@@ -1193,6 +1219,13 @@ public class ImsCallSession {
}
@Override
+ public void callSessionInitiatingFailed(ImsReasonInfo reasonInfo) {
+ if (mListener != null) {
+ mListener.callSessionStartFailed(ImsCallSession.this, reasonInfo);
+ }
+ }
+
+ @Override
public void callSessionInitiatedFailed(ImsReasonInfo reasonInfo) {
if (mListener != null) {
mListener.callSessionStartFailed(ImsCallSession.this, reasonInfo);
diff --git a/telephony/java/android/telephony/ims/ImsCallSessionListener.java b/telephony/java/android/telephony/ims/ImsCallSessionListener.java
index 86bb5d9f0b09..db99acfd9a35 100644
--- a/telephony/java/android/telephony/ims/ImsCallSessionListener.java
+++ b/telephony/java/android/telephony/ims/ImsCallSessionListener.java
@@ -53,8 +53,45 @@ public class ImsCallSessionListener {
}
/**
- * A request has been sent out to initiate a new IMS call session and a 1xx response has been
- * received from the network.
+ * Called when the network first begins to establish the call session and is now connecting
+ * to the remote party. This must be called once after {@link ImsCallSessionImplBase#start} and
+ * before any other method on this listener. After this is called,
+ * {@link #callSessionProgressing(ImsStreamMediaProfile)} must be called to communicate any
+ * further updates.
+ * <p/>
+ * Once this is called, {@link #callSessionTerminated} must be called
+ * to end the call session. In the event that the session failed before the remote party
+ * was contacted, {@link #callSessionInitiatingFailed} must be called.
+ *
+ * @param profile the associated {@link ImsCallProfile}.
+ */
+ public void callSessionInitiating(@NonNull ImsCallProfile profile) {
+ try {
+ mListener.callSessionInitiating(profile);
+ } catch (RemoteException e) {
+ e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * The IMS call session establishment has failed while initiating.
+ *
+ * @param reasonInfo {@link ImsReasonInfo} detailing the reason of the IMS call session
+ * establishment failure.
+ */
+ public void callSessionInitiatingFailed(@NonNull ImsReasonInfo reasonInfo) {
+ try {
+ mListener.callSessionInitiatingFailed(reasonInfo);
+ } catch (RemoteException e) {
+ e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Called after the network has contacted the remote party and the call state should move to
+ * ALERTING.
+ *
+ * @param profile the associated {@link ImsCallProfile}.
*/
public void callSessionProgressing(ImsStreamMediaProfile profile) {
try {
@@ -65,7 +102,8 @@ public class ImsCallSessionListener {
}
/**
- * The IMS call session has been initiated.
+ * Called once the outgoing IMS call session has been begun between the local and remote party.
+ * The call state should move to ACTIVE.
*
* @param profile the associated {@link ImsCallProfile}.
*/
@@ -82,7 +120,12 @@ public class ImsCallSessionListener {
*
* @param reasonInfo {@link ImsReasonInfo} detailing the reason of the IMS call session
* establishment failure.
+ * @deprecated {@link #callSessionInitiated(ImsCallProfile)} is called immediately after
+ * the session is first started which meant that there was no time in which a call to this
+ * method was technically valid. This method is replaced starting Android S in favor of
+ * {@link #callSessionInitiatingFailed(ImsReasonInfo)}.
*/
+ @Deprecated
public void callSessionInitiatedFailed(ImsReasonInfo reasonInfo) {
try {
mListener.callSessionInitiatedFailed(reasonInfo);
diff --git a/telephony/java/android/telephony/ims/aidl/IImsCallSessionListener.aidl b/telephony/java/android/telephony/ims/aidl/IImsCallSessionListener.aidl
index ed895b77a164..ed0375251ffb 100644
--- a/telephony/java/android/telephony/ims/aidl/IImsCallSessionListener.aidl
+++ b/telephony/java/android/telephony/ims/aidl/IImsCallSessionListener.aidl
@@ -37,6 +37,8 @@ oneway interface IImsCallSessionListener {
/**
* Notifies the result of the basic session operation (setup / terminate).
*/
+ void callSessionInitiating(in ImsCallProfile profile);
+ void callSessionInitiatingFailed(in ImsReasonInfo reasonInfo);
void callSessionProgressing(in ImsStreamMediaProfile profile);
void callSessionInitiated(in ImsCallProfile profile);
void callSessionInitiatedFailed(in ImsReasonInfo reasonInfo);