From: Wileen Chiu Date: Sun, 1 Jul 2018 21:21:50 +0000 (-0700) Subject: IMS: Propagate media profile changed message X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=f2ec298d7d60c6cb797b693558ac39cdd9a8cf52;p=android-x86%2Fframeworks-base.git IMS: Propagate media profile changed message - RTT Voice information will be passed to the UI via media profile changed message - The RTT voice information - SPEECH/SILENCE, will be conveyed via the ImsStreamMediaProfile.hasRttAudioSpeech - A connection event will be sent from frameworks to the UI - EVENT_RTT_AUDIO_INDICATION_CHANGED - Add listeners, connection event and extras to propagate media profile changed to the UI Test: Manual Bug: 110976450 Change-Id: I34d2dd612915d65f5047986dabece968c78f0abe --- diff --git a/api/current.txt b/api/current.txt index a3b3722b9f18..59aef04bb787 100755 --- a/api/current.txt +++ b/api/current.txt @@ -41453,10 +41453,12 @@ package android.telecom { field public static final int CAPABILITY_SWAP_CONFERENCE = 8; // 0x8 field public static final java.lang.String EVENT_CALL_MERGE_FAILED = "android.telecom.event.CALL_MERGE_FAILED"; field public static final java.lang.String EVENT_CALL_PULL_FAILED = "android.telecom.event.CALL_PULL_FAILED"; + field public static final java.lang.String EVENT_RTT_AUDIO_INDICATION_CHANGED = "android.telecom.event.RTT_AUDIO_INDICATION_CHANGED"; field public static final java.lang.String EXTRA_ANSWERING_DROPS_FG_CALL = "android.telecom.extra.ANSWERING_DROPS_FG_CALL"; field public static final java.lang.String EXTRA_ANSWERING_DROPS_FG_CALL_APP_NAME = "android.telecom.extra.ANSWERING_DROPS_FG_CALL_APP_NAME"; field public static final java.lang.String EXTRA_CALL_SUBJECT = "android.telecom.extra.CALL_SUBJECT"; field public static final java.lang.String EXTRA_CHILD_ADDRESS = "android.telecom.extra.CHILD_ADDRESS"; + field public static final java.lang.String EXTRA_IS_RTT_AUDIO_PRESENT = "android.telecom.extra.IS_RTT_AUDIO_PRESENT"; field public static final java.lang.String EXTRA_LAST_FORWARDED_NUMBER = "android.telecom.extra.LAST_FORWARDED_NUMBER"; field public static final java.lang.String EXTRA_SIP_INVITE = "android.telecom.extra.SIP_INVITE"; field public static final int PROPERTY_HAS_CDMA_VOICE_PRIVACY = 32; // 0x20 diff --git a/api/system-current.txt b/api/system-current.txt index 43ddfc96b21d..e6fd70d3beed 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -6049,6 +6049,7 @@ package android.telephony.ims { method public void callSessionInviteParticipantsRequestDelivered(); method public void callSessionInviteParticipantsRequestFailed(android.telephony.ims.ImsReasonInfo); method public void callSessionMayHandover(int, int); + method public void callSessionRttAudioIndicatorChanged(android.telephony.ims.ImsStreamMediaProfile); 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); @@ -6465,10 +6466,12 @@ package android.telephony.ims { method public int describeContents(); method public int getAudioDirection(); method public int getAudioQuality(); + method public boolean getRttAudioSpeech(); method public int getRttMode(); method public int getVideoDirection(); method public int getVideoQuality(); method public boolean isRttCall(); + method public void setRttAudioSpeech(boolean); method public void setRttMode(int); method public void writeToParcel(android.os.Parcel, int); field public static final int AUDIO_QUALITY_AMR = 1; // 0x1 diff --git a/telecomm/java/android/telecom/Connection.java b/telecomm/java/android/telecom/Connection.java index 84256037b379..05d5a13092f1 100644 --- a/telecomm/java/android/telecom/Connection.java +++ b/telecomm/java/android/telecom/Connection.java @@ -505,6 +505,14 @@ public abstract class Connection extends Conferenceable { "android.telecom.extra.ORIGINAL_CONNECTION_ID"; /** + * Boolean connection extra key set on the extras passed to + * {@link Connection#sendConnectionEvent} which indicates that audio is present + * on the RTT call when the extra value is true. + */ + public static final String EXTRA_IS_RTT_AUDIO_PRESENT = + "android.telecom.extra.IS_RTT_AUDIO_PRESENT"; + + /** * Connection event used to inform Telecom that it should play the on hold tone. This is used * to play a tone when the peer puts the current call on hold. Sent to Telecom via * {@link #sendConnectionEvent(String, Bundle)}. @@ -619,6 +627,13 @@ public abstract class Connection extends Conferenceable { */ public static final String EXTRA_SIP_INVITE = "android.telecom.extra.SIP_INVITE"; + /** + * Connection event used to inform an {@link InCallService} that the RTT audio indication + * has changed. + */ + public static final String EVENT_RTT_AUDIO_INDICATION_CHANGED = + "android.telecom.event.RTT_AUDIO_INDICATION_CHANGED"; + // Flag controlling whether PII is emitted into the logs private static final boolean PII_DEBUG = Log.isLoggable(android.util.Log.DEBUG); diff --git a/telephony/java/android/telephony/ims/ImsCallSession.java b/telephony/java/android/telephony/ims/ImsCallSession.java index df903cc270a2..397d5d9b4eb5 100644 --- a/telephony/java/android/telephony/ims/ImsCallSession.java +++ b/telephony/java/android/telephony/ims/ImsCallSession.java @@ -443,6 +443,13 @@ public class ImsCallSession { public void callSessionRttMessageReceived(String rttMessage) { // no-op } + + /** + * While in call, there has been a change in RTT audio indicator. + */ + public void callSessionRttAudioIndicatorChanged(ImsStreamMediaProfile profile) { + // no-op + } } private final IImsCallSession miSession; @@ -1397,6 +1404,16 @@ public class ImsCallSession { mListener.callSessionRttMessageReceived(rttMessage); } } + + /** + * While in call, there has been a change in RTT audio indicator. + */ + @Override + public void callSessionRttAudioIndicatorChanged(ImsStreamMediaProfile profile) { + if (mListener != null) { + mListener.callSessionRttAudioIndicatorChanged(profile); + } + } } /** diff --git a/telephony/java/android/telephony/ims/ImsCallSessionListener.java b/telephony/java/android/telephony/ims/ImsCallSessionListener.java index a7f124a5b791..a4696a3f93aa 100644 --- a/telephony/java/android/telephony/ims/ImsCallSessionListener.java +++ b/telephony/java/android/telephony/ims/ImsCallSessionListener.java @@ -599,5 +599,18 @@ public class ImsCallSessionListener { throw new RuntimeException(e); } } + + /** + * While in call, there has been a change in RTT audio indicator. + * + * @param profile updated ImsStreamMediaProfile + */ + public void callSessionRttAudioIndicatorChanged(ImsStreamMediaProfile profile) { + try { + mListener.callSessionRttAudioIndicatorChanged(profile); + } catch (RemoteException e) { + throw new RuntimeException(e); + } + } } diff --git a/telephony/java/android/telephony/ims/ImsStreamMediaProfile.java b/telephony/java/android/telephony/ims/ImsStreamMediaProfile.java index 52d72b5847b5..837ef54a2f24 100644 --- a/telephony/java/android/telephony/ims/ImsStreamMediaProfile.java +++ b/telephony/java/android/telephony/ims/ImsStreamMediaProfile.java @@ -97,6 +97,9 @@ public final class ImsStreamMediaProfile implements Parcelable { // Rtt related information /** @hide */ public int mRttMode; + // RTT Audio Speech Indicator + /** @hide */ + public boolean mHasRttAudioSpeech = false; /** @hide */ public ImsStreamMediaProfile(Parcel in) { @@ -197,7 +200,8 @@ public final class ImsStreamMediaProfile implements Parcelable { ", audioDirection=" + mAudioDirection + ", videoQuality=" + mVideoQuality + ", videoDirection=" + mVideoDirection + - ", rttMode=" + mRttMode + " }"; + ", rttMode=" + mRttMode + + ", hasRttAudioSpeech=" + mHasRttAudioSpeech + " }"; } @Override @@ -212,6 +216,7 @@ public final class ImsStreamMediaProfile implements Parcelable { out.writeInt(mVideoQuality); out.writeInt(mVideoDirection); out.writeInt(mRttMode); + out.writeBoolean(mHasRttAudioSpeech); } private void readFromParcel(Parcel in) { @@ -220,6 +225,7 @@ public final class ImsStreamMediaProfile implements Parcelable { mVideoQuality = in.readInt(); mVideoDirection = in.readInt(); mRttMode = in.readInt(); + mHasRttAudioSpeech = in.readBoolean(); } public static final Creator CREATOR = @@ -250,6 +256,10 @@ public final class ImsStreamMediaProfile implements Parcelable { mRttMode = rttMode; } + public void setRttAudioSpeech(boolean audioOn) { + mHasRttAudioSpeech = audioOn; + } + public int getAudioQuality() { return mAudioQuality; } @@ -269,4 +279,8 @@ public final class ImsStreamMediaProfile implements Parcelable { public int getRttMode() { return mRttMode; } + + public boolean getRttAudioSpeech() { + return mHasRttAudioSpeech; + } } diff --git a/telephony/java/android/telephony/ims/aidl/IImsCallSessionListener.aidl b/telephony/java/android/telephony/ims/aidl/IImsCallSessionListener.aidl index f25b4b148605..d0b31e16a4f0 100644 --- a/telephony/java/android/telephony/ims/aidl/IImsCallSessionListener.aidl +++ b/telephony/java/android/telephony/ims/aidl/IImsCallSessionListener.aidl @@ -138,4 +138,10 @@ oneway interface IImsCallSessionListener { * @param rttMessage Received RTT message */ void callSessionRttMessageReceived(in String rttMessage); + + /* + * While in call, there has been a change in RTT audio indicator. + * @param profile updated ImsStreamMediaProfile + */ + void callSessionRttAudioIndicatorChanged(in ImsStreamMediaProfile profile); } diff --git a/telephony/java/android/telephony/ims/compat/stub/ImsCallSessionImplBase.java b/telephony/java/android/telephony/ims/compat/stub/ImsCallSessionImplBase.java index 23de2fd3c32c..bc58e46806c2 100644 --- a/telephony/java/android/telephony/ims/compat/stub/ImsCallSessionImplBase.java +++ b/telephony/java/android/telephony/ims/compat/stub/ImsCallSessionImplBase.java @@ -591,5 +591,11 @@ public class ImsCallSessionImplBase extends IImsCallSession.Stub { public void callSessionRttMessageReceived(String rttMessage) throws RemoteException { mNewListener.callSessionRttMessageReceived(rttMessage); } + + @Override + public void callSessionRttAudioIndicatorChanged(ImsStreamMediaProfile profile) + throws RemoteException { + mNewListener.callSessionRttAudioIndicatorChanged(profile); + } } } diff --git a/telephony/java/com/android/ims/internal/IImsCallSessionListener.aidl b/telephony/java/com/android/ims/internal/IImsCallSessionListener.aidl index a8e8b7dd03aa..bbb27af1ba36 100644 --- a/telephony/java/com/android/ims/internal/IImsCallSessionListener.aidl +++ b/telephony/java/com/android/ims/internal/IImsCallSessionListener.aidl @@ -152,4 +152,10 @@ oneway interface IImsCallSessionListener { * @param rttMessage Received RTT message */ void callSessionRttMessageReceived(in String rttMessage); + + /* + * While in call, there has been a change in RTT audio indicator. + * @param profile updated ImsStreamMediaProfile + */ + void callSessionRttAudioIndicatorChanged(in ImsStreamMediaProfile profile); }