1 /*
2  * Copyright (C) 2018 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License
15  */
16 
17 package android.telephony.ims;
18 
19 import android.annotation.NonNull;
20 import android.annotation.Nullable;
21 import android.annotation.SystemApi;
22 import android.annotation.TestApi;
23 import android.os.RemoteException;
24 import android.telephony.Annotation;
25 import android.telephony.CallQuality;
26 import android.telephony.ServiceState;
27 import android.telephony.ims.aidl.IImsCallSessionListener;
28 import android.telephony.ims.stub.ImsCallSessionImplBase;
29 
30 import com.android.ims.internal.IImsCallSession;
31 
32 /**
33  * Listener interface for notifying the Framework's {@link ImsCallSession} for updates to an ongoing
34  * IMS call.
35  *
36  * @hide
37  */
38 // DO NOT remove or change the existing APIs, only add new ones to this implementation or you
39 // will break other implementations of ImsCallSessionListener maintained by other ImsServices.
40 // TODO: APIs in here do not conform to API guidelines yet. This can be changed if
41 // ImsCallSessionListenerConverter is also changed.
42 @SystemApi
43 @TestApi
44 public class ImsCallSessionListener {
45 
46     private final IImsCallSessionListener mListener;
47 
48     /** @hide */
ImsCallSessionListener(IImsCallSessionListener l)49     public ImsCallSessionListener(IImsCallSessionListener l) {
50         mListener = l;
51     }
52 
53     /**
54      * A request has been sent out to initiate a new IMS call session and a 1xx response has been
55      * received from the network.
56      */
callSessionProgressing(ImsStreamMediaProfile profile)57     public void callSessionProgressing(ImsStreamMediaProfile profile) {
58         try {
59             mListener.callSessionProgressing(profile);
60         } catch (RemoteException e) {
61             e.rethrowFromSystemServer();
62         }
63     }
64 
65     /**
66      * The IMS call session has been initiated.
67      *
68      * @param profile the associated {@link ImsCallProfile}.
69      */
callSessionInitiated(ImsCallProfile profile)70     public void callSessionInitiated(ImsCallProfile profile) {
71         try {
72             mListener.callSessionInitiated(profile);
73         } catch (RemoteException e) {
74             e.rethrowFromSystemServer();
75         }
76     }
77 
78     /**
79      * The IMS call session establishment has failed.
80      *
81      * @param reasonInfo {@link ImsReasonInfo} detailing the reason of the IMS call session
82      * establishment failure.
83      */
callSessionInitiatedFailed(ImsReasonInfo reasonInfo)84     public void callSessionInitiatedFailed(ImsReasonInfo reasonInfo) {
85         try {
86             mListener.callSessionInitiatedFailed(reasonInfo);
87         } catch (RemoteException e) {
88             e.rethrowFromSystemServer();
89         }
90     }
91 
92     /**
93      * The IMS call session has been terminated.
94      *
95      * @param reasonInfo {@link ImsReasonInfo} detailing the reason of the session termination.
96      */
callSessionTerminated(ImsReasonInfo reasonInfo)97     public void callSessionTerminated(ImsReasonInfo reasonInfo) {
98         try {
99             mListener.callSessionTerminated(reasonInfo);
100         } catch (RemoteException e) {
101             e.rethrowFromSystemServer();
102         }
103     }
104 
105     /**
106      * The IMS call session has started the process of holding the call. If it fails,
107      * {@link #callSessionHoldFailed(ImsReasonInfo)} should be called.
108      *
109      * If the IMS call session is resumed, call {@link #callSessionResumed(ImsCallProfile)}.
110      *
111      * @param profile The associated {@link ImsCallProfile} of the call session that has been put
112      * on hold.
113      */
callSessionHeld(ImsCallProfile profile)114     public void callSessionHeld(ImsCallProfile profile) {
115         try {
116             mListener.callSessionHeld(profile);
117         } catch (RemoteException e) {
118             e.rethrowFromSystemServer();
119         }
120     }
121 
122     /**
123      * The IMS call session has failed to be held.
124      *
125      * @param reasonInfo {@link ImsReasonInfo} detailing the reason of the session hold failure.
126      */
callSessionHoldFailed(ImsReasonInfo reasonInfo)127     public void callSessionHoldFailed(ImsReasonInfo reasonInfo) {
128         try {
129             mListener.callSessionHoldFailed(reasonInfo);
130         } catch (RemoteException e) {
131             e.rethrowFromSystemServer();
132         }
133     }
134 
135     /**
136      * This IMS Call session has been put on hold by the remote party.
137      *
138      * @param profile The {@link ImsCallProfile} associated with this IMS call session.
139      */
callSessionHoldReceived(ImsCallProfile profile)140     public void callSessionHoldReceived(ImsCallProfile profile) {
141         try {
142             mListener.callSessionHoldReceived(profile);
143         } catch (RemoteException e) {
144             e.rethrowFromSystemServer();
145         }
146     }
147 
148     /**
149      * The IMS call session has started the process of resuming the call. If the process of resuming
150      * the call fails, call {@link #callSessionResumeFailed(ImsReasonInfo)}.
151      *
152      * @param profile The {@link ImsCallProfile} associated with this IMS call session.
153      */
callSessionResumed(ImsCallProfile profile)154     public void callSessionResumed(ImsCallProfile profile) {
155         try {
156             mListener.callSessionResumed(profile);
157         } catch (RemoteException e) {
158             e.rethrowFromSystemServer();
159         }
160     }
161 
162     /**
163      * The IMS call session resume has failed.
164      *
165      * @param reasonInfo {@link ImsReasonInfo} containing the detailed reason of the session resume
166      * failure.
167      */
callSessionResumeFailed(ImsReasonInfo reasonInfo)168     public void callSessionResumeFailed(ImsReasonInfo reasonInfo) {
169         try {
170             mListener.callSessionResumeFailed(reasonInfo);
171         } catch (RemoteException e) {
172             e.rethrowFromSystemServer();
173         }
174     }
175 
176     /**
177      * The remote party has resumed this IMS call session.
178      *
179      * @param profile {@link ImsCallProfile} associated with the IMS call session.
180      */
callSessionResumeReceived(ImsCallProfile profile)181     public void callSessionResumeReceived(ImsCallProfile profile) {
182         try {
183             mListener.callSessionResumeReceived(profile);
184         } catch (RemoteException e) {
185             e.rethrowFromSystemServer();
186         }
187     }
188 
189     /**
190      * The IMS call session merge has been started.  At this point, the {@code newSession}
191      * represents the IMS call session which represents the new merged conference and has been
192      * initiated to the IMS conference server.
193      *
194      * @param newSession the {@link ImsCallSessionImplBase} that represents the merged active & held
195      * sessions.
196      * @param profile The {@link ImsCallProfile} associated with this IMS call session.
197      */
callSessionMergeStarted(ImsCallSessionImplBase newSession, ImsCallProfile profile)198     public void callSessionMergeStarted(ImsCallSessionImplBase newSession, ImsCallProfile profile)
199     {
200         try {
201             mListener.callSessionMergeStarted(newSession != null ?
202                             newSession.getServiceImpl() : null, profile);
203         } catch (RemoteException e) {
204             e.rethrowFromSystemServer();
205         }
206     }
207 
208     /**
209      * Compatibility method for older implementations.
210      * See {@link #callSessionMergeStarted(ImsCallSessionImplBase, ImsCallProfile)}.
211      *
212      * @hide
213      */
callSessionMergeStarted(IImsCallSession newSession, ImsCallProfile profile)214     public void callSessionMergeStarted(IImsCallSession newSession, ImsCallProfile profile)
215     {
216         try {
217             mListener.callSessionMergeStarted(newSession, profile);
218         } catch (RemoteException e) {
219             e.rethrowFromSystemServer();
220         }
221     }
222 
223     /**
224      * The session merge is successful and the merged {@link ImsCallSession} is active.
225      *
226      * @param newSession the new {@link ImsCallSessionImplBase}
227      *                  that represents the conference IMS call
228      * session.
229      */
callSessionMergeComplete(ImsCallSessionImplBase newSession)230     public void callSessionMergeComplete(ImsCallSessionImplBase newSession) {
231         try {
232             mListener.callSessionMergeComplete(newSession != null ?
233                     newSession.getServiceImpl() : null);
234         } catch (RemoteException e) {
235             e.rethrowFromSystemServer();
236         }
237     }
238 
239     /**
240      * Compatibility method for older implementations of ImsService.
241      *
242      * See {@link #callSessionMergeComplete(ImsCallSessionImplBase)}}.
243      *
244      * @hide
245      */
callSessionMergeComplete(IImsCallSession newSession)246     public void callSessionMergeComplete(IImsCallSession newSession) {
247         try {
248             mListener.callSessionMergeComplete(newSession);
249         } catch (RemoteException e) {
250             e.rethrowFromSystemServer();
251         }
252     }
253 
254     /**
255      * The IMS call session merge has failed.
256      *
257      * @param reasonInfo {@link ImsReasonInfo} contining the reason for the call merge failure.
258      */
callSessionMergeFailed(ImsReasonInfo reasonInfo)259     public void callSessionMergeFailed(ImsReasonInfo reasonInfo) {
260         try {
261             mListener.callSessionMergeFailed(reasonInfo);
262         } catch (RemoteException e) {
263             e.rethrowFromSystemServer();
264         }
265     }
266 
267     /**
268      * The IMS call session profile has been updated. Does not include holding or resuming a call.
269      *
270      * @param profile The {@link ImsCallProfile} associated with the updated IMS call session.
271      */
callSessionUpdated(ImsCallProfile profile)272     public void callSessionUpdated(ImsCallProfile profile) {
273         try {
274             mListener.callSessionUpdated(profile);
275         } catch (RemoteException e) {
276             e.rethrowFromSystemServer();
277         }
278     }
279 
280     /**
281      * The IMS call session profile update has failed.
282      *
283      * @param reasonInfo {@link ImsReasonInfo} containing a reason for the session update failure.
284      */
callSessionUpdateFailed(ImsReasonInfo reasonInfo)285     public void callSessionUpdateFailed(ImsReasonInfo reasonInfo) {
286         try {
287             mListener.callSessionUpdateFailed(reasonInfo);
288         } catch (RemoteException e) {
289             e.rethrowFromSystemServer();
290         }
291     }
292 
293     /**
294      * The IMS call session profile has received an update from the remote user.
295      *
296      * @param profile The new {@link ImsCallProfile} associated with the update.
297      */
callSessionUpdateReceived(ImsCallProfile profile)298     public void callSessionUpdateReceived(ImsCallProfile profile) {
299         try {
300             mListener.callSessionUpdateReceived(profile);
301         } catch (RemoteException e) {
302             e.rethrowFromSystemServer();
303         }
304     }
305 
306     /**
307      * Called when the session has been extended to a conference session.
308      *
309      * If the conference extension fails, call
310      * {@link #callSessionConferenceExtendFailed(ImsReasonInfo)}.
311      *
312      * @param newSession the session object that is extended to the conference from the active
313      * IMS Call session.
314      * @param profile The {@link ImsCallProfile} associated with the IMS call session.
315      */
callSessionConferenceExtended(ImsCallSessionImplBase newSession, ImsCallProfile profile)316     public void callSessionConferenceExtended(ImsCallSessionImplBase newSession,
317             ImsCallProfile profile) {
318         try {
319             mListener.callSessionConferenceExtended(
320                     newSession != null ? newSession.getServiceImpl() : null, profile);
321         } catch (RemoteException e) {
322             e.rethrowFromSystemServer();
323         }
324     }
325 
326     /**
327      * Compatibility method to interface with older versions of ImsService.
328      * See {@link #callSessionConferenceExtended(ImsCallSessionImplBase, ImsCallProfile)}.
329      *
330      * @hide
331      */
callSessionConferenceExtended(IImsCallSession newSession, ImsCallProfile profile)332     public void callSessionConferenceExtended(IImsCallSession newSession, ImsCallProfile profile) {
333         try {
334             mListener.callSessionConferenceExtended(newSession, profile);
335         } catch (RemoteException e) {
336             e.rethrowFromSystemServer();
337         }
338     }
339 
340     /**
341      * The previous conference extension has failed.
342      *
343      * @param reasonInfo {@link ImsReasonInfo} containing the detailed reason of the conference
344      * extension failure.
345      */
callSessionConferenceExtendFailed(ImsReasonInfo reasonInfo)346     public void callSessionConferenceExtendFailed(ImsReasonInfo reasonInfo) {
347         try {
348             mListener.callSessionConferenceExtendFailed(reasonInfo);
349         } catch (RemoteException e) {
350             e.rethrowFromSystemServer();
351         }
352     }
353 
354     /**
355      * A conference extension has been received received from the remote party.
356      *
357      * @param newSession An {@link ImsCallSessionImplBase}
358      *                   representing the extended IMS call session.
359      * @param profile The {@link ImsCallProfile} associated with the new IMS call session.
360      */
callSessionConferenceExtendReceived(ImsCallSessionImplBase newSession, ImsCallProfile profile)361     public void callSessionConferenceExtendReceived(ImsCallSessionImplBase newSession,
362             ImsCallProfile profile) {
363         try {
364             mListener.callSessionConferenceExtendReceived(newSession != null
365                     ? newSession.getServiceImpl() : null, profile);
366         } catch (RemoteException e) {
367             e.rethrowFromSystemServer();
368         }
369     }
370 
371     /**
372      * Compatibility method to interface with older versions of ImsService.
373      * See {@link #callSessionConferenceExtendReceived(ImsCallSessionImplBase, ImsCallProfile)}.
374      *
375      * @hide
376      */
callSessionConferenceExtendReceived(IImsCallSession newSession, ImsCallProfile profile)377     public void callSessionConferenceExtendReceived(IImsCallSession newSession,
378             ImsCallProfile profile) {
379         try {
380             mListener.callSessionConferenceExtendReceived(newSession, profile);
381         } catch (RemoteException e) {
382             e.rethrowFromSystemServer();
383         }
384     }
385 
386     /**
387      * The request to invite participants to the conference has been delivered to the conference
388      * server.
389      */
callSessionInviteParticipantsRequestDelivered()390     public void callSessionInviteParticipantsRequestDelivered() {
391         try {
392             mListener.callSessionInviteParticipantsRequestDelivered();
393         } catch (RemoteException e) {
394             e.rethrowFromSystemServer();
395         }
396     }
397 
398     /**
399      * The previous request to invite participants to the conference (see
400      * {@link #callSessionInviteParticipantsRequestDelivered()}) has failed.
401      *
402      * @param reasonInfo {@link ImsReasonInfo} detailing the reason forthe conference invitation
403      * failure.
404      */
callSessionInviteParticipantsRequestFailed(ImsReasonInfo reasonInfo)405     public void callSessionInviteParticipantsRequestFailed(ImsReasonInfo reasonInfo)
406     {
407         try {
408             mListener.callSessionInviteParticipantsRequestFailed(reasonInfo);
409         } catch (RemoteException e) {
410             e.rethrowFromSystemServer();
411         }
412     }
413 
414     /**
415      * The request to remove participants from the conference has been delivered to the conference
416      * server.
417      */
callSessionRemoveParticipantsRequestDelivered()418     public void callSessionRemoveParticipantsRequestDelivered() {
419         try {
420             mListener.callSessionRemoveParticipantsRequestDelivered();
421         } catch (RemoteException e) {
422             e.rethrowFromSystemServer();
423         }
424     }
425 
426     /**
427      * The previous request to remove participants from the conference (see
428      * {@link #callSessionRemoveParticipantsRequestDelivered()}) has failed.
429      *
430      * @param reasonInfo {@link ImsReasonInfo} detailing the reason for the conference removal
431      * failure.
432      */
callSessionRemoveParticipantsRequestFailed(ImsReasonInfo reasonInfo)433     public void callSessionRemoveParticipantsRequestFailed(ImsReasonInfo reasonInfo)
434     {
435         try {
436             mListener.callSessionInviteParticipantsRequestFailed(reasonInfo);
437         } catch (RemoteException e) {
438             e.rethrowFromSystemServer();
439         }
440     }
441 
442     /**
443      * The IMS call session's conference state has changed.
444      *
445      * @param state The new {@link ImsConferenceState} associated with the conference.
446      */
callSessionConferenceStateUpdated(ImsConferenceState state)447     public void callSessionConferenceStateUpdated(ImsConferenceState state) {
448         try {
449             mListener.callSessionConferenceStateUpdated(state);
450         } catch (RemoteException e) {
451             e.rethrowFromSystemServer();
452         }
453     }
454 
455     /**
456      * The IMS call session has received a Ussd message.
457      *
458      * @param mode The mode of the USSD message, either
459      * {@link ImsCallSessionImplBase#USSD_MODE_NOTIFY} or
460      * {@link ImsCallSessionImplBase#USSD_MODE_REQUEST}.
461      * @param ussdMessage The USSD message.
462      */
callSessionUssdMessageReceived(int mode, String ussdMessage)463     public void callSessionUssdMessageReceived(int mode, String ussdMessage)
464     {
465         try {
466             mListener.callSessionUssdMessageReceived(mode, ussdMessage);
467         } catch (RemoteException e) {
468             e.rethrowFromSystemServer();
469         }
470     }
471 
472     /**
473      * An {@link ImsCallSession} may potentially handover from one radio
474      * technology to another.
475      *
476      * @param srcAccessTech The source radio access technology; one of the access technology
477      * constants defined in {@link android.telephony.ServiceState}. For example
478      * {@link android.telephony.ServiceState#RIL_RADIO_TECHNOLOGY_LTE}.
479      * @param targetAccessTech The target radio access technology; one of the access technology
480      * constants defined in {@link android.telephony.ServiceState}. For example
481      * {@link android.telephony.ServiceState#RIL_RADIO_TECHNOLOGY_LTE}.
482      * @deprecated Uses hidden constants for radio access technology, use
483      * {@link #onMayHandover(int, int)} instead.
484      */
485     @Deprecated
callSessionMayHandover(int srcAccessTech, int targetAccessTech)486     public void callSessionMayHandover(int srcAccessTech, int targetAccessTech) {
487         // Use new API internally.
488         onMayHandover(ServiceState.rilRadioTechnologyToNetworkType(srcAccessTech),
489                 ServiceState.rilRadioTechnologyToNetworkType(targetAccessTech));
490     }
491 
492     /**
493      * Notify the framework that the associated {@link ImsCallSession} may handover from one network
494      * type to another.
495      *
496      * @param srcNetworkType The source network type.
497      * @param targetNetworkType The target network type.
498      */
onMayHandover(@nnotation.NetworkType int srcNetworkType, @Annotation.NetworkType int targetNetworkType)499     public void onMayHandover(@Annotation.NetworkType int srcNetworkType,
500             @Annotation.NetworkType int targetNetworkType) {
501         try {
502             mListener.callSessionMayHandover(srcNetworkType, targetNetworkType);
503         } catch (RemoteException e) {
504             e.rethrowFromSystemServer();
505         }
506     }
507 
508     /**
509      * The IMS call session's access technology has changed.
510      *
511      * @param srcAccessTech original access technology, defined in
512      * {@link android.telephony.ServiceState}.
513      * @param targetAccessTech new access technology, defined in
514      * {@link android.telephony.ServiceState}.
515      * @param reasonInfo The {@link ImsReasonInfo} associated with this handover.
516      * @deprecated Uses hidden radio access technology constants, use
517      * {@link #onHandover(int, int, ImsReasonInfo)} instead.
518      */
519     @Deprecated
callSessionHandover(int srcAccessTech, int targetAccessTech, ImsReasonInfo reasonInfo)520     public void callSessionHandover(int srcAccessTech, int targetAccessTech,
521             ImsReasonInfo reasonInfo) {
522         // Use new API internally.
523         onHandover(ServiceState.rilRadioTechnologyToNetworkType(srcAccessTech),
524                 ServiceState.rilRadioTechnologyToNetworkType(targetAccessTech), reasonInfo);
525     }
526 
527     /**
528      * Notify the framework that the associated {@link ImsCallSession} has handed over from one
529      * network type to another.
530      *
531      * @param srcNetworkType original network type.
532      * @param targetNetworkType target network type after handover..
533      * @param reasonInfo An optional {@link ImsReasonInfo} associated with this handover.
534      */
onHandover(@nnotation.NetworkType int srcNetworkType, @Annotation.NetworkType int targetNetworkType, @Nullable ImsReasonInfo reasonInfo)535     public void onHandover(@Annotation.NetworkType int srcNetworkType,
536             @Annotation.NetworkType int targetNetworkType, @Nullable ImsReasonInfo reasonInfo) {
537         try {
538             mListener.callSessionHandover(srcNetworkType, targetNetworkType, reasonInfo);
539         } catch (RemoteException e) {
540             e.rethrowFromSystemServer();
541         }
542     }
543 
544     /**
545      * The IMS call session's access technology change has failed..
546      *
547      * @param srcAccessTech original access technology
548      * @param targetAccessTech new access technology
549      * @param reasonInfo An {@link ImsReasonInfo} detailing the reason for the failure.
550      * @deprecated Uses hidden radio access technology constants, use
551      * {@link #onHandoverFailed(int, int, ImsReasonInfo)} instead
552      */
553     @Deprecated
callSessionHandoverFailed(int srcAccessTech, int targetAccessTech, ImsReasonInfo reasonInfo)554     public void callSessionHandoverFailed(int srcAccessTech, int targetAccessTech,
555             ImsReasonInfo reasonInfo) {
556         // Use new API internally.
557         onHandoverFailed(ServiceState.rilRadioTechnologyToNetworkType(srcAccessTech),
558                 ServiceState.rilRadioTechnologyToNetworkType(targetAccessTech), reasonInfo);
559     }
560 
561     /**
562      * The IMS call session's access technology change has failed..
563      *
564      * @param srcNetworkType original network type.
565      * @param targetNetworkType target network type that the handover failed for.
566      * @param reasonInfo An {@link ImsReasonInfo} detailing the reason for the failure.
567      */
onHandoverFailed(@nnotation.NetworkType int srcNetworkType, @Annotation.NetworkType int targetNetworkType, @NonNull ImsReasonInfo reasonInfo)568     public void onHandoverFailed(@Annotation.NetworkType int srcNetworkType,
569             @Annotation.NetworkType int targetNetworkType, @NonNull ImsReasonInfo reasonInfo) {
570         try {
571             mListener.callSessionHandoverFailed(srcNetworkType, targetNetworkType, reasonInfo);
572         } catch (RemoteException e) {
573             e.rethrowFromSystemServer();
574         }
575     }
576 
577     /**
578      * The TTY mode has been changed by the remote party.
579      *
580      * @param mode one of the following: -
581      *             {@link com.android.internal.telephony.Phone#TTY_MODE_OFF} -
582      *             {@link com.android.internal.telephony.Phone#TTY_MODE_FULL} -
583      *             {@link com.android.internal.telephony.Phone#TTY_MODE_HCO} -
584      *             {@link com.android.internal.telephony.Phone#TTY_MODE_VCO}
585      */
callSessionTtyModeReceived(int mode)586     public void callSessionTtyModeReceived(int mode) {
587         try {
588             mListener.callSessionTtyModeReceived(mode);
589         } catch (RemoteException e) {
590             e.rethrowFromSystemServer();
591         }
592     }
593 
594     /**
595      * The multiparty state has been changed for this {@code ImsCallSession}.
596      *
597      * @param isMultiParty {@code true} if the session became multiparty, {@code false} otherwise.
598      */
callSessionMultipartyStateChanged(boolean isMultiParty)599     public void callSessionMultipartyStateChanged(boolean isMultiParty) {
600         try {
601             mListener.callSessionMultipartyStateChanged(isMultiParty);
602         } catch (RemoteException e) {
603             e.rethrowFromSystemServer();
604         }
605     }
606 
607     /**
608      * Supplementary service information has been received for the current IMS call session.
609      *
610      * @param suppSrvNotification The {@link ImsSuppServiceNotification} containing the change.
611      */
callSessionSuppServiceReceived(ImsSuppServiceNotification suppSrvNotification)612     public void callSessionSuppServiceReceived(ImsSuppServiceNotification suppSrvNotification)
613     {
614         try {
615             mListener.callSessionSuppServiceReceived(suppSrvNotification);
616         } catch (RemoteException e) {
617             e.rethrowFromSystemServer();
618         }
619     }
620 
621     /**
622      * An RTT modify request has been received from the remote party.
623      *
624      * @param callProfile An {@link ImsCallProfile} with the updated attributes
625      */
callSessionRttModifyRequestReceived(ImsCallProfile callProfile)626     public void callSessionRttModifyRequestReceived(ImsCallProfile callProfile)
627     {
628         try {
629             mListener.callSessionRttModifyRequestReceived(callProfile);
630         } catch (RemoteException e) {
631             e.rethrowFromSystemServer();
632         }
633     }
634 
635     /**
636      * An RTT modify response has been received.
637      *
638      * @param status the received response for RTT modify request.
639      */
callSessionRttModifyResponseReceived(int status)640     public void callSessionRttModifyResponseReceived(int status) {
641         try {
642             mListener.callSessionRttModifyResponseReceived(status);
643         } catch (RemoteException e) {
644             e.rethrowFromSystemServer();
645         }
646     }
647 
648     /**
649      * An RTT message has been received from the remote party.
650      *
651      * @param rttMessage The RTT message that has been received.
652      */
callSessionRttMessageReceived(String rttMessage)653     public void callSessionRttMessageReceived(String rttMessage) {
654         try {
655             mListener.callSessionRttMessageReceived(rttMessage);
656         } catch (RemoteException e) {
657             e.rethrowFromSystemServer();
658         }
659     }
660 
661     /**
662      * While in call, there has been a change in RTT audio indicator.
663      *
664      * @param profile updated ImsStreamMediaProfile
665      */
callSessionRttAudioIndicatorChanged(@onNull ImsStreamMediaProfile profile)666     public void callSessionRttAudioIndicatorChanged(@NonNull ImsStreamMediaProfile profile) {
667         try {
668             mListener.callSessionRttAudioIndicatorChanged(profile);
669         } catch (RemoteException e) {
670             e.rethrowFromSystemServer();
671         }
672     }
673 
674     /**
675      * The call quality has changed.
676      *
677      * @param callQuality The new call quality
678      */
callQualityChanged(@onNull CallQuality callQuality)679     public void callQualityChanged(@NonNull CallQuality callQuality) {
680         try {
681             mListener.callQualityChanged(callQuality);
682         } catch (RemoteException e) {
683             e.rethrowFromSystemServer();
684         }
685     }
686 }
687 
688