Lines Matching full:call
50 import com.android.internal.telephony.Call;
75 /** Identifier for the "Add Call" intent extra. */
81 static final int CALL_STATUS_FAILED = 2; // The call failed
88 static final int AUDIO_OFFHOOK = 2; /** audio behaviour while in call. */
158 // Restore the mute state of the foreground call if we're not IDLE,
162 // call, and that with no connections, we should be back to a
215 * Answer the currently-ringing call.
217 * @return true if we answered the call, or false if there wasn't
218 * actually a ringing incoming call, or some other error occurred.
227 // right now (before actually answering the call.)
233 Call call = phone.getRingingCall();
239 // Stop any signalInfo tone being played when a Call waiting gets answered
240 if (call.getState() == Call.State.WAITING) {
246 if (call != null && call.isRinging()) {
247 if (DBG) log("answerCall: call state = " + call.getState());
252 // This is the FIRST incoming call being answered.
253 // Set the Phone Call State to SINGLE_ACTIVE
257 // This is the CALL WAITING call being answered.
258 // Set the Phone Call State to CONF_CALL
261 // Enable "Add Call" option after answering a Call Waiting as the user
262 // should be allowed to add another call in case one of the parties
266 // If a BluetoothHandsfree is valid we need to set the second call state
267 // so that the Bluetooth client can update the Call state correctly when
268 // a call waiting is answered from the Phone.
308 * <li>If there's a ringing call, hang that up.
309 * <li>Else if there's a foreground call, hang that up.
310 * <li>Else if there's a background call, hang that up.
318 Call ringing = phone.getRingingCall();
319 Call fg = phone.getForegroundCall();
320 Call bg = phone.getBackgroundCall();
323 if (DBG) log("HANGUP ringing call");
326 if (DBG) log("HANGUP foreground call");
329 if (DBG) log("HANGUP background call");
339 if (DBG) log("hangup ringing call");
340 Call ringing = phone.getRingingCall();
344 // CDMA: Ringing call and Call waiting hangup is handled differently.
345 // For Call waiting we DO NOT call the conventional hangup(call) function
346 // as in CDMA we just want to hungup the Call waiting connection.
347 Call.State state = ringing.getState();
348 if (state == Call.State.INCOMING) {
349 if (DBG) log("hangup ringing call");
351 } else if (state == Call.State.WAITING) {
352 if (DBG) log("hangup Call waiting call");
358 // if the call.isRinging() returns TRUE, which basically means that the call
360 if (DBG) log("No Ringing call to hangup");
364 // GSM: Ringing Call and Call waiting, both are hungup by calling
365 // hangup(call) function.
366 if (DBG) log("hangup ringing call");
374 if (DBG) log("hangup active call");
379 if (DBG) log("hangup holding call");
384 * Used in CDMA phones to end the complete Call session
386 * @return true if *any* call was successfully hung up
391 Call ringingCall = phone.getRingingCall();
392 Call
394 // Hang up any Ringing Call
396 if (DBG) log("endCallInternal: Hang up Ringing Call");
400 // Hang up any Active Call
402 if (DBG) log("endCallInternal: Hang up Foreground Call");
410 * Trivial wrapper around Call.hangup(), except that we return a
414 * @return true if the call was successfully hung up, or false
415 * if the call wasn't actually active.
417 static boolean hangup(Call call) {
419 call.hangup();
422 Log.e(LOG_TAG, "Call hangup: caught " + ex, ex);
460 // in-call, which means that the audio mode is already set
464 // hanging up the active call also accepts the waiting call
469 * For a CDMA phone, advance the call state upon making a new
470 * outgoing call.
482 // This is the first outgoing call. Set the Phone Call State to ACTIVE
486 // This is the second outgoing call. Set the Phone Call State to 3WAY
497 * @param contactRef that triggered the call. Either a 'tel:' or a
498 * 'content://contacts' uri depending on how the call was
538 // phone.dial() succeeded: we're now in a normal phone call.
582 * If the connection is establised, this method issues a sync call
590 * call card and to update the call log. See above for restrictions.
591 * @param contactRef that triggered the call. Typically a 'tel:'
667 * to the network prior to placing a 3-way call for it to be successful.
671 Call fgCall = phone.getForegroundCall();
672 if (fgCall.getState() == Call.State.ACTIVE) {
691 * foreground call.
706 // a call where call can have multiple connections such as
707 // Three way and Call Waiting. Therefore retrieving Mute state for
708 // latest connection can apply for all connection in that call
742 // Set the Phone Call State to conference
747 // TODO: Need to change the call from switchHoldingAndActive to
1173 * Finally, if the getCallerInfo() call did succeed, we save the resulting
1220 * Class returned by the startGetCallerInfo call to package a temporary
1233 * Start a CallerInfo Query based on the earliest connection in the call.
1235 static CallerInfoToken startGetCallerInfo(Context context, Call call,
1241 conn = call.getLatestConnection();
1243 conn = call.getEarliestConnection();
1429 // since the query is already done, call the listener.
1497 // Don't call modifyForSpecialCnapCases on regular name. See b/2160795.
1519 * Returns true if the specified Call is a "conference call", meaning
1522 * call is active (like displaying the label "Conference call", and
1526 * *not* their states. So if a Call has (for example) one ACTIVE
1528 * true (which is unintuitive, since the Call isn't *really* a
1529 * conference call any more.)
1531 * @return true if the specified call has more than one connection (in any state.)
1533 static boolean isConferenceCall(Call call) {
1534 // CDMA phones don't have the same concept of "conference call" as
1535 // GSM phones do; there's no special "conference call" state of
1537 // you're in a 3-way call, all we can do is display the "generic"
1538 // state of the UI.) So as far as the in-call UI is concerned,
1550 List<Connection> connections = call.getConnections();
1560 // to say that a given call is only really a conference call if
1571 // if (conn.getState() == Call.State.ACTIVE) numActiveConnections++;
1580 * Launch the Dialer to start a new call.
1586 Log.w(LOG_TAG, "startNewCall: can't add a new call in the current state");
1591 // if applicable, mute the call while we're showing the add call UI.
1603 // it that we're going through the "add call" option from the
1611 * Brings up the UI used to handle an incoming call.
1616 * in-call screen, whose CallCard automatically does the right
1617 * thing if there's a Call that's currently ringing.
1623 // Before bringing up the "incoming call" UI, force any system
1626 ActivityManagerNative.getDefault().closeSystemDialogs("call");
1630 // Go directly to the in-call screen.
1631 // (No need to do anything special if we're already on the in-call
1642 // to call preventScreenOn(), which tells the PowerManager that
1645 // call" sequence. The corresponding preventScreenOn(false) call
1677 // We also need to make a fresh call to PhoneApp.updateWakeState()
1763 * All muting / unmuting from the in-call UI should go through this
1767 // make the call to mute the audio
1819 * timing (and call stacks) for all our setMode() calls.
1867 * Handles the wired headset button while in-call.
1871 * call" *any* time a call is active, even if the user isn't actually
1872 * on the in-call screen.
1886 // The headset button button means "Answer" if an incoming call is
1891 // button will NEVER happen while the user is on a call.
1900 // If an incoming call is ringing, answer it (just like with the
1901 // CALL button):
1911 answerCall(phone); // Automatically holds the current active call,
1918 // No incoming ringing call.
1941 // ringing call, the InCallScreen will imminently get a phone
1943 // unmuted, the setMute() call automagically updates the status
1960 * all the phone's call objects.
1969 * Iterate over all connections in a call to see if there are any
1976 private static final boolean hasDisconnectedConnections(Call call) {
1978 for (Connection c : call.getConnections()) {
1998 // state by either accepting a Call Waiting or by merging two calls
2004 // incoming call. (Actually we need to verify that the active
2005 // call really is in the ACTIVE state and the holding call really
2007 // when the foreground call is DIALING or ALERTING.)
2009 && (phone.getForegroundCall().getState() == Call.State.ACTIVE)
2010 && (phone.getBackgroundCall().getState() == Call.State.HOLDING);
2023 // CDMA: "Merge" is enabled only when the user is in a 3Way call.
2030 // incoming call, *and* the current conference isn't already
2039 * @return true if the UI should let you add a new call, given the current
2044 final Call.State fgCallState = phone.getForegroundCall().getState();
2046 // CDMA: "Add call" menu item is only enabled when the call is in
2048 // - After 30 seconds of user Ignoring/Missing a Call Waiting call.
2050 return ((fgCallState == Call.State.ACTIVE)
2053 // GSM: "Add call" is available only if ALL of the following are true:
2054 // - There's no incoming ringing call
2056 // - The foreground call is ACTIVE or IDLE or DISCONNECTED.
2065 && ((fgCallState == Call.State.ACTIVE)
2066 || (fgCallState == Call.State.IDLE)
2067 || (fgCallState == Call.State.DISCONNECTED));
2156 * in-call screen's provider info overlay.
2277 * This function is called when phone answers or places a call.
2317 // General phone and call state debugging/testing code
2328 Call call = phone.getForegroundCall();
2330 b.append(" - FG call: ").append(call.getState());
2331 b.append(" isAlive ").append(call.getState().isAlive());
2332 b.append(" isRinging ").append(call.getState().isRinging());
2333 b.append(" isDialing ").append(call.getState().isDialing());
2334 b.append(" isIdle ").append(call.isIdle());
2335 b.append(" hasConnections ").append(call.hasConnections());
2338 call = phone.getBackgroundCall();
2340 b.append(" - BG call: ").append(call.getState());
2341 b.append(" isAlive ").append(call.getState().isAlive());
2342 b.append(" isRinging ").append(call.getState().isRinging());
2343 b.append(" isDialing ").append(call.getState().isDialing());
2344 b.append(" isIdle ").append(call.isIdle());
2345 b.append(" hasConnections ").append(call.hasConnections());
2348 call = phone.getRingingCall();
2350 b.append(" - RINGING call: ").append(call.getState());
2351 b.append(" isAlive ").append(call.getState().isAlive());
2352 b.append(" isRinging ").append(call.getState().isRinging());
2353 b.append(" isDialing ").append(call.getState().isDialing());
2354 b.append(" isIdle ").append(call.isIdle());
2355 b.append(" hasConnections ").append(call.hasConnections());
2373 Log.d(LOG_TAG, " - CDMA call state: "
2380 // Watch out: the isRinging() call below does NOT tell us anything