Loading src/java/com/android/ims/ImsCall.java 100644 → 100755 +95 −0 Original line number Diff line number Diff line Loading @@ -486,6 +486,17 @@ public class ImsCall implements ICall { public void onRttAudioIndicatorChanged(ImsCall imsCall, ImsStreamMediaProfile profile) { } /** * Notifies the result of transfer request. * * @param imsCall ImsCall object */ public void onCallSessionTransferred(ImsCall imsCall) { } public void onCallSessionTransferFailed(ImsCall imsCall, ImsReasonInfo reasonInfo) { } /** * Called when the call quality has changed. * Loading Loading @@ -1253,6 +1264,56 @@ public class ImsCall implements ICall { } } /** * Transfers a call. * * @param number number to be transferred to. * @param isConfirmationRequired indicates blind or assured transfer. * @throws ImsException if the IMS service fails to transfer the call. */ public void transfer(String number, boolean isConfirmationRequired) throws ImsException { logi("transfer :: session=" + mSession + ", number=" + Rlog.pii(TAG, number) + ", isConfirmationRequired=" + isConfirmationRequired); synchronized(mLockObj) { if (mSession == null) { throw new ImsException("No call to transfer", ImsReasonInfo.CODE_LOCAL_CALL_TERMINATED); } try { mSession.transfer(number, isConfirmationRequired); } catch (Throwable t) { loge("transfer :: ", t); throw new ImsException("transfer()", t, 0); } } } /** * Transfers a call to another ongoing call. * * @param transferToImsCall the other ongoing call to which this call will be transferred. * @throws ImsException if the IMS service fails to transfer the call. */ public void consultativeTransfer(ImsCall transferToImsCall) throws ImsException { logi("consultativeTransfer :: session=" + mSession + ", other call=" + transferToImsCall); synchronized(mLockObj) { if (mSession == null) { throw new ImsException("No call to transfer", ImsReasonInfo.CODE_LOCAL_CALL_TERMINATED); } try { mSession.transfer(transferToImsCall.getSession()); } catch (Throwable t) { loge("consultativeTransfer :: ", t); throw new ImsException("consultativeTransfer()", t, 0); } } } public void terminate(int reason, int overrideReason) { logi("terminate :: reason=" + reason + " ; overrideReason=" + overrideReason); mOverrideReason = overrideReason; Loading Loading @@ -3238,6 +3299,40 @@ public class ImsCall implements ICall { } } @Override public void callSessionTransferred(ImsCallSession session) { ImsCall.Listener listener; synchronized(ImsCall.this) { listener = mListener; } if (listener != null) { try { listener.onCallSessionTransferred(ImsCall.this); } catch (Throwable t) { loge("callSessionTransferred:: ", t); } } } @Override public void callSessionTransferFailed(ImsCallSession session, ImsReasonInfo reasonInfo) { ImsCall.Listener listener; synchronized(ImsCall.this) { listener = mListener; } if (listener != null) { try { listener.onCallSessionTransferFailed(ImsCall.this, reasonInfo); } catch (Throwable t) { loge("callSessionTransferFailed:: ", t); } } } @Override public void callQualityChanged(CallQuality callQuality) { ImsCall.Listener listener; Loading Loading
src/java/com/android/ims/ImsCall.java 100644 → 100755 +95 −0 Original line number Diff line number Diff line Loading @@ -486,6 +486,17 @@ public class ImsCall implements ICall { public void onRttAudioIndicatorChanged(ImsCall imsCall, ImsStreamMediaProfile profile) { } /** * Notifies the result of transfer request. * * @param imsCall ImsCall object */ public void onCallSessionTransferred(ImsCall imsCall) { } public void onCallSessionTransferFailed(ImsCall imsCall, ImsReasonInfo reasonInfo) { } /** * Called when the call quality has changed. * Loading Loading @@ -1253,6 +1264,56 @@ public class ImsCall implements ICall { } } /** * Transfers a call. * * @param number number to be transferred to. * @param isConfirmationRequired indicates blind or assured transfer. * @throws ImsException if the IMS service fails to transfer the call. */ public void transfer(String number, boolean isConfirmationRequired) throws ImsException { logi("transfer :: session=" + mSession + ", number=" + Rlog.pii(TAG, number) + ", isConfirmationRequired=" + isConfirmationRequired); synchronized(mLockObj) { if (mSession == null) { throw new ImsException("No call to transfer", ImsReasonInfo.CODE_LOCAL_CALL_TERMINATED); } try { mSession.transfer(number, isConfirmationRequired); } catch (Throwable t) { loge("transfer :: ", t); throw new ImsException("transfer()", t, 0); } } } /** * Transfers a call to another ongoing call. * * @param transferToImsCall the other ongoing call to which this call will be transferred. * @throws ImsException if the IMS service fails to transfer the call. */ public void consultativeTransfer(ImsCall transferToImsCall) throws ImsException { logi("consultativeTransfer :: session=" + mSession + ", other call=" + transferToImsCall); synchronized(mLockObj) { if (mSession == null) { throw new ImsException("No call to transfer", ImsReasonInfo.CODE_LOCAL_CALL_TERMINATED); } try { mSession.transfer(transferToImsCall.getSession()); } catch (Throwable t) { loge("consultativeTransfer :: ", t); throw new ImsException("consultativeTransfer()", t, 0); } } } public void terminate(int reason, int overrideReason) { logi("terminate :: reason=" + reason + " ; overrideReason=" + overrideReason); mOverrideReason = overrideReason; Loading Loading @@ -3238,6 +3299,40 @@ public class ImsCall implements ICall { } } @Override public void callSessionTransferred(ImsCallSession session) { ImsCall.Listener listener; synchronized(ImsCall.this) { listener = mListener; } if (listener != null) { try { listener.onCallSessionTransferred(ImsCall.this); } catch (Throwable t) { loge("callSessionTransferred:: ", t); } } } @Override public void callSessionTransferFailed(ImsCallSession session, ImsReasonInfo reasonInfo) { ImsCall.Listener listener; synchronized(ImsCall.this) { listener = mListener; } if (listener != null) { try { listener.onCallSessionTransferFailed(ImsCall.this, reasonInfo); } catch (Throwable t) { loge("callSessionTransferFailed:: ", t); } } } @Override public void callQualityChanged(CallQuality callQuality) { ImsCall.Listener listener; Loading