Lines Matching refs:call

95         void onCallAdded(Call call);
96 void onCallRemoved(Call call);
97 void onCallStateChanged(Call call, int oldState, int newState);
99 Call call,
102 void onIncomingCallAnswered(Call call);
103 void onIncomingCallRejected(Call call, boolean rejectWithMessage, String textMessage);
105 void onRingbackRequested(Call call, boolean ringback);
106 void onIsConferencedChanged(Call call);
107 void onIsVoipAudioModeChanged(Call call);
108 void onVideoStateChanged(Call call, int previousVideoState, int newVideoState);
110 void onSessionModifyRequestReceived(Call call, VideoProfile videoProfile);
111 void onHoldToneRequested(Call call);
112 void onExternalCallChanged(Call call, boolean isExternalCall);
134 // Maps call technologies in PhoneConstants to those in Analytics.
147 * The main call repository. Keeps an instance of all live calls. New incoming and outgoing
158 * The current telecom call ID. Used when creating new instances of {@link Call}. Should
307 // Don't load missed call if it is run in split user model.
330 public void onSuccessfulOutgoingCall(Call call, int callState) {
331 Log.v(this, "onSuccessfulOutgoingCall, %s", call);
333 setCallState(call, callState, "successful outgoing call");
334 if (!mCalls.contains(call)) {
337 addCall(call);
340 // The call's ConnectionService has been updated.
342 listener.onConnectionServiceChanged(call, null, call.getConnectionService());
345 markCallAsDialing(call);
349 public void onFailedOutgoingCall(Call call, DisconnectCause disconnectCause) {
350 Log.v(this, "onFailedOutgoingCall, call: %s", call);
352 markCallAsRemoved(call);
359 Log.i(this, "Skipping call filtering due to ECBM");
376 // Only set the incoming call as ringing if it isn't already disconnected. It is possible
377 // that the connection service disconnected the call before it was even added to Telecom, in
382 result.shouldAllowCall ? "successful incoming call" : "blocking call");
384 Log.i(this, "onCallFilteringCompleted: call already disconnected.");
406 Log.i(this, "onCallFilteringCompleted: blocked call, rejecting.");
410 Log.i(this, "onCallScreeningCompleted: blocked call, adding to call log.");
412 Log.w(this, "onCallScreeningCompleted: blocked call, showing notification.");
417 Log.i(this, "onCallScreeningCompleted: blocked call, showing notification.");
424 * Whether allow (silence rather than reject) the incoming call if it has a different source
425 * (connection service) from the existing ringing call when reaching maximum ringing calls.
435 for (Call call : mCalls) {
437 if (call.getParentCall() != null) {
441 if (call.isExternalCall()) {
445 if (CallState.RINGING == call.getState() &&
446 call.getConnectionService() == incomingCall.getConnectionService()) {
455 public void onFailedIncomingCall(Call call) {
456 setCallState(call, CallState.DISCONNECTED, "failed incoming call");
457 call.removeListener(this);
461 public void onSuccessfulUnknownCall(Call call, int callState) {
462 setCallState(call, callState, "successful unknown call");
463 Log.i(this, "onSuccessfulUnknownCall for call %s", call);
464 addCall(call);
468 public void onFailedUnknownCall(Call call) {
469 Log.i(this, "onFailedUnknownCall for call %s", call);
470 setCallState(call, CallState.DISCONNECTED, "failed unknown call");
471 call.removeListener(this);
475 public void onRingbackRequested(Call call, boolean ringback) {
477 listener.onRingbackRequested(call, ringback);
482 public void onPostDialWait(Call call, String remaining) {
483 mInCallController.onPostDialWait(call, remaining);
487 public void onPostDialChar(final Call call, char nextChar) {
496 mDtmfLocalTonePlayer.playTone(call, nextChar);
503 mDtmfLocalTonePlayer.stopTone(call);
516 mDtmfLocalTonePlayer.stopTone(call);
523 public void onParentChanged(Call call) {
524 // parent-child relationship affects which call should be foreground, so do an update.
527 listener.onIsConferencedChanged(call);
532 public void onChildrenChanged(Call call) {
533 // parent-child relationship affects which call should be foreground, so do an update.
536 listener.onIsConferencedChanged(call);
541 public void onIsVoipAudioModeChanged(Call call) {
543 listener.onIsVoipAudioModeChanged(call);
548 public void onVideoStateChanged(Call call, int previousVideoState, int newVideoState) {
550 listener.onVideoStateChanged(call, previousVideoState, newVideoState);
555 public boolean onCanceledViaNewOutgoingCallBroadcast(final Call call,
557 mPendingCallsToDisconnect.add(call);
561 if (mPendingCallsToDisconnect.remove(call)) {
562 Log.i(this, "Delayed disconnection of call: %s", call);
563 call.disconnect();
572 * Handles changes to the {@link Connection.VideoProvider} for a call. Adds the
577 * @param call The call.
580 public void onVideoCallProviderChanged(Call call) {
581 VideoProviderProxy videoProviderProxy = call.getVideoProviderProxy();
592 * a call. Notifies listeners of the {@link CallsManager.CallsManagerListener} of the session
595 * @param call The call.
599 public void onSessionModifyRequestReceived(Call call, VideoProfile videoProfile) {
606 listener.onSessionModifyRequestReceived(call, videoProfile);
615 * Play or stop a call hold tone for a call. Triggered via
620 * @param call The call which requested the hold tone.
623 public void onHoldToneRequested(Call call) {
625 listener.onHoldToneRequested(call);
652 for (Call call : mCalls) {
653 if (call.isEmergencyCall()) {
661 for (Call call : mCalls) {
662 if (!call.isDisconnected()) {
670 for (Call call : mCalls) {
671 if (VideoProfile.isVideo(call.getVideoState())) {
701 * Starts the process to attach the call to a connection service.
704 * connection service to use for this call.
705 * @param extras The optional extras Bundle passed with the intent used for the incoming call.
714 Call call = new Call(
732 call.initAnalytics();
735 call.getAnalytics().setCallIsAdditional(true);
738 setIntentExtrasAndStartTime(call, extras);
740 call.addListener(this);
741 call.startCreateConnection(mPhoneAccountRegistrar);
747 Call call = new Call(
766 call.initAnalytics();
768 setIntentExtrasAndStartTime(call, extras);
769 call.addListener(this);
770 call.startCreateConnection(mPhoneAccountRegistrar);
795 Log.i(this, "Reusing disconnected call %s", pendingCall);
798 Log.i(this, "Not reusing disconnected call %s", pendingCall);
807 * Kicks off the first steps to creating an outgoing call so that InCallUI can launch.
809 * @param handle Handle to connect the call with.
811 * connection service to use for this call.
812 * @param extras The optional extras Bundle passed with the intent used for the incoming call.
813 * @param initiatingUser {@link UserHandle} of user that place the outgoing call.
818 Call call = reuseOutgoingCall(handle);
820 // Create a call with original handle. The handle may be changed when the call is attached
822 if (call == null) {
823 call = new Call(getNextCallId(), mContext,
838 call.initAnalytics();
840 call.setInitiatingUser(initiatingUser);
845 // Set the video state on the call early so that when it is added to the InCall UI the UI
846 // knows to configure itself as a video call immediately.
851 // If this is an emergency video call, we need to check if the phone account supports
853 // Also, ensure we don't try to place an outgoing call with video if video is not
859 if (call.isEmergencyCall() && account != null &&
876 call.setVideoState(videoState);
882 // Only dial with the requested phoneAccount if it is still valid. Otherwise treat this call
909 call.setTargetPhoneAccount(phoneAccountHandle);
913 // Do not support any more live calls. Our options are to move a call to hold, disconnect
914 // a call, or cancel this call altogether. If a call is being reused, then it has already
916 // call transitioning into the CONNECTING state.
918 !makeRoomForOutgoingCall(call, call.isEmergencyCall()))) {
920 Log.i(this, "No remaining room for outgoing call: %s", call);
921 if (mCalls.contains(call)) {
922 // This call can already exist if it is a reused call,
924 call.disconnect();
930 !call.isEmergencyCall();
934 call.setState(CallState.SELECT_PHONE_ACCOUNT, "needs account selection");
939 call.setState(
944 setIntentExtrasAndStartTime(call, extras);
946 // Do not add the call if it is a potential MMI code.
948 call.addListener(this);
949 } else if (!mCalls.contains(call)) {
950 // We check if mCalls already contains the call because we could potentially be reusing
951 // a call which was previously added (See {@link #reuseOutgoingCall}).
952 addCall(call);
955 return call;
959 * Attempts to issue/connect the specified call.
961 * @param handle Handle to connect the call with.
962 * @param gatewayInfo Optional gateway information that can be used to route the call to the
964 * @param speakerphoneOn Whether or not to turn the speakerphone on once the call connects.
965 * @param videoState The desired video state for the outgoing call.
968 public void placeOutgoingCall(Call call, Uri handle, GatewayInfo gatewayInfo,
970 if (call == null) {
971 // don't do anything if the call no longer exists
972 Log.i(this, "Canceling unknown call.");
979 Log.i(this, "Creating a new outgoing call with handle: %s", Log.piiHandle(uriHandle));
981 Log.i(this, "Creating a new outgoing call with gateway handle: %s, original handle: %s",
985 call.setHandle(uriHandle);
986 call.setGatewayInfo(gatewayInfo);
993 // Auto-enable speakerphone if the originating intent specified to do so, if the call
994 // is a video call, of if using speaker when docked
995 call.setStartWithSpeakerphoneOn(speakerphoneOn || useSpeakerForVideoCall
997 call.setVideoState(videoState);
1000 Log.i(this, "%s Starting with speakerphone as requested", call);
1002 Log.i(this, "%s Starting with speakerphone because car is docked.", call);
1004 Log.i(this, "%s Starting with speakerphone because its a video call.", call);
1007 if (call.isEmergencyCall()) {
1014 if (call.getTargetPhoneAccount() != null || call.isEmergencyCall()) {
1015 // If the account has been set, proceed to place the outgoing call.
1017 call.startCreateConnection(mPhoneAccountRegistrar);
1019 requireCallCapableAccountByHandle ? call.getHandle().getScheme() : null, false,
1020 call.getInitiatingUser()).isEmpty()) {
1021 // If there are no call capable accounts, disconnect the call.
1022 markCallAsDisconnected(call, new DisconnectCause(DisconnectCause.CANCELED,
1024 markCallAsRemoved(call);
1029 * Attempts to start a conference call for the specified call.
1031 * @param call The call to conference.
1032 * @param otherCall The other call to conference with.
1035 public void conference(Call call, Call otherCall) {
1036 call.conferenceWith(otherCall);
1040 * Instructs Telecom to answer the specified call. Intended to be invoked by the in-call
1041 * app through {@link InCallAdapter} after Telecom notifies it of an incoming call followed by
1042 * the user opting to answer said call.
1044 * @param call The call to answer.
1045 * @param videoState The video state in which to answer the call.
1048 public void answerCall(Call call, int videoState) {
1049 if (!mCalls.contains(call)) {
1050 Log.i(this, "Request to answer a non-existent call %s", call);
1053 // If the foreground call is not the ringing call and it is currently isActive() or
1054 // STATE_DIALING, put it on hold before answering the call.
1055 if (foregroundCall != null && foregroundCall != call &&
1061 // This call does not support hold. If it is from a different connection
1064 if (foregroundCall.getConnectionService() != call.getConnectionService()) {
1070 Log.v(this, "Disconnecting held call %s before holding active call.",
1075 Log.v(this, "Holding active/dialing call %s before answering incoming call %s.",
1076 foregroundCall, call);
1079 // TODO: Wait until we get confirmation of the active call being
1080 // on-hold before answering the new call.
1085 listener.onIncomingCallAnswered(call);
1090 call.answer(videoState);
1092 call.setStartWithSpeakerphoneOn(true);
1098 * Determines if the speakerphone should be automatically enabled for the call. Speakerphone
1099 * should be enabled if the call is a video call and bluetooth or the wired headset are not in
1102 * @param videoState The video state of the call.
1137 * Instructs Telecom to reject the specified call. Intended to be invoked by the in-call
1138 * app through {@link InCallAdapter} after Telecom notifies it of an incoming call followed by
1139 * the user opting to reject said call.
1142 public void rejectCall(Call call, boolean rejectWithMessage, String textMessage) {
1143 if (!mCalls.contains(call)) {
1144 Log.i(this, "Request to reject a non-existent call %s", call);
1147 listener.onIncomingCallRejected(call, rejectWithMessage, textMessage);
1149 call.reject(rejectWithMessage, textMessage);
1154 * Instructs Telecom to play the specified DTMF tone within the specified call.
1159 public void playDtmfTone(Call call, char digit) {
1160 if (!mCalls.contains(call)) {
1161 Log.i(this, "Request to play DTMF in a non-existent call %s", call);
1163 call.playDtmfTone(digit);
1164 mDtmfLocalTonePlayer.playTone(call, digit);
1172 public void stopDtmfTone(Call call) {
1173 if (!mCalls.contains(call)) {
1174 Log.i(this, "Request to stop DTMF in a non-existent call %s", call);
1176 call.stopDtmfTone();
1177 mDtmfLocalTonePlayer.stopTone(call);
1184 void postDialContinue(Call call, boolean proceed) {
1185 if (!mCalls.contains(call)) {
1186 Log.i(this, "Request to continue post-dial string in a non-existent call %s", call);
1188 call.postDialContinue(proceed);
1193 * Instructs Telecom to disconnect the specified call. Intended to be invoked by the
1194 * in-call app through {@link InCallAdapter} for an ongoing call. This is usually triggered by
1195 * the user hitting the end-call button.
1198 public void disconnectCall(Call call) {
1199 Log.v(this, "disconnectCall %s", call);
1201 if (!mCalls.contains(call)) {
1202 Log.w(this, "Unknown call (%s) asked to disconnect", call);
1204 mLocallyDisconnectingCalls.add(call);
1205 call.disconnect();
1215 for (Call call : mCalls) {
1216 disconnectCall(call);
1222 * Instructs Telecom to put the specified call on hold. Intended to be invoked by the
1223 * in-call app through {@link InCallAdapter} for an ongoing call. This is usually triggered by
1224 * the user hitting the hold button during an active call.
1227 public void holdCall(Call call) {
1228 if (!mCalls.contains(call)) {
1229 Log.w(this, "Unknown call (%s) asked to be put on hold", call);
1231 Log.d(this, "Putting call on hold: (%s)", call);
1232 call.hold();
1237 * Instructs Telecom to release the specified call from hold. Intended to be invoked by
1238 * the in-call app through {@link InCallAdapter} for an ongoing call. This is usually triggered
1239 * by the user hitting the hold button during a held call.
1242 public void unholdCall(Call call) {
1243 if (!mCalls.contains(call)) {
1244 Log.w(this, "Unknown call (%s) asked to be removed from hold", call);
1247 Log.d(this, "unholding call: (%s)", call);
1250 if (c != null && c.isAlive() && c != call && c.getParentCall() == null) {
1257 Log.event(call, Log.Events.SWAP);
1259 call.unhold();
1273 // Construct the list of possible PhoneAccounts that the outgoing call can use based on the
1290 // Should be available if a call is already active on the SIM account.
1312 * Informs listeners (notably {@link CallAudioManager} of a change to the call's external
1315 * @param call The call whose external property changed.
1316 * @param isExternalCall {@code True} if the call is now external, {@code false} otherwise.
1319 public void onExternalCallChanged(Call call, boolean isExternalCall) {
1322 listener.onExternalCallChanged(call, isExternalCall);
1326 private void handleCallTechnologyChange(Call call) {
1327 if (call.getExtras() != null
1328 && call.getExtras().containsKey(TelecomManager.EXTRA_CALL_TECHNOLOGY_TYPE)) {
1331 call.getExtras().getInt(TelecomManager.EXTRA_CALL_TECHNOLOGY_TYPE));
1335 call.getAnalytics().addCallTechnology(analyticsCallTechnology);
1339 public void handleChildAddressChange(Call call) {
1340 if (call.getExtras() != null
1341 && call.getExtras().containsKey(Connection.EXTRA_CHILD_ADDRESS)) {
1343 String viaNumber = call.getExtras().getString(Connection.EXTRA_CHILD_ADDRESS);
1344 call.setViaNumber(viaNumber);
1348 /** Called by the in-call UI to change the mute state. */
1354 * Called by the in-call UI to change the audio route, for example to change from earpiece to
1361 /** Called by the in-call UI to turn the proximity sensor on. */
1367 * Called by the in-call UI to turn the proximity sensor off.
1375 void phoneAccountSelected(Call call, PhoneAccountHandle account, boolean setDefault) {
1376 if (!mCalls.contains(call)) {
1377 Log.i(this, "Attempted to add account to unknown call %s", call);
1379 call.setTargetPhoneAccount(account);
1381 if (!call.isNewOutgoingCallIntentBroadcastDone()) {
1387 if (makeRoomForOutgoingCall(call, false /* isEmergencyCall */)) {
1388 call.startCreateConnection(mPhoneAccountRegistrar);
1390 call.disconnect();
1395 .setUserSelectedOutgoingPhoneAccount(account, call.getInitiatingUser());
1410 void markCallAsRinging(Call call) {
1411 setCallState(call, CallState.RINGING, "ringing set explicitly");
1414 void markCallAsDialing(Call call) {
1415 setCallState(call, CallState.DIALING, "dialing set explicitly");
1416 maybeMoveToSpeakerPhone(call);
1419 void markCallAsPulling(Call call) {
1420 setCallState(call, CallState.PULLING, "pulling set explicitly");
1421 maybeMoveToSpeakerPhone(call);
1424 void markCallAsActive(Call call) {
1425 setCallState(call, CallState.ACTIVE, "active set explicitly");
1426 maybeMoveToSpeakerPhone(call);
1429 void markCallAsOnHold(Call call) {
1430 setCallState(call, CallState.ON_HOLD, "on-hold set explicitly");
1434 * Marks the specified call as STATE_DISCONNECTED and notifies the in-call app. If this was the
1435 * last live call, then also disconnect from the in-call controller.
1439 void markCallAsDisconnected(Call call, DisconnectCause disconnectCause) {
1440 call.setDisconnectCause(disconnectCause);
1441 setCallState(call, CallState.DISCONNECTED, "disconnected set explicitly");
1445 * Removes an existing disconnected call, and notifies the in-call app.
1447 void markCallAsRemoved(Call call) {
1448 removeCall(call);
1450 if (mLocallyDisconnectingCalls.contains(call)) {
1451 mLocallyDisconnectingCalls.remove(call);
1459 // The new foreground call is on hold, however the carrier does not display the hold
1460 // button in the UI. Therefore, we need to auto unhold the held call since the user has
1462 Log.i(this, "Auto-unholding held foreground call (call doesn't support hold)");
1475 for (Call call : mCalls) {
1476 if (call.getConnectionService() == service) {
1477 if (call.getState() != CallState.DISCONNECTED) {
1478 markCallAsDisconnected(call, new DisconnectCause(DisconnectCause.ERROR));
1480 markCallAsRemoved(call);
1496 for (Call call : mCalls) {
1497 if (!call.isExternalCall()) {
1538 * Returns true if telecom supports adding another top-level call.
1554 for (Call call : mCalls) {
1555 if (call.isEmergencyCall()) {
1556 // We never support add call if one of the calls is an emergency call.
1558 } else if (call.isExternalCall()) {
1561 } else if (call.getParentCall() == null) {
1564 Bundle extras = call.getExtras();
1574 // also support add-call. Technically it's right, but overall looks better (UI-wise)
1575 // and acts better if we wait until the call is removed.
1606 for (Call call : mCalls) {
1607 if (call.getParentCall() == null && call.getState() == CallState.ON_HOLD) {
1630 * Returns the first call that it finds with the given states. The states are treated as having
1631 * priority order so that any call with the first state will be returned before any call with
1644 for (Call call : mCalls) {
1645 if (Objects.equals(callToSkip, call)) {
1650 if (call.getParentCall() != null) {
1654 if (call.isExternalCall()) {
1658 if (currentState == call.getState()) {
1659 return call;
1678 Call call = new Call(
1696 setCallState(call, Call.getStateFromConnectionState(parcelableConference.getState()),
1697 "new conference call");
1698 call.setConnectionCapabilities(parcelableConference.getConnectionCapabilities());
1699 call.setConnectionProperties(parcelableConference.getConnectionProperties());
1700 call.setVideoState(parcelableConference.getVideoState());
1701 call.setVideoProvider(parcelableConference.getVideoProvider());
1702 call.setStatusHints(parcelableConference.getStatusHints());
1703 call.putExtras(Call.SOURCE_CONNECTION_SERVICE, parcelableConference.getExtras());
1708 call.setOriginalConnectionId(extras.getString(Connection.EXTRA_ORIGINAL_CONNECTION_ID));
1712 call.addListener(this);
1713 addCall(call);
1714 return call;
1718 * @return the call state currently tracked by {@link PhoneStateBroadcaster}
1742 * Reject an incoming call and manually add it to the Call Log.
1743 * @param incomingCall Incoming call that has been rejected
1747 // Only reject the call if it has not already been destroyed. If a call ends while
1748 // incoming call filtering is taking place, it is possible that the call has already
1753 Log.i(this, "rejectCallAndLog - call already destroyed.");
1756 // Since the call was not added to the list of calls, we have to call the missed
1757 // call notifier and the call logger manually.
1758 // Do we need missed call notification for direct to Voicemail calls?
1764 * Adds the specified call to the main list of live calls.
1766 * @param call The call to add.
1768 private void addCall(Call call) {
1770 Log.v(this, "addCall(%s)", call);
1771 call.addListener(this);
1772 mCalls.add(call);
1774 // Specifies the time telecom finished routing the call. This is used by the dialer for
1776 Bundle extras = call.getIntentExtras();
1781 // onCallAdded for calls which immediately take the foreground (like the first call).
1786 listener.onCallAdded(call);
1794 private void removeCall(Call call) {
1796 Log.v(this, "removeCall(%s)", call);
1798 call.setParentCall(null); // need to clean up parent relationship before destroying.
1799 call.removeListener(this);
1800 call.clearConnectionService();
1803 if (mCalls.contains(call)) {
1804 mCalls.remove(call);
1808 call.destroy();
1817 listener.onCallRemoved(call);
1827 * Sets the specified state on the specified call.
1829 * @param call The call.
1830 * @param newState The new state of the call.
1832 private void setCallState(Call call, int newState, String tag) {
1833 if (call == null) {
1836 int oldState = call.getState();
1837 Log.i(this, "setCallState %s -> %s, call: %s", CallState.toString(oldState),
1838 CallState.toString(newState), call);
1840 // Unfortunately, in the telephony world the radio is king. So if the call notifies
1841 // us that the call is in a particular state, we allow it even if it doesn't make
1847 call.setState(newState, tag);
1848 maybeShowErrorDialogOnDisconnect(call);
1852 if (mCalls.contains(call)) {
1858 listener.onCallStateChanged(call, oldState, newState);
1896 * @param handle The URI to call.
1897 * @return {@code True} if the URI represents a number which could be an in-call MMI code.
1918 for (Call call : mCalls) {
1919 if (call.getParentCall() == null && call.getState() == state &&
1920 !call.isExternalCall()) {
1949 private boolean makeRoomForOutgoingCall(Call call, boolean isEmergency) {
1954 Log.i(this, "makeRoomForOutgoingCall call = " + call + " livecall = " +
1957 if (call == liveCall) {
1958 // If the call is already the foreground call, then we are golden.
1960 // state since the call was already populated into the list.
1967 // Disconnect the current outgoing call if it's not an emergency call. If the
1968 // user tries to make two outgoing calls to different emergency call numbers,
1969 // we will try to connect the first outgoing call.
1970 call.getAnalytics().setCallIsAdditional(true);
1976 // If there is an orphaned call in the {@link CallState#SELECT_PHONE_ACCOUNT}
1977 // state, just disconnect it since the user has explicitly started a new call.
1978 call.getAnalytics().setCallIsAdditional(true);
1989 // Kill the current active call, this is easier then trying to disconnect a
1990 // holding call and hold an active call.
1991 call.getAnalytics().setCallIsAdditional(true);
1999 // We have room for at least one more holding call at this point.
2002 // If the live call is a conference, it will not have a target phone account set. This
2003 // means the check to see if the live call has the same target phone account as the new
2004 // call will not cause us to bail early. As a result, we'll end up holding the
2005 // ongoing conference call. However, the ConnectionService is already doing that. This
2013 Log.i(this, "makeRoomForOutgoingCall: using child call PhoneAccount = " +
2017 // First thing, if we are trying to make a call with the same phone account as the live
2018 // call, then allow it so that the connection service can make its own decision about
2019 // how to handle the new call relative to the current one.
2020 if (Objects.equals(liveCallPhoneAccount, call.getTargetPhoneAccount())) {
2022 call.getAnalytics().setCallIsAdditional(true);
2025 } else if (call.getTargetPhoneAccount() == null) {
2026 // Without a phone account, we can't say reliably that the call will fail.
2027 // If the user chooses the same phone account as the live call, then it's
2028 // still possible that the call can be made (like with CDMA calls not supporting
2029 // hold but they still support adding a call by going immediately into conference
2035 // Try to hold the live call before attempting the new outgoing call.
2037 Log.i(this, "makeRoomForOutgoingCall: holding live call.");
2038 call.getAnalytics().setCallIsAdditional(true);
2044 // The live call cannot be held so we're out of luck here. There's no room.
2051 * Given a call, find the first non-null phone account handle of its children.
2053 * @param parentCall The parent call.
2067 * Checks to see if the call should be on speakerphone and if so, set it.
2069 private void maybeMoveToSpeakerPhone(Call call) {
2070 if (call.getStartWithSpeakerphoneOn()) {
2072 call.setStartWithSpeakerphoneOn(false);
2077 * Creates a new call for an existing connection.
2079 * @param callId The id of the new call.
2081 * @return The new call.
2086 Call call = new Call(
2104 call.initAnalytics();
2105 call.getAnalytics().setCreatedFromExistingConnection(true);
2107 setCallState(call, Call.getStateFromConnectionState(connection.getState()),
2109 call.setConnectionCapabilities(connection.getConnectionCapabilities());
2110 call.setConnectionProperties(connection.getConnectionProperties());
2111 call.setCallerDisplayName(connection.getCallerDisplayName(),
2113 call.addListener(this);
2119 call.setOriginalConnectionId(extras.getString(Connection.EXTRA_ORIGINAL_CONNECTION_ID));
2121 addCall(call);
2123 return call;
2137 .filter(call -> originalConnectionId.equals(call.getOriginalConnectionId()) ||
2138 originalConnectionId.equals(call.getId()))
2142 Log.i(this, "isExistingConnectionAlreadyAdded - call %s already added with id %s",
2151 * @return A new unique telecom call Id.
2160 * Callback when foreground user is switched. We will reload missed call in all profiles
2202 for (Call call : mCalls) {
2203 pw.println(call);
2240 * @param call The call.
2242 private void maybeShowErrorDialogOnDisconnect(Call call) {
2243 if (call.getState() == CallState.DISCONNECTED && (isPotentialMMICode(call.getHandle())
2244 || isPotentialInCallMMICode(call.getHandle()))) {
2245 DisconnectCause disconnectCause = call.getDisconnectCause();
2257 private void setIntentExtrasAndStartTime(Call call, Bundle extras) {
2261 // Specifies the time telecom began routing the call. This is used by the dialer for
2266 call.setIntentExtras(extras);