Loading src/java/com/android/internal/telephony/Connection.java +41 −0 Original line number Diff line number Diff line Loading @@ -98,6 +98,7 @@ public abstract class Connection { public void onConferenceMergedFailed(); public void onExtrasChanged(Bundle extras); public void onExitedEcmMode(); public void onCallPullFailed(Connection externalConnection); } /** Loading Loading @@ -127,6 +128,8 @@ public abstract class Connection { public void onExtrasChanged(Bundle extras) {} @Override public void onExitedEcmMode() {} @Override public void onCallPullFailed(Connection externalConnection) {} } public static final int AUDIO_QUALITY_STANDARD = 1; Loading Loading @@ -194,6 +197,13 @@ public abstract class Connection { */ private boolean mIsPulledCall = false; /** * Where {@link #mIsPulledCall} is {@code true}, contains the dialog Id of the external call * which is being pulled (e.g. * {@link com.android.internal.telephony.imsphone.ImsExternalConnection#getCallId()}). */ private int mPulledDialogId; protected Connection(int phoneType) { mPhoneType = phoneType; } Loading Loading @@ -827,6 +837,21 @@ public abstract class Connection { return mIsPulledCall; } /** * For an external call which is being pulled (e.g. {@link #isPulledCall()} is {@code true}), * sets the dialog Id for the external call. Used to handle failures to pull a call so that the * pulled call can be reconciled with its original external connection. * * @param pulledDialogId The dialog id associated with a pulled call. */ public void setPulledDialogId(int pulledDialogId) { mPulledDialogId = pulledDialogId; } public int getPulledDialogId() { return mPulledDialogId; } /** * Sets the call substate for the current connection and reports the changes to all listeners. * Valid call substates are defined in {@link android.telecom.Connection}. Loading Loading @@ -899,6 +924,20 @@ public abstract class Connection { } } /** * Notifies the connection that a call to {@link #pullExternalCall()} has failed to pull the * call to the local device. * * @param externalConnection The original * {@link com.android.internal.telephony.imsphone.ImsExternalConnection} from which the * pull was initiated. */ public void onCallPullFailed(Connection externalConnection) { for (Listener l : mListeners) { l.onCallPullFailed(externalConnection); } } /** * Notifies this Connection of a request to disconnect a participant of the conference managed * by the connection. Loading Loading @@ -931,6 +970,8 @@ public abstract class Connection { StringBuilder str = new StringBuilder(128); str.append(" callId: " + getTelecomCallId()); str.append(" isExternal: " + (((mConnectionCapabilities & Capability.IS_EXTERNAL_CONNECTION) == Capability.IS_EXTERNAL_CONNECTION) ? "Y" : "N")); if (Rlog.isLoggable(LOG_TAG, Log.DEBUG)) { str.append("addr: " + getAddress()) .append(" pres.: " + getNumberPresentation()) Loading src/java/com/android/internal/telephony/imsphone/ImsExternalCallTracker.java +2 −1 Original line number Diff line number Diff line Loading @@ -88,7 +88,8 @@ public class ImsExternalCallTracker implements ImsPhoneCallTracker.PhoneStateLis Log.e(TAG, "onPullExternalCall : No call puller defined"); return; } mCallPuller.pullExternalCall(connection.getAddress(), connection.getVideoState()); mCallPuller.pullExternalCall(connection.getAddress(), connection.getVideoState(), connection.getCallId()); } } Loading src/java/com/android/internal/telephony/imsphone/ImsPhoneCallTracker.java +33 −11 Original line number Diff line number Diff line Loading @@ -610,7 +610,10 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall { if (intentExtras.containsKey(ImsCallProfile.EXTRA_IS_CALL_PULL)) { profile.mCallExtras.putBoolean(ImsCallProfile.EXTRA_IS_CALL_PULL, intentExtras.getBoolean(ImsCallProfile.EXTRA_IS_CALL_PULL)); int dialogId = intentExtras.getInt( ImsExternalCallTracker.EXTRA_IMS_EXTERNAL_CALL_ID); conn.setIsPulledCall(true); conn.setPulledDialogId(dialogId); } // Pack the OEM-specific call extras. Loading Loading @@ -1456,7 +1459,23 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall { mOnHoldToneStarted = false; mOnHoldToneId = -1; } if (conn != null && conn.isIncoming() && conn.getConnectTime() == 0 if (conn != null) { if (conn.isPulledCall() && ( reasonInfo.getCode() == ImsReasonInfo.CODE_CALL_PULL_OUT_OF_SYNC || reasonInfo.getCode() == ImsReasonInfo.CODE_SIP_TEMPRARILY_UNAVAILABLE) && mPhone != null && mPhone.getExternalCallTracker() != null) { log("Call pull failed."); // Call was being pulled, but the call pull has failed -- inform the associated // TelephonyConnection that the pull failed, and provide it with the original // external connection which was pulled so that it can be swapped back. conn.onCallPullFailed(mPhone.getExternalCallTracker() .getConnectionById(conn.getPulledDialogId())); // Do not mark as disconnected; the call will just change from being a regular // call to being an external call again. cause = DisconnectCause.NOT_DISCONNECTED; } else if (conn.isIncoming() && conn.getConnectTime() == 0 && cause != DisconnectCause.ANSWERED_ELSEWHERE) { // Missed if (cause == DisconnectCause.NORMAL) { Loading @@ -1464,9 +1483,9 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall { } else { cause = DisconnectCause.INCOMING_REJECTED; } if (DBG) log("Incoming connection of 0 connect time detected - translated cause = " + cause); if (DBG) log("Incoming connection of 0 connect time detected - translated " + "cause = " + cause); } } if (cause == DisconnectCause.NORMAL && conn != null && conn.getImsCall().isMerged()) { Loading Loading @@ -2390,11 +2409,14 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall { * * @param number The phone number of the call to be pulled. * @param videoState The desired video state of the pulled call. * @param dialogId The {@link ImsExternalConnection#getCallId()} dialog id associated with the * call which is being pulled. */ @Override public void pullExternalCall(String number, int videoState) { public void pullExternalCall(String number, int videoState, int dialogId) { Bundle extras = new Bundle(); extras.putBoolean(ImsCallProfile.EXTRA_IS_CALL_PULL, true); extras.putInt(ImsExternalCallTracker.EXTRA_IMS_EXTERNAL_CALL_ID, dialogId); try { Connection connection = dial(number, videoState, extras); mPhone.notifyUnknownConnection(connection); Loading src/java/com/android/internal/telephony/imsphone/ImsPullCall.java +3 −1 Original line number Diff line number Diff line Loading @@ -31,6 +31,8 @@ public interface ImsPullCall { * * @param number The phone number of the call to be pulled. * @param videoState The video state of the call to be pulled. * @param dialogId The {@link ImsExternalConnection#getCallId()} dialog Id associated with the * call to be pulled. */ void pullExternalCall(String number, int videoState); void pullExternalCall(String number, int videoState, int dialogId); } Loading
src/java/com/android/internal/telephony/Connection.java +41 −0 Original line number Diff line number Diff line Loading @@ -98,6 +98,7 @@ public abstract class Connection { public void onConferenceMergedFailed(); public void onExtrasChanged(Bundle extras); public void onExitedEcmMode(); public void onCallPullFailed(Connection externalConnection); } /** Loading Loading @@ -127,6 +128,8 @@ public abstract class Connection { public void onExtrasChanged(Bundle extras) {} @Override public void onExitedEcmMode() {} @Override public void onCallPullFailed(Connection externalConnection) {} } public static final int AUDIO_QUALITY_STANDARD = 1; Loading Loading @@ -194,6 +197,13 @@ public abstract class Connection { */ private boolean mIsPulledCall = false; /** * Where {@link #mIsPulledCall} is {@code true}, contains the dialog Id of the external call * which is being pulled (e.g. * {@link com.android.internal.telephony.imsphone.ImsExternalConnection#getCallId()}). */ private int mPulledDialogId; protected Connection(int phoneType) { mPhoneType = phoneType; } Loading Loading @@ -827,6 +837,21 @@ public abstract class Connection { return mIsPulledCall; } /** * For an external call which is being pulled (e.g. {@link #isPulledCall()} is {@code true}), * sets the dialog Id for the external call. Used to handle failures to pull a call so that the * pulled call can be reconciled with its original external connection. * * @param pulledDialogId The dialog id associated with a pulled call. */ public void setPulledDialogId(int pulledDialogId) { mPulledDialogId = pulledDialogId; } public int getPulledDialogId() { return mPulledDialogId; } /** * Sets the call substate for the current connection and reports the changes to all listeners. * Valid call substates are defined in {@link android.telecom.Connection}. Loading Loading @@ -899,6 +924,20 @@ public abstract class Connection { } } /** * Notifies the connection that a call to {@link #pullExternalCall()} has failed to pull the * call to the local device. * * @param externalConnection The original * {@link com.android.internal.telephony.imsphone.ImsExternalConnection} from which the * pull was initiated. */ public void onCallPullFailed(Connection externalConnection) { for (Listener l : mListeners) { l.onCallPullFailed(externalConnection); } } /** * Notifies this Connection of a request to disconnect a participant of the conference managed * by the connection. Loading Loading @@ -931,6 +970,8 @@ public abstract class Connection { StringBuilder str = new StringBuilder(128); str.append(" callId: " + getTelecomCallId()); str.append(" isExternal: " + (((mConnectionCapabilities & Capability.IS_EXTERNAL_CONNECTION) == Capability.IS_EXTERNAL_CONNECTION) ? "Y" : "N")); if (Rlog.isLoggable(LOG_TAG, Log.DEBUG)) { str.append("addr: " + getAddress()) .append(" pres.: " + getNumberPresentation()) Loading
src/java/com/android/internal/telephony/imsphone/ImsExternalCallTracker.java +2 −1 Original line number Diff line number Diff line Loading @@ -88,7 +88,8 @@ public class ImsExternalCallTracker implements ImsPhoneCallTracker.PhoneStateLis Log.e(TAG, "onPullExternalCall : No call puller defined"); return; } mCallPuller.pullExternalCall(connection.getAddress(), connection.getVideoState()); mCallPuller.pullExternalCall(connection.getAddress(), connection.getVideoState(), connection.getCallId()); } } Loading
src/java/com/android/internal/telephony/imsphone/ImsPhoneCallTracker.java +33 −11 Original line number Diff line number Diff line Loading @@ -610,7 +610,10 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall { if (intentExtras.containsKey(ImsCallProfile.EXTRA_IS_CALL_PULL)) { profile.mCallExtras.putBoolean(ImsCallProfile.EXTRA_IS_CALL_PULL, intentExtras.getBoolean(ImsCallProfile.EXTRA_IS_CALL_PULL)); int dialogId = intentExtras.getInt( ImsExternalCallTracker.EXTRA_IMS_EXTERNAL_CALL_ID); conn.setIsPulledCall(true); conn.setPulledDialogId(dialogId); } // Pack the OEM-specific call extras. Loading Loading @@ -1456,7 +1459,23 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall { mOnHoldToneStarted = false; mOnHoldToneId = -1; } if (conn != null && conn.isIncoming() && conn.getConnectTime() == 0 if (conn != null) { if (conn.isPulledCall() && ( reasonInfo.getCode() == ImsReasonInfo.CODE_CALL_PULL_OUT_OF_SYNC || reasonInfo.getCode() == ImsReasonInfo.CODE_SIP_TEMPRARILY_UNAVAILABLE) && mPhone != null && mPhone.getExternalCallTracker() != null) { log("Call pull failed."); // Call was being pulled, but the call pull has failed -- inform the associated // TelephonyConnection that the pull failed, and provide it with the original // external connection which was pulled so that it can be swapped back. conn.onCallPullFailed(mPhone.getExternalCallTracker() .getConnectionById(conn.getPulledDialogId())); // Do not mark as disconnected; the call will just change from being a regular // call to being an external call again. cause = DisconnectCause.NOT_DISCONNECTED; } else if (conn.isIncoming() && conn.getConnectTime() == 0 && cause != DisconnectCause.ANSWERED_ELSEWHERE) { // Missed if (cause == DisconnectCause.NORMAL) { Loading @@ -1464,9 +1483,9 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall { } else { cause = DisconnectCause.INCOMING_REJECTED; } if (DBG) log("Incoming connection of 0 connect time detected - translated cause = " + cause); if (DBG) log("Incoming connection of 0 connect time detected - translated " + "cause = " + cause); } } if (cause == DisconnectCause.NORMAL && conn != null && conn.getImsCall().isMerged()) { Loading Loading @@ -2390,11 +2409,14 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall { * * @param number The phone number of the call to be pulled. * @param videoState The desired video state of the pulled call. * @param dialogId The {@link ImsExternalConnection#getCallId()} dialog id associated with the * call which is being pulled. */ @Override public void pullExternalCall(String number, int videoState) { public void pullExternalCall(String number, int videoState, int dialogId) { Bundle extras = new Bundle(); extras.putBoolean(ImsCallProfile.EXTRA_IS_CALL_PULL, true); extras.putInt(ImsExternalCallTracker.EXTRA_IMS_EXTERNAL_CALL_ID, dialogId); try { Connection connection = dial(number, videoState, extras); mPhone.notifyUnknownConnection(connection); Loading
src/java/com/android/internal/telephony/imsphone/ImsPullCall.java +3 −1 Original line number Diff line number Diff line Loading @@ -31,6 +31,8 @@ public interface ImsPullCall { * * @param number The phone number of the call to be pulled. * @param videoState The video state of the call to be pulled. * @param dialogId The {@link ImsExternalConnection#getCallId()} dialog Id associated with the * call to be pulled. */ void pullExternalCall(String number, int videoState); void pullExternalCall(String number, int videoState, int dialogId); }