diff options
7 files changed, 131 insertions, 50 deletions
diff --git a/api/system-current.txt b/api/system-current.txt index ace192f36f7d..66b779d51669 100755 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -11838,7 +11838,8 @@ package android.telephony.ims { field public static final String EXTRA_ADDITIONAL_CALL_INFO = "AdditionalCallInfo"; field public static final String EXTRA_ADDITIONAL_SIP_INVITE_FIELDS = "android.telephony.ims.extra.ADDITIONAL_SIP_INVITE_FIELDS"; field public static final String EXTRA_CALL_DISCONNECT_CAUSE = "android.telephony.ims.extra.CALL_DISCONNECT_CAUSE"; - field public static final String EXTRA_CALL_RAT_TYPE = "CallRadioTech"; + field public static final String EXTRA_CALL_NETWORK_TYPE = "android.telephony.ims.extra.CALL_NETWORK_TYPE"; + field @Deprecated public static final String EXTRA_CALL_RAT_TYPE = "CallRadioTech"; field public static final String EXTRA_CHILD_NUMBER = "ChildNum"; field public static final String EXTRA_CNA = "cna"; field public static final String EXTRA_CNAP = "cnap"; @@ -11870,8 +11871,8 @@ package android.telephony.ims { method public void callSessionConferenceExtendReceived(android.telephony.ims.stub.ImsCallSessionImplBase, android.telephony.ims.ImsCallProfile); method public void callSessionConferenceExtended(android.telephony.ims.stub.ImsCallSessionImplBase, android.telephony.ims.ImsCallProfile); method public void callSessionConferenceStateUpdated(android.telephony.ims.ImsConferenceState); - method public void callSessionHandover(int, int, android.telephony.ims.ImsReasonInfo); - method public void callSessionHandoverFailed(int, int, android.telephony.ims.ImsReasonInfo); + method @Deprecated public void callSessionHandover(int, int, android.telephony.ims.ImsReasonInfo); + method @Deprecated public void callSessionHandoverFailed(int, int, android.telephony.ims.ImsReasonInfo); method public void callSessionHeld(android.telephony.ims.ImsCallProfile); method public void callSessionHoldFailed(android.telephony.ims.ImsReasonInfo); method public void callSessionHoldReceived(android.telephony.ims.ImsCallProfile); @@ -11879,7 +11880,7 @@ package android.telephony.ims { method public void callSessionInitiatedFailed(android.telephony.ims.ImsReasonInfo); method public void callSessionInviteParticipantsRequestDelivered(); method public void callSessionInviteParticipantsRequestFailed(android.telephony.ims.ImsReasonInfo); - method public void callSessionMayHandover(int, int); + method @Deprecated public void callSessionMayHandover(int, int); method public void callSessionMergeComplete(android.telephony.ims.stub.ImsCallSessionImplBase); method public void callSessionMergeFailed(android.telephony.ims.ImsReasonInfo); method public void callSessionMergeStarted(android.telephony.ims.stub.ImsCallSessionImplBase, android.telephony.ims.ImsCallProfile); @@ -11901,6 +11902,9 @@ package android.telephony.ims { method public void callSessionUpdateReceived(android.telephony.ims.ImsCallProfile); method public void callSessionUpdated(android.telephony.ims.ImsCallProfile); method public void callSessionUssdMessageReceived(int, String); + method public void onHandover(int, int, @Nullable android.telephony.ims.ImsReasonInfo); + method public void onHandoverFailed(int, int, @NonNull android.telephony.ims.ImsReasonInfo); + method public void onMayHandover(int, int); } public final class ImsConferenceState implements android.os.Parcelable { diff --git a/api/test-current.txt b/api/test-current.txt index d4b799dd405e..c110ebe4479c 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -3427,7 +3427,8 @@ package android.telephony.ims { field public static final String EXTRA_ADDITIONAL_CALL_INFO = "AdditionalCallInfo"; field public static final String EXTRA_ADDITIONAL_SIP_INVITE_FIELDS = "android.telephony.ims.extra.ADDITIONAL_SIP_INVITE_FIELDS"; field public static final String EXTRA_CALL_DISCONNECT_CAUSE = "android.telephony.ims.extra.CALL_DISCONNECT_CAUSE"; - field public static final String EXTRA_CALL_RAT_TYPE = "CallRadioTech"; + field public static final String EXTRA_CALL_NETWORK_TYPE = "android.telephony.ims.extra.CALL_NETWORK_TYPE"; + field @Deprecated public static final String EXTRA_CALL_RAT_TYPE = "CallRadioTech"; field public static final String EXTRA_CHILD_NUMBER = "ChildNum"; field public static final String EXTRA_CNA = "cna"; field public static final String EXTRA_CNAP = "cnap"; @@ -3460,8 +3461,8 @@ package android.telephony.ims { method public void callSessionConferenceExtendReceived(android.telephony.ims.stub.ImsCallSessionImplBase, android.telephony.ims.ImsCallProfile); method public void callSessionConferenceExtended(android.telephony.ims.stub.ImsCallSessionImplBase, android.telephony.ims.ImsCallProfile); method public void callSessionConferenceStateUpdated(android.telephony.ims.ImsConferenceState); - method public void callSessionHandover(int, int, android.telephony.ims.ImsReasonInfo); - method public void callSessionHandoverFailed(int, int, android.telephony.ims.ImsReasonInfo); + method @Deprecated public void callSessionHandover(int, int, android.telephony.ims.ImsReasonInfo); + method @Deprecated public void callSessionHandoverFailed(int, int, android.telephony.ims.ImsReasonInfo); method public void callSessionHeld(android.telephony.ims.ImsCallProfile); method public void callSessionHoldFailed(android.telephony.ims.ImsReasonInfo); method public void callSessionHoldReceived(android.telephony.ims.ImsCallProfile); @@ -3469,7 +3470,7 @@ package android.telephony.ims { method public void callSessionInitiatedFailed(android.telephony.ims.ImsReasonInfo); method public void callSessionInviteParticipantsRequestDelivered(); method public void callSessionInviteParticipantsRequestFailed(android.telephony.ims.ImsReasonInfo); - method public void callSessionMayHandover(int, int); + method @Deprecated public void callSessionMayHandover(int, int); method public void callSessionMergeComplete(android.telephony.ims.stub.ImsCallSessionImplBase); method public void callSessionMergeFailed(android.telephony.ims.ImsReasonInfo); method public void callSessionMergeStarted(android.telephony.ims.stub.ImsCallSessionImplBase, android.telephony.ims.ImsCallProfile); @@ -3491,6 +3492,9 @@ package android.telephony.ims { method public void callSessionUpdateReceived(android.telephony.ims.ImsCallProfile); method public void callSessionUpdated(android.telephony.ims.ImsCallProfile); method public void callSessionUssdMessageReceived(int, String); + method public void onHandover(int, int, @Nullable android.telephony.ims.ImsReasonInfo); + method public void onHandoverFailed(int, int, @NonNull android.telephony.ims.ImsReasonInfo); + method public void onMayHandover(int, int); } public final class ImsConferenceState implements android.os.Parcelable { diff --git a/telephony/java/android/telephony/ims/ImsCallProfile.java b/telephony/java/android/telephony/ims/ImsCallProfile.java index 3f260eb7d80f..8c9765b4bf70 100644 --- a/telephony/java/android/telephony/ims/ImsCallProfile.java +++ b/telephony/java/android/telephony/ims/ImsCallProfile.java @@ -302,15 +302,30 @@ public final class ImsCallProfile implements Parcelable { * updateImsCallRatFromExtras(Bundle)} to determine whether to set the * {@link android.telecom.TelecomManager#EXTRA_CALL_NETWORK_TYPE} extra value and * {@link android.telecom.Connection#PROPERTY_WIFI} property on a connection. + * @deprecated the constants associated with this extra are hidden, instead use + * {@link #EXTRA_CALL_NETWORK_TYPE}. */ + @Deprecated public static final String EXTRA_CALL_RAT_TYPE = "CallRadioTech"; /** + * Extra key with an {@code int} value which can be set in {@link #setCallExtraInt(String, int)} + * to indicate the network type used for a call. + * <p> + * Valid values are defined by {@code TelephonyManager.NETWORK_TYPE_*} constants. An example may + * be {@link android.telephony.TelephonyManager#NETWORK_TYPE_LTE}. + */ + public static final String EXTRA_CALL_NETWORK_TYPE = + "android.telephony.ims.extra.CALL_NETWORK_TYPE"; + + /** * Similar to {@link #EXTRA_CALL_RAT_TYPE}, except with a lowercase 'c'. Used to ensure * compatibility with modems that are non-compliant with the {@link #EXTRA_CALL_RAT_TYPE} * extra key. Should be removed when the non-compliant modems are fixed. * @hide + * @deprecated Use {@link #EXTRA_CALL_NETWORK_TYPE} instead. */ + @Deprecated public static final String EXTRA_CALL_RAT_TYPE_ALT = "callRadioTech"; /** @hide */ diff --git a/telephony/java/android/telephony/ims/ImsCallSession.java b/telephony/java/android/telephony/ims/ImsCallSession.java index 5adc99e11478..1b583fd29965 100644 --- a/telephony/java/android/telephony/ims/ImsCallSession.java +++ b/telephony/java/android/telephony/ims/ImsCallSession.java @@ -25,8 +25,6 @@ import android.util.Log; import com.android.ims.internal.IImsCallSession; import com.android.ims.internal.IImsVideoCallProvider; -import java.util.Objects; - /** * Provides the call initiation/termination, and media exchange between two IMS endpoints. * It directly communicates with IMS service which implements the IMS protocol behavior. @@ -346,7 +344,7 @@ public class ImsCallSession { } /** - * Called when an {@link ImsCallSession} may handover from one radio technology to another. + * Called when an {@link ImsCallSession} may handover from one network type to another. * For example, the session may handover from WIFI to LTE if conditions are right. * <p> * If handover is attempted, @@ -355,24 +353,24 @@ public class ImsCallSession { * called to indicate the success or failure of the handover. * * @param session IMS session object - * @param srcAccessTech original access technology - * @param targetAccessTech new access technology + * @param srcNetworkType original network type + * @param targetNetworkType new network type */ - public void callSessionMayHandover(ImsCallSession session, int srcAccessTech, - int targetAccessTech) { + public void callSessionMayHandover(ImsCallSession session, int srcNetworkType, + int targetNetworkType) { // no-op } /** - * Called when session access technology changes + * Called when session network type changes * * @param session IMS session object - * @param srcAccessTech original access technology - * @param targetAccessTech new access technology + * @param srcNetworkType original network type + * @param targetNetworkType new network type * @param reasonInfo */ public void callSessionHandover(ImsCallSession session, - int srcAccessTech, int targetAccessTech, + int srcNetworkType, int targetNetworkType, ImsReasonInfo reasonInfo) { // no-op } @@ -381,12 +379,12 @@ public class ImsCallSession { * Called when session access technology change fails * * @param session IMS session object - * @param srcAccessTech original access technology - * @param targetAccessTech new access technology + * @param srcNetworkType original access technology + * @param targetNetworkType new access technology * @param reasonInfo handover failure reason */ public void callSessionHandoverFailed(ImsCallSession session, - int srcAccessTech, int targetAccessTech, + int srcNetworkType, int targetNetworkType, ImsReasonInfo reasonInfo) { // no-op } @@ -1303,20 +1301,19 @@ public class ImsCallSession { /** * Notifies of a case where a {@link ImsCallSession} may * potentially handover from one radio technology to another. - * @param srcAccessTech The source radio access technology; one of the access technology - * constants defined in {@link android.telephony.ServiceState}. For - * example - * {@link android.telephony.ServiceState#RIL_RADIO_TECHNOLOGY_LTE}. - * @param targetAccessTech The target radio access technology; one of the access technology - * constants defined in {@link android.telephony.ServiceState}. For - * example - * {@link android.telephony.ServiceState#RIL_RADIO_TECHNOLOGY_LTE}. + * @param srcNetworkType The source network type; one of the network type constants defined + * in {@link android.telephony.TelephonyManager}. For example + * {@link android.telephony.TelephonyManager#NETWORK_TYPE_LTE}. + * @param targetNetworkType The target radio access technology; one of the network type + * constants defined in {@link android.telephony.TelephonyManager}. + * For example + * {@link android.telephony.TelephonyManager#NETWORK_TYPE_LTE}. */ @Override - public void callSessionMayHandover(int srcAccessTech, int targetAccessTech) { + public void callSessionMayHandover(int srcNetworkType, int targetNetworkType) { if (mListener != null) { - mListener.callSessionMayHandover(ImsCallSession.this, srcAccessTech, - targetAccessTech); + mListener.callSessionMayHandover(ImsCallSession.this, srcNetworkType, + targetNetworkType); } } @@ -1324,11 +1321,11 @@ public class ImsCallSession { * Notifies of handover information for this call */ @Override - public void callSessionHandover(int srcAccessTech, int targetAccessTech, + public void callSessionHandover(int srcNetworkType, int targetNetworkType, ImsReasonInfo reasonInfo) { if (mListener != null) { - mListener.callSessionHandover(ImsCallSession.this, srcAccessTech, - targetAccessTech, reasonInfo); + mListener.callSessionHandover(ImsCallSession.this, srcNetworkType, + targetNetworkType, reasonInfo); } } @@ -1336,11 +1333,11 @@ public class ImsCallSession { * Notifies of handover failure info for this call */ @Override - public void callSessionHandoverFailed(int srcAccessTech, int targetAccessTech, + public void callSessionHandoverFailed(int srcNetworkType, int targetNetworkType, ImsReasonInfo reasonInfo) { if (mListener != null) { - mListener.callSessionHandoverFailed(ImsCallSession.this, srcAccessTech, - targetAccessTech, reasonInfo); + mListener.callSessionHandoverFailed(ImsCallSession.this, srcNetworkType, + targetNetworkType, reasonInfo); } } diff --git a/telephony/java/android/telephony/ims/ImsCallSessionListener.java b/telephony/java/android/telephony/ims/ImsCallSessionListener.java index e11886f2bea5..025721c89f70 100644 --- a/telephony/java/android/telephony/ims/ImsCallSessionListener.java +++ b/telephony/java/android/telephony/ims/ImsCallSessionListener.java @@ -17,10 +17,13 @@ package android.telephony.ims; import android.annotation.NonNull; +import android.annotation.Nullable; import android.annotation.SystemApi; import android.annotation.TestApi; import android.os.RemoteException; +import android.telephony.Annotation; import android.telephony.CallQuality; +import android.telephony.ServiceState; import android.telephony.ims.aidl.IImsCallSessionListener; import android.telephony.ims.stub.ImsCallSessionImplBase; @@ -476,11 +479,27 @@ public class ImsCallSessionListener { * @param targetAccessTech The target radio access technology; one of the access technology * constants defined in {@link android.telephony.ServiceState}. For example * {@link android.telephony.ServiceState#RIL_RADIO_TECHNOLOGY_LTE}. + * @deprecated Uses hidden constants for radio access technology, use + * {@link #onMayHandover(int, int)} instead. */ - public void callSessionMayHandover(int srcAccessTech, int targetAccessTech) - { + @Deprecated + public void callSessionMayHandover(int srcAccessTech, int targetAccessTech) { + // Use new API internally. + onMayHandover(ServiceState.rilRadioTechnologyToNetworkType(srcAccessTech), + ServiceState.rilRadioTechnologyToNetworkType(targetAccessTech)); + } + + /** + * Notify the framework that the associated {@link ImsCallSession} may handover from one network + * type to another. + * + * @param srcNetworkType The source network type. + * @param targetNetworkType The target network type. + */ + public void onMayHandover(@Annotation.NetworkType int srcNetworkType, + @Annotation.NetworkType int targetNetworkType) { try { - mListener.callSessionMayHandover(srcAccessTech, targetAccessTech); + mListener.callSessionMayHandover(srcNetworkType, targetNetworkType); } catch (RemoteException e) { throw new RuntimeException(e); } @@ -494,11 +513,29 @@ public class ImsCallSessionListener { * @param targetAccessTech new access technology, defined in * {@link android.telephony.ServiceState}. * @param reasonInfo The {@link ImsReasonInfo} associated with this handover. + * @deprecated Uses hidden radio access technology constants, use + * {@link #onHandover(int, int, ImsReasonInfo)} instead. */ + @Deprecated public void callSessionHandover(int srcAccessTech, int targetAccessTech, ImsReasonInfo reasonInfo) { + // Use new API internally. + onHandover(ServiceState.rilRadioTechnologyToNetworkType(srcAccessTech), + ServiceState.rilRadioTechnologyToNetworkType(targetAccessTech), reasonInfo); + } + + /** + * Notify the framework that the associated {@link ImsCallSession} has handed over from one + * network type to another. + * + * @param srcNetworkType original network type. + * @param targetNetworkType target network type after handover.. + * @param reasonInfo An optional {@link ImsReasonInfo} associated with this handover. + */ + public void onHandover(@Annotation.NetworkType int srcNetworkType, + @Annotation.NetworkType int targetNetworkType, @Nullable ImsReasonInfo reasonInfo) { try { - mListener.callSessionHandover(srcAccessTech, targetAccessTech, reasonInfo); + mListener.callSessionHandover(srcNetworkType, targetNetworkType, reasonInfo); } catch (RemoteException e) { throw new RuntimeException(e); } @@ -510,11 +547,28 @@ public class ImsCallSessionListener { * @param srcAccessTech original access technology * @param targetAccessTech new access technology * @param reasonInfo An {@link ImsReasonInfo} detailing the reason for the failure. + * @deprecated Uses hidden radio access technology constants, use + * {@link #onHandoverFailed(int, int, ImsReasonInfo)} instead */ + @Deprecated public void callSessionHandoverFailed(int srcAccessTech, int targetAccessTech, ImsReasonInfo reasonInfo) { + // Use new API internally. + onHandoverFailed(ServiceState.rilRadioTechnologyToNetworkType(srcAccessTech), + ServiceState.rilRadioTechnologyToNetworkType(targetAccessTech), reasonInfo); + } + + /** + * The IMS call session's access technology change has failed.. + * + * @param srcNetworkType original network type. + * @param targetNetworkType target network type that the handover failed for. + * @param reasonInfo An {@link ImsReasonInfo} detailing the reason for the failure. + */ + public void onHandoverFailed(@Annotation.NetworkType int srcNetworkType, + @Annotation.NetworkType int targetNetworkType, @NonNull ImsReasonInfo reasonInfo) { try { - mListener.callSessionHandoverFailed(srcAccessTech, targetAccessTech, reasonInfo); + mListener.callSessionHandoverFailed(srcNetworkType, targetNetworkType, reasonInfo); } catch (RemoteException e) { throw new RuntimeException(e); } diff --git a/telephony/java/android/telephony/ims/aidl/IImsCallSessionListener.aidl b/telephony/java/android/telephony/ims/aidl/IImsCallSessionListener.aidl index d64e67a40201..cc2ebb9b20bd 100644 --- a/telephony/java/android/telephony/ims/aidl/IImsCallSessionListener.aidl +++ b/telephony/java/android/telephony/ims/aidl/IImsCallSessionListener.aidl @@ -92,11 +92,11 @@ oneway interface IImsCallSessionListener { /** * Notifies of handover information for this call */ - void callSessionHandover(int srcAccessTech, int targetAccessTech, + void callSessionHandover(int srcNetworkType, int targetNetworkType, in ImsReasonInfo reasonInfo); - void callSessionHandoverFailed(int srcAccessTech, int targetAccessTech, + void callSessionHandoverFailed(int srcNetworkType, int targetNetworkType, in ImsReasonInfo reasonInfo); - void callSessionMayHandover(int srcAccessTech, int targetAccessTech); + void callSessionMayHandover(int srcNetworkType, int targetNetworkType); /** * Notifies the TTY mode change by remote party. diff --git a/telephony/java/android/telephony/ims/compat/stub/ImsCallSessionImplBase.java b/telephony/java/android/telephony/ims/compat/stub/ImsCallSessionImplBase.java index acab738737f4..75bd6a7dc648 100644 --- a/telephony/java/android/telephony/ims/compat/stub/ImsCallSessionImplBase.java +++ b/telephony/java/android/telephony/ims/compat/stub/ImsCallSessionImplBase.java @@ -20,6 +20,7 @@ import android.compat.annotation.UnsupportedAppUsage; import android.os.Message; import android.os.RemoteException; import android.telephony.CallQuality; +import android.telephony.ServiceState; import android.telephony.ims.ImsCallProfile; import android.telephony.ims.ImsCallSession; import android.telephony.ims.ImsConferenceState; @@ -547,19 +548,25 @@ public class ImsCallSessionImplBase extends IImsCallSession.Stub { @Override public void callSessionHandover(IImsCallSession i, int srcAccessTech, int targetAccessTech, ImsReasonInfo reasonInfo) throws RemoteException { - mNewListener.callSessionHandover(srcAccessTech, targetAccessTech, reasonInfo); + mNewListener.callSessionHandover( + ServiceState.rilRadioTechnologyToNetworkType(srcAccessTech), + ServiceState.rilRadioTechnologyToNetworkType(targetAccessTech), reasonInfo); } @Override public void callSessionHandoverFailed(IImsCallSession i, int srcAccessTech, int targetAccessTech, ImsReasonInfo reasonInfo) throws RemoteException { - mNewListener.callSessionHandoverFailed(srcAccessTech, targetAccessTech, reasonInfo); + mNewListener.callSessionHandoverFailed( + ServiceState.rilRadioTechnologyToNetworkType(srcAccessTech), + ServiceState.rilRadioTechnologyToNetworkType(targetAccessTech), reasonInfo); } @Override public void callSessionMayHandover(IImsCallSession i, int srcAccessTech, int targetAccessTech) throws RemoteException { - mNewListener.callSessionMayHandover(srcAccessTech, targetAccessTech); + mNewListener.callSessionMayHandover( + ServiceState.rilRadioTechnologyToNetworkType(srcAccessTech), + ServiceState.rilRadioTechnologyToNetworkType(targetAccessTech)); } @Override |