Lines Matching refs:phone
17 package com.android.phone;
60 import com.android.internal.telephony.Phone;
66 import com.android.phone.CallGatewayManager.RawGatewayInfo;
72 * Misc utilities for the Phone app.
93 // State of the Phone's audio modes
96 static final int AUDIO_IDLE = 0; /** audio behaviour at phone idle */
110 /** Phone state changed event*/
116 /** poll phone DISCONNECTING status interval */
119 /** poll phone DISCONNECTING status times limit */
149 new ComponentName("com.android.phone",
188 * Register the ConnectionHandler with the phone, to receive connection events
218 final Phone phone = ringingCall.getPhone();
219 final boolean phoneIsCdma = (phone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA);
237 // Set the Phone Call State to SINGLE_ACTIVE
242 // Set the Phone Call State to CONF_CALL
303 * based on the current Phone state, as follows:
373 * @param phone the Phone object.
376 static boolean hangupRingingAndActive(Phone phone) {
379 Call ringingCall = phone.getRingingCall();
380 Call fgCall = phone.getForegroundCall();
453 * Answers the incoming call specified by "ringing", and ends the currently active phone call.
456 * current call. e.g. when you are having a phone call with CDMA network and has received
457 * a SIP call, then we won't expect our telephony can manage those phone calls simultaneously.
458 * Note that some types of network may allow multiple phone calls at once; GSM allows to hold
459 * an ongoing phone call, so we don't need to end the active call. The caller of this method
460 * needs to check if the network allows multiple phone calls or not.
475 // while active call and waiting call are from the same phone
476 // i.e. both from GSM phone
493 * For a CDMA phone, advance the call state upon making a new
501 * @param app The phone instance.
507 // This is the first outgoing call. Set the Phone Call State to ACTIVE
511 // This is the second outgoing call. Set the Phone Call State to 3WAY
523 public static int placeCall(Context context, Phone phone, String number, Uri contactRef,
525 return placeCall(context, phone, number, contactRef, isEmergencyCall,
530 * Dial the number using the phone passed in.
537 * @param phone the Phone object.
539 * NOT the phone number to connect to. It is used only to build the
551 public static int placeCall(Context context, Phone phone, String number, Uri contactRef,
595 // Remember if the phone state was in IDLE state before this call.
600 connection = app.mCM.dial(phone, numberToDial, VideoProfile.STATE_AUDIO_ONLY);
613 int phoneType = phone.getPhoneType();
629 // phone.dial() succeeded: we're now in a normal phone call.
673 // sanitized phone numbers.
691 static void sendEmptyFlash(Phone phone) {
692 if (phone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA) {
693 Call fgCall = phone.getForegroundCall();
697 switchHoldingAndActive(phone.getBackgroundCall());
746 // Set the Phone Call State to conference
857 static void displayMMIComplete(final Phone phone, Context context, final MmiCode mmiCode,
918 // indicate to the Phone app that the progress dialog has
1022 phone.sendUssdResponse(inputText.getText().toString());
1052 phone.sendUssdResponse(inputText.getText().toString());
1088 static boolean cancelMmiCode(Phone phone) {
1089 List<? extends MmiCode> pendingMmis = phone.getPendingMmiCodes();
1097 // in the phone UI, because during the MMI operation, an Alert panel
1120 * initiated this outgoing call), figure out the actual phone number we
1130 * phone number with separators and keypad letters stripped out, or a raw
1133 * @return the phone number corresponding to the specified Intent, or null
1150 // If the EXTRA_ACTUAL_NUMBER_TO_DIAL extra is present, get the phone
1167 * Gets the phone number to be called from an intent. Requires a Context
1168 * to access the contacts database, and a Phone to access the voicemail
1171 * <p>If <code>phone</code> is <code>null</code>, the function will return
1174 * <code>null</code> for person/phone URIs.</p>
1183 * a <code>voicemail:</code> URI, but <code>phone</code> does not
1186 * @return the phone number (or SIP address) that would be called by the intent,
1217 * extract a phone number from the specified Connection, and feed that
1222 * phone number from the Connection.
1253 // querying a new CallerInfo using the connection's phone number.
1298 throw new IllegalStateException("Unexpected phone type: " + phoneType);
1378 // querying a new CallerInfo using the connection's phone number.
1388 log("PhoneUtils.startGetCallerInfo: new query for phone number...");
1391 log("- phone: " + c.getCall().getPhone());
1403 default: log(" ==> Unknown phone type"); break;
1610 newCi.phoneNumber = ci.phoneNumber; // To get formatted phone number
1634 // the phone number being displayed, if applicable.
1725 // Sanity-check that this is OK given the current state of the phone.
1743 // Note: this method is used even when the phone is encrypted. At that moment
1869 * Get the mute state of foreground phone, which has the current
1880 * Sets the audio mode per current phone state.
1886 * Look for ANY connections on the phone that qualify as being
1890 * all the phone's call objects.
1892 /* package */ static boolean hasDisconnectedConnections(Phone phone) {
1893 return hasDisconnectedConnections(phone.getForegroundCall()) ||
1894 hasDisconnectedConnections(phone.getBackgroundCall()) ||
1895 hasDisconnectedConnections(phone.getRingingCall());
1922 * state of the Phone.
1940 * state of the Phone.
1950 // This phone has the concept of explicit "Hold" and "Unhold" actions.
1953 // Even when foreground phone device doesn't support hold/unhold, phone devices
1966 * state of the Phone.
1971 // CDMA: "Swap" is enabled only when the phone reaches a *generic*.
1989 throw new IllegalStateException("Unexpected phone type: " + phoneType);
1995 * state of the Phone.
2018 * state of the Phone.
2021 Phone phone = cm.getActiveFgCall().getPhone();
2024 if (isPhoneInEcm(phone)) {
2028 int phoneType = phone.getPhoneType();
2057 throw new IllegalStateException("Unexpected phone type: " + phoneType);
2085 * Handles certain "corner cases" for CNAP. When we receive weird phone numbers
2090 * @return the new String that should be used for the phone number
2106 // phone number, so if this happens, change it to "Unknown" in the CallerInfo
2147 // Support for 3rd party phone service providers.
2151 * Check if a phone number can be route through a 3rd party
2152 * gateway. The number must be a global phone number in numerical
2174 * Returns whether the phone is in ECM ("Emergency Callback Mode") or not.
2176 /* package */ static boolean isPhoneInEcm(Phone phone) {
2177 if ((phone != null) && TelephonyCapabilities.supportsEcm(phone)) {
2193 * Returns the most appropriate Phone object to handle a call
2198 * @param number the phone number, or SIP address.
2200 public static Phone pickPhoneBasedOnNumber(CallManager cm, String scheme, String number,
2211 Phone phone = getSipPhoneFromUri(cm, primarySipUri);
2212 if (phone != null) return phone;
2218 public static Phone getSipPhoneFromUri(CallManager cm, String target) {
2219 for (Phone phone : cm.getAllPhones()) {
2220 if (phone.getPhoneType() == PhoneConstants.PHONE_TYPE_SIP) {
2221 String sipUri = ((SipPhone) phone).getSipUri();
2224 "found SipPhone! obj = " + phone + ", "
2225 + phone.getClass());
2226 return phone;
2234 * Returns true when the given call is in INCOMING state and there's no foreground phone call,
2235 * meaning the call is the first real incoming call the phone is having.
2260 // General phone and call state debugging/testing code
2263 /* package */ static void dumpCallState(Phone phone) {
2266 Log.d(LOG_TAG, "- Phone: " + phone + ", name = " + phone.getPhoneName()
2267 + ", state = " + phone.getState());
2271 Call call = phone.getForegroundCall();
2281 call = phone.getBackgroundCall();
2291 call = phone.getRingingCall();
2302 final boolean hasRingingCall = !phone.getRingingCall().isIdle();
2303 final boolean hasActiveCall = !phone.getForegroundCall().isIdle();
2304 final boolean hasHoldingCall = !phone.getBackgroundCall().isIdle();
2314 if (phone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA) {
2366 for (Phone phone : CallManager.getInstance().getAllPhones()) {
2367 if (phone != null) {
2368 Log.d(LOG_TAG, "Phone: " + phone + ", name = " + phone.getPhoneName()
2369 + ", state = " + phone.getState());
2371 call = phone.getForegroundCall();
2377 call = phone.getBackgroundCall();
2382 call = phone.getRingingCall();
2409 public static PhoneAccountHandle makePstnPhoneAccountHandle(Phone phone) {
2410 return makePstnPhoneAccountHandleWithPrefix(phone, "", false);
2414 Phone phone, String prefix, boolean isEmergency) {
2418 String.valueOf(phone.getFullIccSerialNumber());
2437 Phone phone = getPhoneForPhoneAccountHandle(handle);
2438 if (phone != null) {
2439 return phone.getSubId();
2444 public static Phone getPhoneForPhoneAccountHandle(PhoneAccountHandle handle) {
2453 * Determine if a given phone account corresponds to an active SIM
2457 * @param handle The handle for the phone account to check
2458 * @return {@code true} If there is an active SIM for this phone account,
2469 private static Phone getPhoneFromIccId(String iccId) {
2471 for (Phone phone : PhoneFactory.getPhones()) {
2472 String phoneIccId = phone.getFullIccSerialNumber();
2474 return phone;
2485 for (Phone phone : PhoneFactory.getPhones()) {
2486 IccCard sim = phone.getIccCard();
2488 if (VDBG) Log.v(LOG_TAG, "register for ICC status, phone " + phone.getPhoneId());
2489 sim.registerForNetworkLocked(handler, event, phone);
2500 for (Phone phone : PhoneFactory.getPhones()) {
2501 phone.setRadioPower(enabled);