(IMS Threading refactoring) Telephony IMS classes to schedule IMS callback on the main thread
Modified to schedule callbacks on main thread or callback executor rather than on binder thread Introducing utility api runWithCleanCallingIdentity to run the action in executor Test: atest FrameworksTelephonyTests:ImsCallTest Bug: 197989471 Change-Id: Icdb0750d63f242eb79351781a4b75ca745c30083 Merged-In: Icdb0750d63f242eb79351781a4b75ca745c30083
This commit is contained in:
@@ -107,6 +107,25 @@ public final class TelephonyUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convenience method for running the provided action in the provided
|
||||||
|
* executor enclosed in
|
||||||
|
* {@link Binder#clearCallingIdentity}/{@link Binder#restoreCallingIdentity}
|
||||||
|
*
|
||||||
|
* Any exception thrown by the given action will need to be handled by caller.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public static void runWithCleanCallingIdentity(
|
||||||
|
@NonNull Runnable action, @NonNull Executor executor) {
|
||||||
|
if (action != null) {
|
||||||
|
if (executor != null) {
|
||||||
|
executor.execute(() -> runWithCleanCallingIdentity(action));
|
||||||
|
} else {
|
||||||
|
runWithCleanCallingIdentity(action);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convenience method for running the provided action enclosed in
|
* Convenience method for running the provided action enclosed in
|
||||||
|
|||||||
@@ -27,10 +27,12 @@ import android.util.Log;
|
|||||||
|
|
||||||
import com.android.ims.internal.IImsCallSession;
|
import com.android.ims.internal.IImsCallSession;
|
||||||
import com.android.ims.internal.IImsVideoCallProvider;
|
import com.android.ims.internal.IImsVideoCallProvider;
|
||||||
|
import com.android.internal.telephony.util.TelephonyUtils;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
import java.util.concurrent.Executor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides the call initiation/termination, and media exchange between two IMS endpoints.
|
* Provides the call initiation/termination, and media exchange between two IMS endpoints.
|
||||||
@@ -522,6 +524,7 @@ public class ImsCallSession {
|
|||||||
private final IImsCallSession miSession;
|
private final IImsCallSession miSession;
|
||||||
private boolean mClosed = false;
|
private boolean mClosed = false;
|
||||||
private Listener mListener;
|
private Listener mListener;
|
||||||
|
private Executor mListenerExecutor = Runnable::run;
|
||||||
|
|
||||||
/** @hide */
|
/** @hide */
|
||||||
public ImsCallSession(IImsCallSession iSession) {
|
public ImsCallSession(IImsCallSession iSession) {
|
||||||
@@ -538,9 +541,9 @@ public class ImsCallSession {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** @hide */
|
/** @hide */
|
||||||
public ImsCallSession(IImsCallSession iSession, Listener listener) {
|
public ImsCallSession(IImsCallSession iSession, Listener listener, Executor executor) {
|
||||||
this(iSession);
|
this(iSession);
|
||||||
setListener(listener);
|
setListener(listener, executor);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -738,10 +741,14 @@ public class ImsCallSession {
|
|||||||
* override the previous listener.
|
* override the previous listener.
|
||||||
*
|
*
|
||||||
* @param listener to listen to the session events of this object
|
* @param listener to listen to the session events of this object
|
||||||
|
* @param executor an Executor that will execute callbacks
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
public void setListener(Listener listener) {
|
public void setListener(Listener listener, Executor executor) {
|
||||||
mListener = listener;
|
mListener = listener;
|
||||||
|
if (executor != null) {
|
||||||
|
mListenerExecutor = executor;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1206,42 +1213,48 @@ public class ImsCallSession {
|
|||||||
@Override
|
@Override
|
||||||
public void callSessionInitiating(ImsCallProfile profile) {
|
public void callSessionInitiating(ImsCallProfile profile) {
|
||||||
if (mListener != null) {
|
if (mListener != null) {
|
||||||
mListener.callSessionInitiating(ImsCallSession.this, profile);
|
TelephonyUtils.runWithCleanCallingIdentity(()-> mListener.callSessionInitiating(
|
||||||
|
ImsCallSession.this, profile), mListenerExecutor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void callSessionProgressing(ImsStreamMediaProfile profile) {
|
public void callSessionProgressing(ImsStreamMediaProfile profile) {
|
||||||
if (mListener != null) {
|
if (mListener != null) {
|
||||||
mListener.callSessionProgressing(ImsCallSession.this, profile);
|
TelephonyUtils.runWithCleanCallingIdentity(()-> mListener.callSessionProgressing(
|
||||||
|
ImsCallSession.this, profile), mListenerExecutor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void callSessionInitiated(ImsCallProfile profile) {
|
public void callSessionInitiated(ImsCallProfile profile) {
|
||||||
if (mListener != null) {
|
if (mListener != null) {
|
||||||
mListener.callSessionStarted(ImsCallSession.this, profile);
|
TelephonyUtils.runWithCleanCallingIdentity(()-> mListener.callSessionStarted(
|
||||||
|
ImsCallSession.this, profile), mListenerExecutor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void callSessionInitiatingFailed(ImsReasonInfo reasonInfo) {
|
public void callSessionInitiatingFailed(ImsReasonInfo reasonInfo) {
|
||||||
if (mListener != null) {
|
if (mListener != null) {
|
||||||
mListener.callSessionStartFailed(ImsCallSession.this, reasonInfo);
|
TelephonyUtils.runWithCleanCallingIdentity(()-> mListener.callSessionStartFailed(
|
||||||
|
ImsCallSession.this, reasonInfo), mListenerExecutor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void callSessionInitiatedFailed(ImsReasonInfo reasonInfo) {
|
public void callSessionInitiatedFailed(ImsReasonInfo reasonInfo) {
|
||||||
if (mListener != null) {
|
if (mListener != null) {
|
||||||
mListener.callSessionStartFailed(ImsCallSession.this, reasonInfo);
|
TelephonyUtils.runWithCleanCallingIdentity(()-> mListener.callSessionStartFailed(
|
||||||
|
ImsCallSession.this, reasonInfo), mListenerExecutor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void callSessionTerminated(ImsReasonInfo reasonInfo) {
|
public void callSessionTerminated(ImsReasonInfo reasonInfo) {
|
||||||
if (mListener != null) {
|
if (mListener != null) {
|
||||||
mListener.callSessionTerminated(ImsCallSession.this, reasonInfo);
|
TelephonyUtils.runWithCleanCallingIdentity(()-> mListener.callSessionTerminated(
|
||||||
|
ImsCallSession.this, reasonInfo), mListenerExecutor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1251,42 +1264,49 @@ public class ImsCallSession {
|
|||||||
@Override
|
@Override
|
||||||
public void callSessionHeld(ImsCallProfile profile) {
|
public void callSessionHeld(ImsCallProfile profile) {
|
||||||
if (mListener != null) {
|
if (mListener != null) {
|
||||||
mListener.callSessionHeld(ImsCallSession.this, profile);
|
TelephonyUtils.runWithCleanCallingIdentity(()-> mListener.callSessionHeld(
|
||||||
|
ImsCallSession.this, profile), mListenerExecutor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void callSessionHoldFailed(ImsReasonInfo reasonInfo) {
|
public void callSessionHoldFailed(ImsReasonInfo reasonInfo) {
|
||||||
if (mListener != null) {
|
if (mListener != null) {
|
||||||
mListener.callSessionHoldFailed(ImsCallSession.this, reasonInfo);
|
TelephonyUtils.runWithCleanCallingIdentity(()-> mListener.callSessionHoldFailed(
|
||||||
|
ImsCallSession.this, reasonInfo), mListenerExecutor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void callSessionHoldReceived(ImsCallProfile profile) {
|
public void callSessionHoldReceived(ImsCallProfile profile) {
|
||||||
if (mListener != null) {
|
if (mListener != null) {
|
||||||
mListener.callSessionHoldReceived(ImsCallSession.this, profile);
|
TelephonyUtils.runWithCleanCallingIdentity(()-> mListener.callSessionHoldReceived(
|
||||||
|
ImsCallSession.this, profile), mListenerExecutor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void callSessionResumed(ImsCallProfile profile) {
|
public void callSessionResumed(ImsCallProfile profile) {
|
||||||
if (mListener != null) {
|
if (mListener != null) {
|
||||||
mListener.callSessionResumed(ImsCallSession.this, profile);
|
TelephonyUtils.runWithCleanCallingIdentity(()-> mListener.callSessionResumed(
|
||||||
|
ImsCallSession.this, profile), mListenerExecutor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void callSessionResumeFailed(ImsReasonInfo reasonInfo) {
|
public void callSessionResumeFailed(ImsReasonInfo reasonInfo) {
|
||||||
if (mListener != null) {
|
if (mListener != null) {
|
||||||
mListener.callSessionResumeFailed(ImsCallSession.this, reasonInfo);
|
TelephonyUtils.runWithCleanCallingIdentity(()-> mListener.callSessionResumeFailed(
|
||||||
|
ImsCallSession.this, reasonInfo), mListenerExecutor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void callSessionResumeReceived(ImsCallProfile profile) {
|
public void callSessionResumeReceived(ImsCallProfile profile) {
|
||||||
if (mListener != null) {
|
if (mListener != null) {
|
||||||
mListener.callSessionResumeReceived(ImsCallSession.this, profile);
|
TelephonyUtils.runWithCleanCallingIdentity(()->
|
||||||
|
mListener.callSessionResumeReceived(ImsCallSession.this, profile),
|
||||||
|
mListenerExecutor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1311,6 +1331,7 @@ public class ImsCallSession {
|
|||||||
@Override
|
@Override
|
||||||
public void callSessionMergeComplete(IImsCallSession newSession) {
|
public void callSessionMergeComplete(IImsCallSession newSession) {
|
||||||
if (mListener != null) {
|
if (mListener != null) {
|
||||||
|
TelephonyUtils.runWithCleanCallingIdentity(()-> {
|
||||||
if (newSession != null) {
|
if (newSession != null) {
|
||||||
// New session created after conference
|
// New session created after conference
|
||||||
mListener.callSessionMergeComplete(new ImsCallSession(newSession));
|
mListener.callSessionMergeComplete(new ImsCallSession(newSession));
|
||||||
@@ -1318,6 +1339,7 @@ public class ImsCallSession {
|
|||||||
// Session already exists. Hence no need to pass
|
// Session already exists. Hence no need to pass
|
||||||
mListener.callSessionMergeComplete(null);
|
mListener.callSessionMergeComplete(null);
|
||||||
}
|
}
|
||||||
|
}, mListenerExecutor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1329,7 +1351,9 @@ public class ImsCallSession {
|
|||||||
@Override
|
@Override
|
||||||
public void callSessionMergeFailed(ImsReasonInfo reasonInfo) {
|
public void callSessionMergeFailed(ImsReasonInfo reasonInfo) {
|
||||||
if (mListener != null) {
|
if (mListener != null) {
|
||||||
mListener.callSessionMergeFailed(ImsCallSession.this, reasonInfo);
|
TelephonyUtils.runWithCleanCallingIdentity(()->
|
||||||
|
mListener.callSessionMergeFailed(ImsCallSession.this, reasonInfo),
|
||||||
|
mListenerExecutor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1339,21 +1363,27 @@ public class ImsCallSession {
|
|||||||
@Override
|
@Override
|
||||||
public void callSessionUpdated(ImsCallProfile profile) {
|
public void callSessionUpdated(ImsCallProfile profile) {
|
||||||
if (mListener != null) {
|
if (mListener != null) {
|
||||||
mListener.callSessionUpdated(ImsCallSession.this, profile);
|
TelephonyUtils.runWithCleanCallingIdentity(()->
|
||||||
|
mListener.callSessionUpdated(ImsCallSession.this, profile),
|
||||||
|
mListenerExecutor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void callSessionUpdateFailed(ImsReasonInfo reasonInfo) {
|
public void callSessionUpdateFailed(ImsReasonInfo reasonInfo) {
|
||||||
if (mListener != null) {
|
if (mListener != null) {
|
||||||
mListener.callSessionUpdateFailed(ImsCallSession.this, reasonInfo);
|
TelephonyUtils.runWithCleanCallingIdentity(()->
|
||||||
|
mListener.callSessionUpdateFailed(ImsCallSession.this, reasonInfo),
|
||||||
|
mListenerExecutor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void callSessionUpdateReceived(ImsCallProfile profile) {
|
public void callSessionUpdateReceived(ImsCallProfile profile) {
|
||||||
if (mListener != null) {
|
if (mListener != null) {
|
||||||
mListener.callSessionUpdateReceived(ImsCallSession.this, profile);
|
TelephonyUtils.runWithCleanCallingIdentity(()->
|
||||||
|
mListener.callSessionUpdateReceived(ImsCallSession.this, profile),
|
||||||
|
mListenerExecutor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1364,15 +1394,18 @@ public class ImsCallSession {
|
|||||||
public void callSessionConferenceExtended(IImsCallSession newSession,
|
public void callSessionConferenceExtended(IImsCallSession newSession,
|
||||||
ImsCallProfile profile) {
|
ImsCallProfile profile) {
|
||||||
if (mListener != null) {
|
if (mListener != null) {
|
||||||
|
TelephonyUtils.runWithCleanCallingIdentity(()->
|
||||||
mListener.callSessionConferenceExtended(ImsCallSession.this,
|
mListener.callSessionConferenceExtended(ImsCallSession.this,
|
||||||
new ImsCallSession(newSession), profile);
|
new ImsCallSession(newSession), profile), mListenerExecutor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void callSessionConferenceExtendFailed(ImsReasonInfo reasonInfo) {
|
public void callSessionConferenceExtendFailed(ImsReasonInfo reasonInfo) {
|
||||||
if (mListener != null) {
|
if (mListener != null) {
|
||||||
mListener.callSessionConferenceExtendFailed(ImsCallSession.this, reasonInfo);
|
TelephonyUtils.runWithCleanCallingIdentity(()->
|
||||||
|
mListener.callSessionConferenceExtendFailed(
|
||||||
|
ImsCallSession.this, reasonInfo), mListenerExecutor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1380,8 +1413,9 @@ public class ImsCallSession {
|
|||||||
public void callSessionConferenceExtendReceived(IImsCallSession newSession,
|
public void callSessionConferenceExtendReceived(IImsCallSession newSession,
|
||||||
ImsCallProfile profile) {
|
ImsCallProfile profile) {
|
||||||
if (mListener != null) {
|
if (mListener != null) {
|
||||||
|
TelephonyUtils.runWithCleanCallingIdentity(()->
|
||||||
mListener.callSessionConferenceExtendReceived(ImsCallSession.this,
|
mListener.callSessionConferenceExtendReceived(ImsCallSession.this,
|
||||||
new ImsCallSession(newSession), profile);
|
new ImsCallSession(newSession), profile), mListenerExecutor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1392,30 +1426,36 @@ public class ImsCallSession {
|
|||||||
@Override
|
@Override
|
||||||
public void callSessionInviteParticipantsRequestDelivered() {
|
public void callSessionInviteParticipantsRequestDelivered() {
|
||||||
if (mListener != null) {
|
if (mListener != null) {
|
||||||
mListener.callSessionInviteParticipantsRequestDelivered(ImsCallSession.this);
|
TelephonyUtils.runWithCleanCallingIdentity(()->
|
||||||
|
mListener.callSessionInviteParticipantsRequestDelivered(
|
||||||
|
ImsCallSession.this), mListenerExecutor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void callSessionInviteParticipantsRequestFailed(ImsReasonInfo reasonInfo) {
|
public void callSessionInviteParticipantsRequestFailed(ImsReasonInfo reasonInfo) {
|
||||||
if (mListener != null) {
|
if (mListener != null) {
|
||||||
|
TelephonyUtils.runWithCleanCallingIdentity(()->
|
||||||
mListener.callSessionInviteParticipantsRequestFailed(ImsCallSession.this,
|
mListener.callSessionInviteParticipantsRequestFailed(ImsCallSession.this,
|
||||||
reasonInfo);
|
reasonInfo), mListenerExecutor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void callSessionRemoveParticipantsRequestDelivered() {
|
public void callSessionRemoveParticipantsRequestDelivered() {
|
||||||
if (mListener != null) {
|
if (mListener != null) {
|
||||||
mListener.callSessionRemoveParticipantsRequestDelivered(ImsCallSession.this);
|
TelephonyUtils.runWithCleanCallingIdentity(()->
|
||||||
|
mListener.callSessionRemoveParticipantsRequestDelivered(
|
||||||
|
ImsCallSession.this), mListenerExecutor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void callSessionRemoveParticipantsRequestFailed(ImsReasonInfo reasonInfo) {
|
public void callSessionRemoveParticipantsRequestFailed(ImsReasonInfo reasonInfo) {
|
||||||
if (mListener != null) {
|
if (mListener != null) {
|
||||||
|
TelephonyUtils.runWithCleanCallingIdentity(()->
|
||||||
mListener.callSessionRemoveParticipantsRequestFailed(ImsCallSession.this,
|
mListener.callSessionRemoveParticipantsRequestFailed(ImsCallSession.this,
|
||||||
reasonInfo);
|
reasonInfo), mListenerExecutor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1425,7 +1465,9 @@ public class ImsCallSession {
|
|||||||
@Override
|
@Override
|
||||||
public void callSessionConferenceStateUpdated(ImsConferenceState state) {
|
public void callSessionConferenceStateUpdated(ImsConferenceState state) {
|
||||||
if (mListener != null) {
|
if (mListener != null) {
|
||||||
mListener.callSessionConferenceStateUpdated(ImsCallSession.this, state);
|
TelephonyUtils.runWithCleanCallingIdentity(()->
|
||||||
|
mListener.callSessionConferenceStateUpdated(ImsCallSession.this, state),
|
||||||
|
mListenerExecutor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1435,7 +1477,9 @@ public class ImsCallSession {
|
|||||||
@Override
|
@Override
|
||||||
public void callSessionUssdMessageReceived(int mode, String ussdMessage) {
|
public void callSessionUssdMessageReceived(int mode, String ussdMessage) {
|
||||||
if (mListener != null) {
|
if (mListener != null) {
|
||||||
mListener.callSessionUssdMessageReceived(ImsCallSession.this, mode, ussdMessage);
|
TelephonyUtils.runWithCleanCallingIdentity(()->
|
||||||
|
mListener.callSessionUssdMessageReceived(ImsCallSession.this, mode,
|
||||||
|
ussdMessage), mListenerExecutor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1453,8 +1497,9 @@ public class ImsCallSession {
|
|||||||
@Override
|
@Override
|
||||||
public void callSessionMayHandover(int srcNetworkType, int targetNetworkType) {
|
public void callSessionMayHandover(int srcNetworkType, int targetNetworkType) {
|
||||||
if (mListener != null) {
|
if (mListener != null) {
|
||||||
|
TelephonyUtils.runWithCleanCallingIdentity(()->
|
||||||
mListener.callSessionMayHandover(ImsCallSession.this, srcNetworkType,
|
mListener.callSessionMayHandover(ImsCallSession.this, srcNetworkType,
|
||||||
targetNetworkType);
|
targetNetworkType), mListenerExecutor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1465,8 +1510,9 @@ public class ImsCallSession {
|
|||||||
public void callSessionHandover(int srcNetworkType, int targetNetworkType,
|
public void callSessionHandover(int srcNetworkType, int targetNetworkType,
|
||||||
ImsReasonInfo reasonInfo) {
|
ImsReasonInfo reasonInfo) {
|
||||||
if (mListener != null) {
|
if (mListener != null) {
|
||||||
|
TelephonyUtils.runWithCleanCallingIdentity(()->
|
||||||
mListener.callSessionHandover(ImsCallSession.this, srcNetworkType,
|
mListener.callSessionHandover(ImsCallSession.this, srcNetworkType,
|
||||||
targetNetworkType, reasonInfo);
|
targetNetworkType, reasonInfo), mListenerExecutor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1477,8 +1523,9 @@ public class ImsCallSession {
|
|||||||
public void callSessionHandoverFailed(int srcNetworkType, int targetNetworkType,
|
public void callSessionHandoverFailed(int srcNetworkType, int targetNetworkType,
|
||||||
ImsReasonInfo reasonInfo) {
|
ImsReasonInfo reasonInfo) {
|
||||||
if (mListener != null) {
|
if (mListener != null) {
|
||||||
|
TelephonyUtils.runWithCleanCallingIdentity(()->
|
||||||
mListener.callSessionHandoverFailed(ImsCallSession.this, srcNetworkType,
|
mListener.callSessionHandoverFailed(ImsCallSession.this, srcNetworkType,
|
||||||
targetNetworkType, reasonInfo);
|
targetNetworkType, reasonInfo), mListenerExecutor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1488,7 +1535,9 @@ public class ImsCallSession {
|
|||||||
@Override
|
@Override
|
||||||
public void callSessionTtyModeReceived(int mode) {
|
public void callSessionTtyModeReceived(int mode) {
|
||||||
if (mListener != null) {
|
if (mListener != null) {
|
||||||
mListener.callSessionTtyModeReceived(ImsCallSession.this, mode);
|
TelephonyUtils.runWithCleanCallingIdentity(()->
|
||||||
|
mListener.callSessionTtyModeReceived(ImsCallSession.this, mode),
|
||||||
|
mListenerExecutor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1500,14 +1549,18 @@ public class ImsCallSession {
|
|||||||
*/
|
*/
|
||||||
public void callSessionMultipartyStateChanged(boolean isMultiParty) {
|
public void callSessionMultipartyStateChanged(boolean isMultiParty) {
|
||||||
if (mListener != null) {
|
if (mListener != null) {
|
||||||
mListener.callSessionMultipartyStateChanged(ImsCallSession.this, isMultiParty);
|
TelephonyUtils.runWithCleanCallingIdentity(()->
|
||||||
|
mListener.callSessionMultipartyStateChanged(ImsCallSession.this,
|
||||||
|
isMultiParty), mListenerExecutor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void callSessionSuppServiceReceived(ImsSuppServiceNotification suppServiceInfo ) {
|
public void callSessionSuppServiceReceived(ImsSuppServiceNotification suppServiceInfo ) {
|
||||||
if (mListener != null) {
|
if (mListener != null) {
|
||||||
mListener.callSessionSuppServiceReceived(ImsCallSession.this, suppServiceInfo);
|
TelephonyUtils.runWithCleanCallingIdentity(()->
|
||||||
|
mListener.callSessionSuppServiceReceived(ImsCallSession.this,
|
||||||
|
suppServiceInfo), mListenerExecutor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1517,7 +1570,9 @@ public class ImsCallSession {
|
|||||||
@Override
|
@Override
|
||||||
public void callSessionRttModifyRequestReceived(ImsCallProfile callProfile) {
|
public void callSessionRttModifyRequestReceived(ImsCallProfile callProfile) {
|
||||||
if (mListener != null) {
|
if (mListener != null) {
|
||||||
mListener.callSessionRttModifyRequestReceived(ImsCallSession.this, callProfile);
|
TelephonyUtils.runWithCleanCallingIdentity(()->
|
||||||
|
mListener.callSessionRttModifyRequestReceived(ImsCallSession.this,
|
||||||
|
callProfile), mListenerExecutor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1527,7 +1582,9 @@ public class ImsCallSession {
|
|||||||
@Override
|
@Override
|
||||||
public void callSessionRttModifyResponseReceived(int status) {
|
public void callSessionRttModifyResponseReceived(int status) {
|
||||||
if (mListener != null) {
|
if (mListener != null) {
|
||||||
mListener.callSessionRttModifyResponseReceived(status);
|
TelephonyUtils.runWithCleanCallingIdentity(()->
|
||||||
|
mListener.callSessionRttModifyResponseReceived(status),
|
||||||
|
mListenerExecutor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1537,7 +1594,8 @@ public class ImsCallSession {
|
|||||||
@Override
|
@Override
|
||||||
public void callSessionRttMessageReceived(String rttMessage) {
|
public void callSessionRttMessageReceived(String rttMessage) {
|
||||||
if (mListener != null) {
|
if (mListener != null) {
|
||||||
mListener.callSessionRttMessageReceived(rttMessage);
|
TelephonyUtils.runWithCleanCallingIdentity(()->
|
||||||
|
mListener.callSessionRttMessageReceived(rttMessage), mListenerExecutor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1547,21 +1605,26 @@ public class ImsCallSession {
|
|||||||
@Override
|
@Override
|
||||||
public void callSessionRttAudioIndicatorChanged(ImsStreamMediaProfile profile) {
|
public void callSessionRttAudioIndicatorChanged(ImsStreamMediaProfile profile) {
|
||||||
if (mListener != null) {
|
if (mListener != null) {
|
||||||
mListener.callSessionRttAudioIndicatorChanged(profile);
|
TelephonyUtils.runWithCleanCallingIdentity(()->
|
||||||
|
mListener.callSessionRttAudioIndicatorChanged(profile),
|
||||||
|
mListenerExecutor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void callSessionTransferred() {
|
public void callSessionTransferred() {
|
||||||
if (mListener != null) {
|
if (mListener != null) {
|
||||||
mListener.callSessionTransferred(ImsCallSession.this);
|
TelephonyUtils.runWithCleanCallingIdentity(()->
|
||||||
|
mListener.callSessionTransferred(ImsCallSession.this), mListenerExecutor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void callSessionTransferFailed(@Nullable ImsReasonInfo reasonInfo) {
|
public void callSessionTransferFailed(@Nullable ImsReasonInfo reasonInfo) {
|
||||||
if (mListener != null) {
|
if (mListener != null) {
|
||||||
mListener.callSessionTransferFailed(ImsCallSession.this, reasonInfo);
|
TelephonyUtils.runWithCleanCallingIdentity(()->
|
||||||
|
mListener.callSessionTransferFailed(ImsCallSession.this, reasonInfo),
|
||||||
|
mListenerExecutor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1572,7 +1635,8 @@ public class ImsCallSession {
|
|||||||
@Override
|
@Override
|
||||||
public void callSessionDtmfReceived(char dtmf) {
|
public void callSessionDtmfReceived(char dtmf) {
|
||||||
if (mListener != null) {
|
if (mListener != null) {
|
||||||
mListener.callSessionDtmfReceived(dtmf);
|
TelephonyUtils.runWithCleanCallingIdentity(()-> mListener.callSessionDtmfReceived(
|
||||||
|
dtmf), mListenerExecutor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1582,7 +1646,8 @@ public class ImsCallSession {
|
|||||||
@Override
|
@Override
|
||||||
public void callQualityChanged(CallQuality callQuality) {
|
public void callQualityChanged(CallQuality callQuality) {
|
||||||
if (mListener != null) {
|
if (mListener != null) {
|
||||||
mListener.callQualityChanged(callQuality);
|
TelephonyUtils.runWithCleanCallingIdentity(()-> mListener.callQualityChanged(
|
||||||
|
callQuality), mListenerExecutor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1594,8 +1659,9 @@ public class ImsCallSession {
|
|||||||
public void callSessionRtpHeaderExtensionsReceived(
|
public void callSessionRtpHeaderExtensionsReceived(
|
||||||
@NonNull List<RtpHeaderExtension> extensions) {
|
@NonNull List<RtpHeaderExtension> extensions) {
|
||||||
if (mListener != null) {
|
if (mListener != null) {
|
||||||
|
TelephonyUtils.runWithCleanCallingIdentity(()->
|
||||||
mListener.callSessionRtpHeaderExtensionsReceived(
|
mListener.callSessionRtpHeaderExtensionsReceived(
|
||||||
new ArraySet<RtpHeaderExtension>(extensions));
|
new ArraySet<RtpHeaderExtension>(extensions)), mListenerExecutor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user