Found 23507 results in 3707 files, showing top 50 files (show more).
android.googlesource.com/platform/packages/services/Telephony:src/com/android/phone/PhoneInterfaceManager.java: [ master, ]
377:         public Phone phone;
17: package com.android.phone;
198: public class PhoneInterfaceManager extends ITelephony.Stub {
1639:     private PhoneInterfaceManager(PhoneGlobals app) {
1655:     private Phone getDefaultPhone() {
1686:     private Phone getPhone(int subId) {
2288:     public String getNetworkCountryIsoForPhone(int phoneId) {
5809:     public int checkCarrierPrivilegesForPackageAnyPhone(String pkgName) {
5832:     public List<String> getCarrierPackageNamesForIntentAndPhone(Intent intent, int phoneId) {
6290:     public boolean isWorldPhone(int subId, String callingPackage, String callingFeatureId) {
307:     private PhoneConfigurationManager mPhoneConfigurationManager;
1666:     private Phone getPhoneFromRequest(MainThreadRequest request) {
1674:     private Phone getPhoneFromSubId(int subId) {
2067:     private void shutdownRadioUsingPhoneId(int phoneId) {
2742:     public int getActivePhoneType() {
2747:     public int getActivePhoneTypeForSlot(int slotIndex) {
3786:     private void checkModifyPhoneStatePermission(int subId, String message) {
4424:     private Phone getPhoneFromSlotIdOrThrowException(int slotIndex) {
5876:     public List<String> getPackagesWithCarrierPrivilegesForAllPhones() {
6416:     public int getSubIdForPhoneAccount(PhoneAccount phoneAccount) {
6426:     public int getSubIdForPhoneAccountHandle(
6441:     public @Nullable PhoneAccountHandle getPhoneAccountHandleForSubscriptionId(int subscriptionId) {
21: import static com.android.internal.telephony.PhoneConstants.PHONE_TYPE_IMS;
142: import com.android.internal.telephony.Phone;
175: import com.android.phone.settings.PickSmsSubscriptionActivity;
176: import com.android.phone.vvm.PhoneAccountHandleConverter;
177: import com.android.phone.vvm.RemoteVvmTaskManager;
178: import com.android.phone.vvm.VisualVoicemailSettingsUtil;
179: import com.android.phone.vvm.VisualVoicemailSmsFilterConfig;
376:         // In cases where subId is unavailable, the caller needs to specify the phone.
385:         MainThreadRequest(Object argument, Phone phone, WorkSource workSource) {
387:             if (phone != null) {
388:                 this.phone = phone;
416:      * A handler that processes messages on the main thread in the phone process. Since many
417:      * of the Phone calls are not thread safe this is needed to shuttle the requests from the
418:      * inbound binder threads to the main thread in the phone process.  The Binder thread
435:             final Phone defaultPhone = getDefaultPhone();
440:                     final Phone phone = getPhoneFromRequest(request);
459:                         request.result = phone != null
460:                                 ? phone.handleUssdRequest(ussdRequest, wrappedCallback) : false;
471:                     final Phone phone = getPhoneFromRequest(request);
472:                     request.result = phone != null ?
1257:                     request.phone.requestCellInfoUpdate(request.workSource, onCompleted);
1271:                     request.phone.requestCellInfoUpdate(request.workSource,
1299:                     Phone phone = getPhoneFromRequest(request);
1300:                     phone.getCellIdentity(ws, obtainMessage(EVENT_GET_CELL_LOCATION_DONE, request));
1308:                         phone = getPhoneFromRequest(request);
1309:                         request.result = (phone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA)
1331:                             .enablePhone(request.phone, enable, onCompleted);
1337:                     int phoneId = request.phone.getPhoneId();
1352:                             .getPhoneStatusFromModem(request.phone, onCompleted);
1357:                     int id = request.phone.getPhoneId();
1380:                     request.phone.setSystemSelectionChannels(args.first, onCompleted);
1553:     private Object sendRequest(int command, Object argument, Phone phone, WorkSource workSource) {
1555:                 command, argument, SubscriptionManager.INVALID_SUBSCRIPTION_ID, phone, workSource);
1564:             int command, Object argument, Integer subId, Phone phone, WorkSource workSource) {
1570:         if (subId != SubscriptionManager.INVALID_SUBSCRIPTION_ID && phone != null) {
1571:             throw new IllegalArgumentException("subId and phone cannot both be specified!");
1572:         } else if (phone != null) {
1573:             request = new MainThreadRequest(argument, phone, workSource);
1613:      * Same as {@link #sendRequestAsync(int,Object)} except it takes a Phone and WorkSource.
1617:             int command, Object argument, Phone phone, WorkSource workSource) {
1618:         MainThreadRequest request = new MainThreadRequest(argument, phone, workSource);
1656:         Phone thePhone = getPhone(getDefaultSubscription());
1663:         ServiceManager.addService("phone", this);
1667:         if (request.phone != null) {
1668:             return request.phone;
1680:         Phone phone = getPhoneFromRequest(request);
1681:         return phone == null ? null :
1682:                 UiccController.getInstance().getUiccCard(phone.getPhoneId());
1685:     // returns phone associated with the subId.
1690:     private void sendEraseModemConfig(Phone phone) {
1691:         if (phone != null) {
1693:                   mApp, phone.getSubId(), "eraseModemConfig");
1731:             // PENDING: should we just silently fail if phone is offhook or ringing?
1752:         // from the context of the phone app.
1755:         if (mAppOps.noteOp(AppOpsManager.OPSTR_CALL_PHONE, Binder.getCallingUid(), callingPackage)
1936:             final Phone phone = getPhone(subId);
1937:             if (phone != null) {
1938:                 phone.updateServiceLocation();
1982:             final Phone phone = getPhone(subId);
1983:             if (phone != null) {
1984:                 return phone.getServiceState().getState() != ServiceState.STATE_POWER_OFF;
2002:             final Phone phone = getPhone(subId);
2003:             if (phone != null) {
2004:                 phone.setRadioPower(!isRadioOnForSubscriber(subId));
2020:             final Phone phone = getPhone(subId);
2021:             if (phone == null) {
2024:             if ((phone.getServiceState().getState() != ServiceState.STATE_POWER_OFF) != turnOn) {
2042:                 Phone phone = PhoneFactory.getPhone(i);
2043:                 if (phone != null && phone.isRadioAvailable()) return true;
2059:                 logv("Shutting down Phone " + i);
2068:         Phone phone = PhoneFactory.getPhone(phoneId);
2069:         if (phone != null && phone.isRadioAvailable()) {
2070:             phone.shutdownRadio();
2079:             final Phone defaultPhone = PhoneFactory.getDefaultPhone();
2084:                 loge("There's no default phone.");
2097:             final Phone phone = getPhone(subId);
2098:             if (phone != null) {
2099:                 phone.setRadioPower(turnOn);
2117:             final Phone phone = getPhone(subId);
2118:             if (phone != null) {
2119:                 phone.getDataEnabledSettings().setUserDataEnabled(true);
2137:             final Phone phone = getPhone(subId);
2138:             if (phone != null) {
2139:                 phone.getDataEnabledSettings().setUserDataEnabled(false);
2153:             final Phone phone = getPhone(subId);
2154:             if (phone != null) {
2155:                 return phone.isDataAllowed(ApnSetting.TYPE_DEFAULT);
2204:             Phone phone = PhoneFactory.getPhone(slotIndex);
2205:             return phone == null ? TelephonyManager.CALL_STATE_IDLE :
2206:                     PhoneConstantConversions.convertCallState(phone.getState());
2221:             final Phone phone = getPhone(subId);
2222:             if (phone != null) {
2223:                 return PhoneConstantConversions.convertDataState(phone.getDataConnectionState());
2242:             final Phone phone = getPhone(subId);
2243:             if (phone != null) {
2244:                 return DefaultPhoneNotifier.convertDataActivityState(phone.getDataActivityState());
2272:                 return (getDefaultPhone().getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA)
2293:             if (phoneId == SubscriptionManager.INVALID_PHONE_INDEX) {
2294:                 // Get default phone in this case.
2295:                 phoneId = SubscriptionManager.DEFAULT_PHONE_INDEX;
2305:             Phone phone = PhoneFactory.getPhone(phoneId);
2306:             if (phone != null) {
2307:                 ServiceStateTracker sst = phone.getServiceStateTracker();
2308:                 EmergencyNumberTracker emergencyNumberTracker = phone.getEmergencyNumberTracker();
2338:             final Phone phone = getPhone(subId);
2339:             if (phone != null) {
2340:                 phone.enableLocationUpdates();
2359:             final Phone phone = getPhone(subId);
2360:             if (phone != null) {
2361:                 phone.disableLocationUpdates();
2420:         for (Phone phone : PhoneFactory.getPhones()) {
2421:             List<CellInfo> info = phone.getAllCellInfo();
2460:             for (Phone phone : PhoneFactory.getPhones()) {
2462:                         CMD_GET_ALL_CELL_INFO, null, phone, workSource);
2513:         final Phone phone = getPhoneFromSubId(subId);
2514:         if (phone == null) throw new IllegalArgumentException("Invalid Subscription Id: " + subId);
2516:         sendRequestAsync(CMD_REQUEST_CELL_INFO_UPDATE, cb, phone, workSource);
2534:         Phone phone = PhoneFactory.getPhone(slotIndex);
2535:         if (phone == null) {
2538:         int subId = phone.getSubId();
2546:             return phone.getImei();
2554:         Phone phone = PhoneFactory.getPhone(slotIndex);
2556:         if (phone != null) {
2557:             String imei = phone.getImei();
2565:         Phone phone = PhoneFactory.getPhone(slotIndex);
2566:         if (phone == null) {
2570:         int subId = phone.getSubId();
2578:             return phone.getMeid();
2586:         Phone phone = PhoneFactory.getPhone(slotIndex);
2588:         if (phone != null) {
2589:             String meid = phone.getMeid();
2598:         Phone phone = PhoneFactory.getPhone(slotIndex);
2599:         if (phone == null) {
2602:         int subId = phone.getSubId();
2611:             return phone.getDeviceSvn();
2621:             final Phone phone = getPhone(subId);
2622:             return phone == null ? TelephonyManager.UNKNOWN_CARRIER_ID : phone.getCarrierId();
2632:             final Phone phone = getPhone(subId);
2633:             return phone == null ? null : phone.getCarrierName();
2643:             final Phone phone = getPhone(subId);
2644:             return phone == null ? TelephonyManager.UNKNOWN_CARRIER_ID
2645:                     : phone.getSpecificCarrierId();
2655:             final Phone phone = getPhone(subId);
2656:             return phone == null ? null : phone.getSpecificCarrierName();
2667:         final Phone phone = PhoneFactory.getPhone(slotIndex);
2668:         if (phone == null) {
2673:             return CarrierResolver.getCarrierIdFromMccMnc(phone.getContext(), mccmnc);
2684:      * Make sure the caller has the MODIFY_PHONE_STATE permission.
2689:         mApp.enforceCallingOrSelfPermission(android.Manifest.permission.MODIFY_PHONE_STATE, null);
2709:      * Make sure the caller has the CALL_PHONE permission.
2714:         mApp.enforceCallingOrSelfPermission(android.Manifest.permission.CALL_PHONE, null);
2750:             final Phone phone = PhoneFactory.getPhone(slotIndex);
2751:             if (phone == null) {
2752:                 return PhoneConstants.PHONE_TYPE_NONE;
2754:                 return phone.getPhoneType();
2781:             final Phone phone = getPhone(subId);
2782:             if (phone != null) {
2783:                 return phone.getCdmaEriIconIndex();
2814:             final Phone phone = getPhone(subId);
2815:             if (phone != null) {
2816:                 return phone.getCdmaEriIconMode();
2845:             final Phone phone = getPhone(subId);
2846:             if (phone != null) {
2847:                 return phone.getCdmaEriText();
2866:             final Phone phone = getPhone(subId);
2867:             if (phone != null && phone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA) {
2868:                 return phone.getLine1Number();
2870:                 loge("getCdmaMdn: no phone found. Invalid subId: " + subId);
2888:             final Phone phone = getPhone(subId);
2889:             if (phone != null && phone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA) {
2890:                 return phone.getCdmaMin();
2902:         if (mApp.checkCallingOrSelfPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
2904:             throw new SecurityException("Caller must hold the MODIFY_PHONE_STATE permission");
3068:             final Phone phone = getPhone(subId);
3069:             if (phone != null) {
3070:                 phone.setVoiceActivationState(activationState);
3089:             final Phone phone = getPhone(subId);
3090:             if (phone != null) {
3091:                 phone.setDataActivationState(activationState);
3107:         final Phone phone = getPhone(subId);
3110:             if (phone != null) {
3111:                 return phone.getVoiceActivationState();
3127:         final Phone phone = getPhone(subId);
3130:             if (phone != null) {
3131:                 return phone.getDataActivationState();
3153:             final Phone phone = getPhone(subId);
3154:             if (phone != null) {
3155:                 return phone.getVoiceMessageCount();
3172:             final Phone phone = getPhone(subId);
3173:             return (phone == null ? false : phone.isConcurrentVoiceAndDataAllowed());
3186:         final Phone defaultPhone = getDefaultPhone();
3224:             for (Phone phone : PhoneFactory.getPhones()) {
3225:                 if (phone.isInEmergencySmsMode()) {
3236:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3263:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3301:             Phone phone = getPhone(subId);
3302:             if (phone == null) {
3307:             phone.getImsRegistrationState(regState -> {
3334:             Phone phone = getPhone(subId);
3335:             if (phone == null) {
3340:             phone.getImsRegistrationTech(regTech -> {
3359:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3385:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3436:             Phone phone = getPhone(subId);
3437:             if (phone == null) return false;
3438:             return phone.isImsCapabilityAvailable(capability, regTech);
3486:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3523:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3557:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3592:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3644:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3726:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3793:         Phone phone = getPhone(subId);
3794:         if (phone == null) {
3795:             loge("phone instance null for subid " + subId);
3799:             if (!doesImsCapabilityRequireProvisioning(phone.getContext(), subId, capability)) {
3803:             if (!doesRcsCapabilityRequireProvisioning(phone.getContext(), subId, capability)) {
4237:             final Phone phone = getPhone(subId);
4238:             if (phone != null) {
4239:                 return phone.getServiceState().getDataNetworkType();
4271:             final Phone phone = getPhone(subId);
4272:             if (phone != null) {
4273:                 return phone.getServiceState().getDataNetworkType();
4296:             final Phone phone = getPhone(subId);
4297:             if (phone != null) {
4298:                 return phone.getServiceState().getVoiceNetworkType();
4323:             final Phone phone = PhoneFactory.getPhone(slotIndex);
4324:             if (phone != null) {
4325:                 return phone.getIccCard().hasIccCard();
4340:      * @return {@link Phone#LTE_ON_CDMA_UNKNOWN}, {@link Phone#LTE_ON_CDMA_FALSE}
4341:      * or {@link Phone#LTE_ON_CDMA_TRUE}
4360:             final Phone phone = getPhone(subId);
4361:             if (phone == null) {
4364:                 return phone.getLteOnCdmaMode();
4428:                     + " does not correspond to an active phone");
4459:     private IccOpenLogicalChannelResponse iccOpenLogicalChannelWithPermission(Phone phone,
4476:                     CMD_OPEN_CHANNEL, new Pair<String, Integer>(aid, p2), phone,
4501:     private boolean iccCloseLogicalChannelWithPermission(Phone phone, int channel) {
4507:             Boolean success = (Boolean) sendRequest(CMD_CLOSE_CHANNEL, channel, phone,
4544:     private String iccTransmitApduLogicalChannelWithPermission(Phone phone, int channel, int cla,
4553:                     new IccAPDUArgument(channel, cla, command, p1, p2, p3, data), phone,
4600:     private String iccTransmitApduBasicChannelWithPermission(Phone phone, String callingPackage,
4618:                     new IccAPDUArgument(0, cla, command, p1, p2, p3, data), phone,
4852:         Phone phone = PhoneFactory.getPhone(slotIndex);
4853:         if (phone != null) {
4855:                     mApp, phone.getSubId(), "resetModemConfig");
4878:         Phone phone = PhoneFactory.getPhone(slotIndex);
4879:         if (phone != null) {
4881:                     mApp, phone.getSubId(), "rebootModem");
4897:         final Phone defaultPhone = getDefaultPhone();
5422:         final Phone defaultPhone = getDefaultPhone();
5560:         final Phone phone = getPhone(subId);
5562:             if (phone != null) {
5563:                 return phone.hasMatchedTetherApnSetting();
5587:             Phone phone = PhoneFactory.getPhone(phoneId);
5588:             if (phone != null) {
5590:                 phone.getDataEnabledSettings().setUserDataEnabled(enable);
5592:                 loge("setUserDataEnabled: no phone found. Invalid subId=" + subId);
5610:         final Phone phone = getPhone(subId);
5612:             if (phone != null) {
5617:                 phone.setAlwaysReportSignalStrength(isEnable);
5619:                 loge("setAlwaysReportSignalStrength: no phone found for subId="
5648:      * Accepts either ACCESS_NETWORK_STATE, MODIFY_PHONE_STATE or carrier privileges.
5666:             Phone phone = PhoneFactory.getPhone(phoneId);
5667:             if (phone != null) {
5668:                 boolean retVal = phone.isUserDataEnabled();
5672:                 if (DBG) loge("isUserDataEnabled: no phone subId=" + subId + " retVal=false");
5695:             Phone phone = PhoneFactory.getPhone(phoneId);
5696:             if (phone != null) {
5697:                 boolean retVal = phone.getDataEnabledSettings().isDataEnabled();
5701:                 if (DBG) loge("isDataEnabled: no phone subId=" + subId + " retVal=false");
5710:             Phone phone) {
5716:         PackageManager pkgMgr = phone.getContext().getPackageManager();
5721:             SubscriptionInfo subInfo = subController.getSubscriptionInfo(phone.getSubId());
5723:                     phone.getContext().getSystemService(Context.TELEPHONY_SUBSCRIPTION_SERVICE);
5735:     private int getCarrierPrivilegeStatusFromCarrierConfigRules(int privilegeFromSim, Phone phone,
5744:             SubscriptionInfo subInfo = subController.getSubscriptionInfo(phone.getSubId());
5746:                     phone.getContext().getSystemService(Context.TELEPHONY_SUBSCRIPTION_SERVICE);
5756:         final Phone phone = getPhone(subId);
5757:         if (phone == null) {
5761:         UiccCard card = UiccController.getInstance().getUiccCard(phone.getPhoneId());
5769:                 phone.getContext().getPackageManager()), Binder.getCallingUid(), phone);
5775:         final Phone phone = getPhone(subId);
5776:         if (phone == null) {
5781:                 UiccController.getInstance().getUiccProfileForPhone(phone.getPhoneId());
5788:                         phone.getContext().getPackageManager(), uid), uid, phone);
5893:         final Phone phone = getPhone(subId);
5894:         UiccCard card = phone == null ? null : phone.getUiccCard();
5916:             final Phone phone = getPhone(subId);
5917:             if (phone == null) {
5920:             final String subscriberId = phone.getSubscriberId();
6143:             final Phone phone = getPhone(subId);
6144:             return phone == null ? false : phone.setOperatorBrandOverride(brand);
6159:             final Phone phone = getPhone(subId);
6160:             if (phone == null) {
6163:             return phone.setRoamingOverride(gsmRoamingList, gsmNonRoamingList, cdmaRoamingList,
6214:         Phone phone = PhoneFactory.getPhone(phoneId);
6216:         if (phone == null) {
6223:                             mApp, phone.getSubId(), "getRadioAccessFamily");
6233:         final Phone defaultPhone = getDefaultPhone();
6247:         final Phone defaultPhone = getDefaultPhone();
6301:                     .getBoolean(CarrierConfigManager.KEY_WORLD_PHONE_BOOL);
6332:         final Phone phone = getPhone(subscriptionId);
6333:         if (phone == null) {
6334:             loge("isRttSupported: no Phone found. Invalid subId:" + subscriptionId);
6341:                     phone.getContext().getResources().getBoolean(R.bool.config_support_rtt);
6374:      * Returns the unique device ID of phone, for example, the IMEI for
6378:      *   {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
6382:         final Phone phone = PhoneFactory.getPhone(0);
6383:         if (phone == null) {
6386:         int subId = phone.getSubId();
6394:             return phone.getDeviceId();
6407:         Phone phone = getPhone(subId);
6408:         if (phone != null) {
6409:             return phone.isImsRegistered();
6430:             throw new SecurityException("Requires READ_PHONE_STATE permission.");
6444:             Phone phone = getPhone(subscriptionId);
6445:             if (phone == null) {
6448:             return PhoneUtils.makePstnPhoneAccountHandle(phone);
6460:             Phone phone = getPhone(subId);
6461:             if (phone != null) {
6462:                 return phone.isWifiCallingEnabled();
6477:             Phone phone = getPhone(subId);
6478:             if (phone != null) {
6479:                 return phone.isVideoEnabled();
6495:             Phone phone = getPhone(subId);
6496:             if (phone != null) {
6497:                 return phone.getImsRegistrationTech();
6555:         final Phone phone = getPhone(subId);
6556:         if (phone == null) {
6563:                     phone.getContext().getOpPackageName(), null);
6572:             final Locale localeFromDefaultSim = phone.getLocaleFromSimAndCarrierPrefs();
6700:             final Phone phone = getPhone(subId);
6701:             if (phone == null) {
6705:             ServiceState ss = phone.getServiceState();
6718:      * Returns the URI for the per-account voicemail ringtone set in Phone settings.
6729:             Phone phone = PhoneUtils.getPhoneForPhoneAccountHandle(accountHandle);
6730:             if (phone == null) {
6731:                 phone = getDefaultPhone();
6734:             return VoicemailNotificationSettingsUtil.getRingtoneUri(phone.getContext());
6744:      * has permission {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}.
6754:         final Phone defaultPhone = getDefaultPhone();
6765:             Phone phone = PhoneUtils.getPhoneForPhoneAccountHandle(phoneAccountHandle);
6766:             if (phone == null) {
6767:                 phone = defaultPhone;
6769:             VoicemailNotificationSettingsUtil.setRingtoneUri(phone.getContext(), uri);
6776:      * Returns whether vibration is set for voicemail notification in Phone settings.
6786:             Phone phone = PhoneUtils.getPhoneForPhoneAccountHandle(accountHandle);
6787:             if (phone == null) {
6788:                 phone = getDefaultPhone();
6791:             return VoicemailNotificationSettingsUtil.isVibrationEnabled(phone.getContext());
6801:      * has permission {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}.
6811:         final Phone defaultPhone = getDefaultPhone();
6822:             Phone phone = PhoneUtils.getPhoneForPhoneAccountHandle(phoneAccountHandle);
6823:             if (phone == null) {
6824:                 phone = defaultPhone;
6826:             VoicemailNotificationSettingsUtil.setVibrationEnabled(phone.getContext(), enabled);
6833:      * Make sure either called from same process as self (phone) or IPC caller has read privilege.
6838:         mApp.enforceCallingOrSelfPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE,
6843:      * Make sure either called from same process as self (phone) or IPC caller has send SMS
6886:         Phone phone = getPhone(subId);
6890:             if (phone == null) {
6895:                 aid = UiccController.getInstance().getUiccCard(phone.getPhoneId())
6915:         Phone phone = getPhone(subId);
6919:             if (phone == null) {
6924:                 esn = phone.getEsn();
6943:         Phone phone = getPhone(subId);
6947:             if (phone == null) {
6952:                 cdmaPrlVersion = phone.getCdmaPrlVersion();
7046:         final Phone phone = getPhone(subId);
7049:         if (phone == null) {
7054:             phone.carrierActionSetMeteredApnsEnabled(enabled);
7071:         final Phone phone = getPhone(subId);
7074:         if (phone == null) {
7079:             phone.carrierActionSetRadioEnabled(enabled);
7099:         final Phone phone = getPhone(subId);
7102:         if (phone == null) {
7107:             phone.carrierActionReportDefaultNetworkStatus(report);
7123:         final Phone phone = getPhone(subId);
7124:         if (phone == null) {
7129:             phone.carrierActionResetAll();
7136:      * Called when "adb shell dumpsys phone" is invoked. Dump is also automatically invoked when a
7143:             writer.println("Permission Denial: can't dump Phone from pid="
7173:             Phone phone = getPhone(subId);
7174:             if (phone != null) {
7175:                 phone.getDataEnabledSettings().setPolicyDataEnabled(enabled);
7194:         Phone phone = getPhone(subId);
7198:             if (phone != null) {
7199:                 return phone.getClientRequestStats();
7226:         Phone phone = PhoneFactory.getPhone(slotIndex);
7232:             if (phone != null) {
7233:                 phone.setSimPowerState(state, workSource);
7255:      * Check if phone is in emergency callback mode
7256:      * @return true if phone is in emergency callback mode
7262:         final Phone phone = getPhone(subId);
7266:             if (phone != null) {
7267:                 return phone.isInEcm();
7287:             Phone p = getPhone(subId);
7307:         Phone phone = PhoneFactory.getPhone(slotIndex);
7308:         if (phone != null) {
7309:             if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp, phone.getSubId(),
7316:                 return phone.getRadioPowerState();
7329:      * {@link android.Manifest.permission#READ_PHONE_STATE} or that the calling app has carrier
7344:             Phone phone = getPhone(subId);
7345:             isEnabled =  phone != null ? phone.getDataRoamingEnabled() : false;
7360:      * {@link android.Manifest.permission#MODIFY_PHONE_STATE} or that the calling app has carrier
7373:             Phone phone = getPhone(subId);
7374:             if (phone != null) {
7375:                 phone.setDataRoamingEnabled(isEnabled);
7391:             Phone phone = getPhone(subId);
7392:             if (phone != null) {
7393:                 isAllowed = phone.isCspPlmnEnabled();
7408:             // even without READ_PRIVILEGED_PHONE_STATE, we allow the call to continue if the caller
7545:      * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}.
7554:             Phone phone = getPhone(subId);
7555:             if (phone == null) {
7558:             UiccCard uiccCard = phone.getUiccCard();
7595:      * not set, return {@link Phone#PREFERRED_NT_MODE}.
7603:         return Phone.PREFERRED_NT_MODE;
7613:             final Phone phone = getPhone(subId);
7614:             if (phone == null) {
7618:             phone.setCarrierTestOverride(mccmnc, imsi, iccid, gid1, gid2, plmn, spn,
7631:             final Phone phone = getPhone(subId);
7632:             if (phone == null) {
7636:             return phone.getCarrierIdListVersion();
7705:             throw new SecurityException("Requires READ_PHONE_STATE permission.");
7710:             for (Phone phone: PhoneFactory.getPhones()) {
7711:                 if (phone.getEmergencyNumberTracker() != null
7712:                         && phone.getEmergencyNumberTracker().getEmergencyNumberList() != null) {
7714:                             phone.getSubId(),
7715:                             phone.getEmergencyNumberTracker().getEmergencyNumberList());
7726:         final Phone defaultPhone = getDefaultPhone();
7734:             for (Phone phone: PhoneFactory.getPhones()) {
7735:                 if (phone.getEmergencyNumberTracker() != null
7736:                         && phone.getEmergencyNumberTracker() != null) {
7737:                     if (phone.getEmergencyNumberTracker().isEmergencyNumber(
7759:             for (Phone phone: PhoneFactory.getPhones()) {
7760:                 EmergencyNumberTracker tracker = phone.getEmergencyNumberTracker();
7781:             for (Phone phone: PhoneFactory.getPhones()) {
7782:                 EmergencyNumberTracker tracker = phone.getEmergencyNumberTracker();
7801:             final Phone phone = getPhone(subId);
7802:             if (phone == null) {
7806:             return phone.getEmergencyNumberDbVersion();
7818:             for (Phone phone: PhoneFactory.getPhones()) {
7819:                 EmergencyNumberTracker tracker = phone.getEmergencyNumberTracker();
7835:             for (Phone phone: PhoneFactory.getPhones()) {
7836:                 EmergencyNumberTracker tracker = phone.getEmergencyNumberTracker();
7852:             for (Phone phone: PhoneFactory.getPhones()) {
7853:                 EmergencyNumberTracker tracker = phone.getEmergencyNumberTracker();
7866:         Phone phone = getPhone(subId);
7867:         if (phone == null) {
7873:                     .getUiccProfileForPhone(phone.getPhoneId());
7892:             Phone phone = PhoneFactory.getPhone(slotIndex);
7893:             if (phone == null) {
7896:                 return (Boolean) sendRequest(CMD_REQUEST_ENABLE_MODEM, enable, phone, null);
7909:         Phone phone = PhoneFactory.getPhone(slotIndex);
7910:         if (phone == null) return false;
7913:                 mApp, phone.getSubId(), callingPackage, callingFeatureId,
7915:             throw new SecurityException("Requires READ_PHONE_STATE permission.");
7921:                 return mPhoneConfigurationManager.getPhoneStatusFromCache(phone.getPhoneId());
7923:                 return (Boolean) sendRequest(CMD_GET_MODEM_STATUS, null, phone, null);
7991:      * Note: Switch from multi-sim to single-sim is only possible with MODIFY_PHONE_STATE
7992:      * permission, but the other way around is possible with either MODIFY_PHONE_STATE
8021:         Phone phone = getPhone(subId);
8022:         if (phone == null) {
8027:             UiccCard uiccCard = phone.getUiccCard();
8097:         Phone phone = getDefaultPhone();
8098:         if (phone == null) return -1;
8099:         HalVersion hv = phone.getHalVersion();
8129:         enforceReadPrivilegedPermission("Needs READ_PRIVILEGED_PHONE_STATE for "
8135:             Phone phone = getPhone(subId);
8136:             if (phone == null) return false;
8138:             boolean isMetered = ApnSettingUtils.isMeteredApnType(apnType, phone);
8139:             return !isMetered || phone.getDataEnabledSettings().isDataEnabled(apnType);
8152:             Phone phone = getPhone(subId);
8153:             if (phone == null) return true; // By default return true.
8155:             return ApnSettingUtils.isMeteredApnType(apnType, phone);
8167:             Phone phone = getPhone(subscriptionId);
8168:             if (phone == null) {
8188:             sendRequestAsync(CMD_SET_SYSTEM_SELECTION_CHANNELS, argument, phone, null);
8258:             Phone phone = getPhone(subId);
8259:             if (phone == null) return false;
8261:             return phone.getDataEnabledSettings().setAllowDataDuringVoiceCall(allow);
8274:             Phone phone = getPhone(subId);
8275:             if (phone == null) return false;
8277:             return phone.getDataEnabledSettings().isDataAllowedInVoiceCall();
8290:             Phone phone = getPhone(subId);
8291:             if (phone == null) return false;
8293:             return phone.getDataEnabledSettings().setAlwaysAllowMmsData(alwaysAllow);
8311:             for (Phone phone : PhoneFactory.getPhones()) {
8312:                 Phone defaultPhone = phone.getImsPhone();
8313:                 if (defaultPhone != null && defaultPhone.getPhoneType() == PHONE_TYPE_IMS) {
8358:             Phone phone = getPhone(subId);
8359:             if (phone != null && phone.getIccCard() != null) {
8360:                 return phone.getIccCard().getIccLockEnabled();
8380:         Phone phone = getPhone(subId);
8381:         if (phone == null) {
8388:                     new Pair<Boolean, String>(enabled, password), phone, null);
8410:         Phone phone = getPhone(subId);
8411:         if (phone == null) {
8418:                     new Pair<String, String>(oldPassword, newPassword), phone, null);
22: import static com.android.internal.telephony.PhoneConstants.SUBSCRIPTION_KEY;
65: import android.telecom.PhoneAccount;
66: import android.telecom.PhoneAccountHandle;
85: import android.telephony.PhoneCapability;
86: import android.telephony.PhoneNumberRange;
143: import com.android.internal.telephony.PhoneConfigurationManager;
144: import com.android.internal.telephony.PhoneConstantConversions;
145: import com.android.internal.telephony.PhoneConstants;
146: import com.android.internal.telephony.PhoneFactory;
159: import com.android.internal.telephony.imsphone.ImsPhone;
160: import com.android.internal.telephony.imsphone.ImsPhoneCallTracker;
199:     private static final String LOG_TAG = "PhoneInterfaceManager";
200:     private static final boolean DBG = (PhoneGlobals.DBG_LEVEL >= 2);
297:     private static PhoneInterfaceManager sInstance;
299:     private PhoneGlobals mApp;
690:                     defaultPhone.nvReadItem((Integer) request.argument, onCompleted,
717:                     defaultPhone.nvWriteItem(idValue.first, idValue.second, onCompleted,
728:                     defaultPhone.nvWriteCdmaPrl((byte[]) request.argument, onCompleted);
738:                     defaultPhone.resetModemConfig(onCompleted);
784:                     defaultPhone.invokeOemRilRequestRaw((byte[]) request.argument, onCompleted);
1022:                     if (defaultPhone != null) {
1023:                         defaultPhone.getModemActivityInfo(onCompleted, request.workSource);
1086:                     defaultPhone.setAllowedCarriers(argument, onCompleted, request.workSource);
1114:                     defaultPhone.getAllowedCarriers(onCompleted, request.workSource);
1320:                     defaultPhone.rebootModem(onCompleted);
1330:                     PhoneConfigurationManager.getInstance()
1340:                         mPhoneConfigurationManager.addToPhoneStatusCache(phoneId, msg.arg1 == 1);
1351:                     PhoneConfigurationManager.getInstance()
1439:                     defaultPhone.eraseModemConfig(onCompleted);
1624:      * Initialize the singleton PhoneInterfaceManager instance.
1625:      * This is only done once, at startup, from PhoneApp.onCreate().
1627:     /* package */ static PhoneInterfaceManager init(PhoneGlobals app) {
1628:         synchronized (PhoneInterfaceManager.class) {
1630:                 sInstance = new PhoneInterfaceManager(app);
1641:         mCM = PhoneGlobals.getInstance().mCM;
1642:         mImsResolver = PhoneGlobals.getInstance().getImsResolver();
1650:         mPhoneConfigurationManager = PhoneConfigurationManager.getInstance();
1657:         return (thePhone != null) ? thePhone : PhoneFactory.getDefaultPhone();
1676:                 ? getDefaultPhone() : getPhone(subId);
1687:         return PhoneFactory.getPhone(mSubscriptionController.getPhoneId(subId));
1705:         PackageManager pm = getDefaultPhone().getContext().getPackageManager();
1732:             PhoneConstants.State state = mCM.getState(subId);
1733:             if (state != PhoneConstants.State.OFFHOOK && state != PhoneConstants.State.RINGING) {
1792:         return (resultArray[0] == PhoneConstants.PIN_RESULT_SUCCESS) ? true : false;
1797:         return (resultArray[0] == PhoneConstants.PIN_RESULT_SUCCESS) ? true : false;
1805:             final UnlockSim checkSimPin = new UnlockSim(getPhone(subId).getIccCard());
1818:             final UnlockSim checkSimPuk = new UnlockSim(getPhone(subId).getIccCard());
1835:         private int mResult = PhoneConstants.PIN_GENERAL_FAILURE;
1865:                                             mResult = PhoneConstants.PIN_PASSWORD_INCORRECT;
1867:                                             mResult = PhoneConstants.PIN_GENERAL_FAILURE;
1870:                                         mResult = PhoneConstants.PIN_RESULT_SUCCESS;
2045:             logv(TelephonyManager.getDefault().getPhoneCount() + " Phones are shutdown.");
2080:             if (defaultPhone != null) {
2081:                 defaultPhone.setRadioPower(turnOn);
2225:                 return PhoneConstantConversions.convertDataState(
2226:                         PhoneConstants.DataState.DISCONNECTED);
2297:             final int subId = mSubscriptionController.getSubIdUsingPhoneId(phoneId);
2526:             getDefaultPhone().setCellInfoListRate(rateInMillis, workSource);
2730:         Log.d(LOG_TAG, "[PhoneIntfMgr] " + msg);
2734:         Log.v(LOG_TAG, "[PhoneIntfMgr] " + msg);
2738:         Log.e(LOG_TAG, "[PhoneIntfMgr] " + msg);
2900:     public void requestNumberVerification(PhoneNumberRange range, long timeoutMillis,
2929:             return getDefaultPhone().needsOtaServiceProvisioning();
2964:             PhoneAccountHandle phoneAccountHandle = PhoneAccountHandleConverter.fromSubId(subId);
2965:             if (phoneAccountHandle == null) {
2968:             return VisualVoicemailSettingsUtil.dump(mApp, phoneAccountHandle);
3053:         SmsController smsController = PhoneFactory.getSmsController();
3188:         TelecomManager tm = defaultPhone.getContext().getSystemService(TelecomManager.class);
3197:             defaultPhone.sendDialerSpecialCode(inputCode);
3252:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3276:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone.
3372:         // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3399:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone.
3415:         // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3494:         // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3512:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3532:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3547:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3566:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3582:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3601:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3617:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3633:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3653:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3669:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3684:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3700:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3716:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3735:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3754:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3772:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3817:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3847:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3880:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3939:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
4108:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
4133:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
4159:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
4185:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
4355:             return PhoneConstants.LTE_ON_CDMA_UNKNOWN;
4362:                 return PhoneConstants.LTE_ON_CDMA_UNKNOWN;
4425:         int phoneId = UiccController.getInstance().getPhoneIdFromSlotId(slotIndex);
4426:         if (phoneId == -1) {
4430:         return PhoneFactory.getPhone(phoneId);
4465:                 ComponentInfo bestComponent = EuiccConnector.findBestComponent(getDefaultPhone()
4607:                 ComponentInfo bestComponent = EuiccConnector.findBestComponent(getDefaultPhone()
4898:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp, defaultPhone.getSubId(),
4905:             return defaultPhone.getPcscfAddress(apnType);
5156:             getDefaultPhone().setImsRegistrationState(registered);
5362:                     request, messenger, binder, getPhone(subId),
5423:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp, defaultPhone.getSubId(),
5431:             return PhoneFactory.calculatePreferredNetworkType(defaultPhone.getContext(), 0);
5585:             int phoneId = mSubscriptionController.getPhoneId(subId);
5586:             if (DBG) log("setUserDataEnabled: subId=" + subId + " phoneId=" + phoneId);
5664:             int phoneId = mSubscriptionController.getPhoneId(subId);
5665:             if (DBG) log("isUserDataEnabled: subId=" + subId + " phoneId=" + phoneId);
5693:             int phoneId = mSubscriptionController.getPhoneId(subId);
5694:             if (DBG) log("isDataEnabled: subId=" + subId + " phoneId=" + phoneId);
5797:         int phoneId = SubscriptionManager.getPhoneId(subId);
5798:         UiccCard card = UiccController.getInstance().getUiccCard(phoneId);
5805:             getPhone(phoneId), pkgName);
5822:                 getPhone(i), pkgName);
5833:         if (!SubscriptionManager.isValidPhoneId(phoneId)) {
5834:             loge("phoneId " + phoneId + " is not valid.");
5837:         UiccCard card = UiccController.getInstance().getUiccCard(phoneId);
5839:             loge("getCarrierPackageNamesForIntentAndPhone: No UICC");
5846:     public List<String> getPackagesWithCarrierPrivileges(int phoneId) {
5850:         UiccCard card = UiccController.getInstance().getUiccCard(phoneId);
6213:     public int getRadioAccessFamily(int phoneId, String callingPackage) {
6224:             raf = ProxyController.getInstance().getRadioAccessFamily(phoneId);
6238:             ImsManager.getInstance(defaultPhone.getContext(),
6239:                     defaultPhone.getPhoneId()).setVtSetting(enable);
6248:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp, defaultPhone.getSubId(),
6260:                     ImsManager.getInstance(defaultPhone.getContext(), defaultPhone.getPhoneId());
6375:      * GSM and the MEID for CDMA phones. Return null if device ID is not available.
6419:             return PhoneUtils.getSubIdForPhoneAccount(phoneAccount);
6427:             PhoneAccountHandle phoneAccountHandle, String callingPackage, String callingFeatureId) {
6434:             return PhoneUtils.getSubIdForPhoneAccountHandle(phoneAccountHandle);
6528:             cleanUpSmsRawTable(getDefaultPhone().getContext());
6539:               sendEraseModemConfig(getDefaultPhone());
6720:      * @param accountHandle The handle for the {@link PhoneAccount} for which to retrieve the
6723:      * PhoneAccount.
6726:     public Uri getVoicemailRingtoneUri(PhoneAccountHandle accountHandle) {
6746:      * @param phoneAccountHandle The handle for the {@link PhoneAccount} for which to set the
6749:      * PhoneAccount.
6753:             PhoneAccountHandle phoneAccountHandle, Uri uri) {
6756:         TelecomManager tm = defaultPhone.getContext().getSystemService(TelecomManager.class);
6759:                     mApp, PhoneUtils.getSubIdForPhoneAccountHandle(phoneAccountHandle),
6778:      * @param accountHandle The handle for the {@link PhoneAccount} for which to retrieve the
6780:      * @return {@code true} if the vibration is set for this PhoneAccount, {@code false} otherwise.
6783:     public boolean isVoicemailVibrationEnabled(PhoneAccountHandle accountHandle) {
6803:      * @param phoneAccountHandle The handle for the {@link PhoneAccount} for which to set the
6806:      * specific PhoneAccount.
6810:             PhoneAccountHandle phoneAccountHandle, boolean enabled) {
6813:         TelecomManager tm = defaultPhone.getContext().getSystemService(TelecomManager.class);
6816:                     mApp, PhoneUtils.getSubIdForPhoneAccountHandle(phoneAccountHandle),
7157:         (new TelephonyShellCommand(this, getDefaultPhone().getContext()))
7410:             if (checkCarrierPrivilegesForPackageAnyPhone(callingPackage)
7599:         int phoneId = mSubscriptionController.getPhoneId(subId);
7600:         if (phoneId >= 0 && phoneId < list.size() && list.get(phoneId) != null) {
7601:             return list.get(phoneId);
7730:                             mApp, defaultPhone.getSubId(), "isEmergencyNumber(Potential)");
7948:                 getDefaultPhone().getSubId(), callingPackage, callingFeatureId,
7971:         PhoneCapability staticCapability =
8077:             int phoneCount = TelephonyManager.getDefault().getPhoneCount();
8079:             int[] logicalSlotsMapping = new int[phoneCount];
8211:         SmsPermissions permissions = new SmsPermissions(getDefaultPhone(), mApp,
8232:             return SubscriptionManager.getResourcesForSubId(getDefaultPhone().getContext(), subId)
8244:             return SubscriptionManager.getResourcesForSubId(getDefaultPhone().getContext(), subId)
8314:                     ImsPhone imsPhone = (ImsPhone) defaultPhone;
8316:                             (ImsPhoneCallTracker) imsPhone.getCallTracker();
8318:                     Rlog.i(LOG_TAG, "setCepEnabled isCepEnabled=" + isCepEnabled + ", for imsPhone "
8319:                             + imsPhone.getMsisdn());
132: import com.android.internal.telephony.DefaultPhoneNotifier;
473:                             getPhoneFromRequest(request).handlePinMmi((String) request.argument)
748:                     getPhoneFromRequest(request).getPreferredNetworkType(onCompleted);
774:                     getPhoneFromRequest(request).setPreferredNetworkType(networkType, onCompleted);
798:                     getPhoneFromRequest(request).setVoiceMailNumber(tagNum.first, tagNum.second,
810:                     getPhoneFromRequest(request).setNetworkSelectionModeAutomatic(onCompleted);
820:                     getPhoneFromRequest(request).getAvailableNetworks(onCompleted);
827:                     getPhoneFromRequest(request).getCallForwardingOption(
884:                     getPhoneFromRequest(request).setCallForwardingOption(
906:                     getPhoneFromRequest(request).getCallWaiting(onCompleted);
950:                     getPhoneFromRequest(request).setCallWaiting(isEnable, onCompleted);
1002:                     getPhoneFromRequest(request).selectNetworkManually(selArg.operatorInfo,
1197:                     getPhoneFromRequest(request).getNetworkSelectionMode(onCompleted);
1218:                     getPhoneFromRequest(request).queryCdmaRoamingPreference(onCompleted);
1234:                     getPhoneFromRequest(request).setCdmaRoamingPreference(mode, onCompleted);
1246:                     getPhoneFromRequest(request).setCdmaSubscription(subscriptionMode, onCompleted);
1361:                         mPhoneConfigurationManager.addToPhoneStatusCache(id,
1449:                     getPhoneFromRequest(request).getIccCard().changeIccLockPassword(
1467:                     getPhoneFromRequest(request).getIccCard().setIccLockEnabled(
1670:             return getPhoneFromSubId(request.subId);
1966:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
2041:             for (int i = 0; i < TelephonyManager.getDefault().getPhoneCount(); i++) {
2058:             for (int i = 0; i < TelephonyManager.getDefault().getPhoneCount(); i++) {
2060:                 shutdownRadioUsingPhoneId(i);
2603:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
2743:         return getActivePhoneTypeForSlot(getSlotForDefaultSubscription());
2773:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
2806:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
2837:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
2978:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
3146:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
3206:                     .enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3243:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3269:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3326:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3366:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3391:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3491:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3528:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3562:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3597:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3649:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3731:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3813:         checkModifyPhoneStatePermission(subId, "setRcsProvisioningStatusForCapability");
3877:         checkModifyPhoneStatePermission(subId, "setImsProvisioningStatusForCapability");
4229:                 && !TelephonyPermissions.checkCallingOrSelfReadPhoneStateNoThrow(
4263:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
4288:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
4380:         return mSubscriptionController.getPhoneId(getDefaultSubscription());
4442:         return iccOpenLogicalChannelWithPermission(getPhoneFromSubId(subId), callingPackage, aid,
4455:         return iccOpenLogicalChannelWithPermission(getPhoneFromSlotIdOrThrowException(slotIndex),
4490:         return iccCloseLogicalChannelWithPermission(getPhoneFromSubId(subId), channel);
4497:         return iccCloseLogicalChannelWithPermission(getPhoneFromSlotIdOrThrowException(slotIndex),
4526:         return iccTransmitApduLogicalChannelWithPermission(getPhoneFromSubId(subId), channel, cla,
4540:                 getPhoneFromSlotIdOrThrowException(slotIndex), channel, cla, command, p1, p2, p3,
4579:         return iccTransmitApduBasicChannelWithPermission(getPhoneFromSubId(subId), callingPackage,
4595:                 getPhoneFromSlotIdOrThrowException(slotIndex), callingPackage, cla, command, p1,
4680:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
4718:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp, subId, callingPackage,
5099:                 .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
5446:                 .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
5492:                 .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
5813:         for (int i = 0; i < TelephonyManager.getDefault().getPhoneCount(); i++) {
5877:         enforceReadPrivilegedPermission("getPackagesWithCarrierPrivilegesForAllPhones");
5883:             for (int i = 0; i < TelephonyManager.getDefault().getPhoneCount(); i++) {
5963:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneNumber(
5990:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
6013:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
6222:                     .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
6272:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
6291:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
6428:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp, getDefaultSubscription(),
6429:                 callingPackage, callingFeatureId, "getSubIdForPhoneAccountHandle")) {
6664:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
7190:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
7347:             TelephonyPermissions.enforeceCallingOrSelfReadPhoneStatePermissionOrCarrierPrivilege(
7385:                 .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
7509:                         slot.getPhoneId(),
7645:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
7653:             return mPhoneConfigurationManager.getNumberOfModemsWithSimultaneousDataConnections();
7662:                 .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
7702:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
7729:                     .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
7912:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
7947:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp,
7972:                 mPhoneConfigurationManager.getStaticPhoneCapability();
8012:             mPhoneConfigurationManager.switchMultiSimConfig(numOfSims);
8052:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
8059:             return mPhoneConfigurationManager.isRebootRequiredForModemConfigChange();
8068:         metrics.updateEnabledModemBitmap((1 << TelephonyManager.from(mApp).getPhoneCount()) - 1);
8082:                 if (SubscriptionManager.isValidPhoneId(slotInfos[i].getLogicalSlotIdx())) {
8197:                 SubscriptionManager.getPhoneId(subId), UiccController.APP_FAM_3GPP);
8315:                     ImsPhoneCallTracker imsPhoneCallTracker =
8317:                     imsPhoneCallTracker.setConferenceEventPackageEnabled(isCepEnabled);
android.googlesource.com/platform/superproject:packages/services/Telephony/src/com/android/phone/PhoneInterfaceManager.java: [ master, ] Duplicate result
android.googlesource.com/platform/frameworks/opt/telephony:src/java/com/android/internal/telephony/Phone.java: [ master, ]
116: public abstract class Phone extends Handler implements PhoneInternalInterface {
490:     protected Phone(String name, PhoneNotifier notifier, Context context, CommandsInterface ci,
507:     protected Phone(String name, PhoneNotifier notifier, Context context, CommandsInterface ci,
326:     protected Phone mImsPhone = null;
584:     public void createImsPhone() {
3476:     public Phone getImsPhone() {
4131:     public Phone getDefaultPhone() {
193:     protected static final int EVENT_UPDATE_PHONE_OBJECT            = 42;
293:     protected boolean mIsPhoneInEcmState = false;
323:     protected int mPhoneId;
430:     public String getPhoneName() {
434:     protected void setPhoneName(String name) {
1766:     public void updatePhoneObject(int voiceRadioTech) {
2587:     public abstract int getPhoneType();
3596:     public int getPhoneId() {
3604:     public int getVoicePhoneServiceState() {
106:  * A base implementation for the com.android.internal.telephony.Phone interface.
108:  * Note that implementations of Phone.java are expected to be used
117:     private static final String LOG_TAG = "Phone";
241:      * This method is invoked when the Phone exits Emergency Callback Mode.
291:     // Keep track of whether or not the phone is in Emergency Callback Mode for Phone and
425:      * Returns a string identifier for this phone interface for parties
426:      *  outside the phone app process.
481:      * Constructs a Phone in normal (non-unit test) mode.
492:         this(name, notifier, context, ci, unitTestMode, SubscriptionManager.DEFAULT_PHONE_INDEX,
497:      * Constructs a Phone in normal (non-unit test) mode.
505:      * @param phoneId the phone-id of this phone.
533:         * (i.e. voice) phone calls over the telephony network, and is allowed
558:         if (getPhoneType() == PhoneConstants.PHONE_TYPE_IMS) {
573:         if (getPhoneType() != PhoneConstants.PHONE_TYPE_SIP) {
585:         if (getPhoneType() == PhoneConstants.PHONE_TYPE_SIP) {
589:         synchronized(Phone.lockForRadioTechnologyChange) {
652:         // messages to be handled whether or not the phone is being destroyed
654:         // resources of the phone being destroyed
774:         Phone imsPhone = mImsPhone;
813:      * Gets the context for the phone, as set at initialization time.
869:      * Subclasses of Phone probably want to replace this with a
895:      * Subclasses of Phone probably want to replace this with a
919:      * Subclasses of Phone probably want to replace this with a
931:      * Notify the phone that an SMS has been sent. This will be used determine if the SMS was sent
945:      * Determine if the Phone has recently sent an emergency SMS and is still in the interval of
986:     protected void migrateFrom(Phone from) {
999:         // The emergency state of IMS phone will be cleared in ImsPhone#notifySrvccState after
1062:      *   Connection.getCall() == Phone.getRingingCall()
1082:      * Notifies when phone's video capabilities changes <p>
1087:      *  AsyncResult.result = true if phone supports video calling <p>
1226:      * Example: If Phone.dial is called with "*#31#", then the app will
1538:      * For unit tests; don't send notifications to "Phone"
1555:      * Subclasses of Phone probably want to replace this with a
1660:         // no need for regular phone
1664:      * Subclasses of Phone probably want to replace this with a
1675:      * If this is a simulated phone interface, returns a SimulatedRadioControl.
1689:      * the thread that originally obtained this Phone instance.
1694:                     "com.android.internal.telephony.Phone must be used from within one thread");
1726:      * If the phone has an active call and call waiting occurs,
1727:      * then the phone state is RINGING not OFFHOOK
1736:      * Retrieves the IccFileHandler of the Phone instance
1755:      * Retrieves the Handler of the Phone instance
1762:      * Update the phone object if the voice radio technology has changed
1770:     * Retrieves the ServiceStateTracker of the phone instance.
1778:      * Retrieves the EmergencyNumberTracker of the phone instance.
1841:      * Returns the ICC card interface for this phone, or null
1847:         //throw new Exception("getIccCard Shouldn't be called from Phone");
2026:         if (getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA) {
2178:      * - {@link com.android.internal.telephony.Phone#TTY_MODE_OFF}
2179:      * - {@link com.android.internal.telephony.Phone#TTY_MODE_FULL}
2180:      * - {@link com.android.internal.telephony.Phone#TTY_MODE_HCO}
2181:      * - {@link com.android.internal.telephony.Phone#TTY_MODE_VCO}
2192:      * - {@link com.android.internal.telephony.Phone#TTY_MODE_OFF}
2193:      * - {@link com.android.internal.telephony.Phone#TTY_MODE_FULL}
2194:      * - {@link com.android.internal.telephony.Phone#TTY_MODE_HCO}
2195:      * - {@link com.android.internal.telephony.Phone#TTY_MODE_VCO}
2492:     // This property is used to handle phone process crashes, and is the same for CDMA and IMS
2499:      * @return {@code true} if we are in emergency call back mode. This is a period where the phone
2519:      * @return true if this Phone is in an emergency call that caused emergency callback mode to be
2527:      * Set whether or not this Phone has an active emergency call that was placed during emergency
2583:      * Return a numerical identifier for the phone radio interface.
2584:      * @return PHONE_TYPE_XXX as defined above.
2597:     /** sets the voice mail count of the phone and notifies listeners. */
3279:      * Subclasses of Phone probably want to replace this with a
3297:      * Notify registrants if phone is video capable.
3429:         Rlog.e(LOG_TAG, "Error! This function should never be executed, inactive Phone.");
3442:      * Gets the Uicc card corresponding to this phone.
3443:      * @return the UiccCard object corresponding to the phone ID.
3473:      * Return an instance of a IMS phone
3593:      * Returns the phone id.
3605:         Phone imsPhone = mImsPhone;
3679:         Phone imsPhone = mImsPhone;
3698:         Phone imsPhone = mImsPhone;
3712:         Phone imsPhone = mImsPhone;
3726:         Phone imsPhone = mImsPhone;
3736:      * @return the IMS MmTel Registration technology for this Phone, defined in
3740:         Phone imsPhone = mImsPhone;
3750:      * Get the IMS MmTel Registration technology for this Phone, defined in
3754:         Phone imsPhone = mImsPhone;
3763:      * Asynchronously get the IMS MmTel Registration state for this Phone.
3766:         Phone imsPhone = mImsPhone;
3824:      *  Set phone radio capability
3826:      *  @param rc the phone radio capability defined in
3835:      *  Get phone radio access family
3855:      *  Get phone radio capability
3869:      *  @param rc the phone radio capability currently in effect for this phone.
3902:      * Registers the handler when phone radio  capability is changed.
3913:      * Unregister for notifications when phone radio type and access technology is changed.
3948:      * Determines if video calling is enabled for the phone.
3954:         Phone imsPhone = mImsPhone;
4086:     public static void checkWfcWifiOnlyModeBeforeDial(Phone imsPhone, int phoneId, Context context)
4126:      * This function returns the parent phone of the current phone. It is applicable
4127:      * only for IMS phone (function is overridden by ImsPhone). For others the phone
4165:      * none of the phone is in service, and one of them has the capability to make the emergency
4172:         for (Phone phone : PhoneFactory.getPhones()) {
4173:             if (phone != null) {
4174:                 ServiceState ss = phone.getServiceStateTracker().getServiceState();
4175:                 // One of the phone is in service, hence the device is not emergency call only.
4228:         pw.println("Phone: subId=" + getSubId());
4386:         pw.println("Phone Local Log: ");
52: import android.telephony.PhoneStateListener;
80: import com.android.internal.telephony.imsphone.ImsPhoneCall;
110:  * originally called PhoneFactory to obtain the interface.
409:      * PhoneNotifier is an abstraction for all system-wide
414:     protected PhoneNotifier mNotifier;
439:      * Retrieves Nai for phones. Returns null if Nai is not set.
508:                     boolean unitTestMode, int phoneId,
510:         mPhoneId = phoneId;
547:          * By default old phones won't have the property set but do generate
581:      * Start setup of ImsPhone, which will start trying to connect to the ImsResolver. Will not be
590:             if (mImsPhone == null) {
591:                 mImsPhone = PhoneFactory.makeImsPhone(mNotifier, this);
592:                 CallManager.getInstance().registerPhone(mImsPhone);
593:                 mImsPhone.registerForSilentRedial(
668:                     PhoneConstants.State state = getState();
670:                             && ((state == PhoneConstants.State.RINGING) ||
671:                                     (state == PhoneConstants.State.IDLE))) {
682:                 if (getState() == PhoneConstants.State.RINGING) {
700:                         if (mImsPhone != null) {
702:                             mImsPhone.notifyRedialConnectionChanged(cn);
706:                         if (mImsPhone != null) {
707:                             mImsPhone.notifyRedialConnectionChanged(null);
781:                     if (imsPhone != null) {
782:                         conn = imsPhone.getHandoverConnection();
783:                         migrateFrom(imsPhone);
785:                         Rlog.d(LOG_TAG, "HANDOVER_STARTED: mImsPhone null");
790:                     if (imsPhone != null) {
791:                         imsPhone.notifySrvccState(srvccState);
793:                         Rlog.d(LOG_TAG, "HANDOVER_COMPLETED: mImsPhone null");
846:      * {@link PhoneConstants.State} which can be obtained using the {@link PhoneStateListener}
1016:             // Since CallManager has already registered with both CS and IMS phones,
1733:     public abstract PhoneConstants.State getState();
1917:      * Sets the minimum time in milli-seconds between {@link PhoneStateListener#onCellInfoChanged
1918:      * PhoneStateListener.onCellInfoChanged} will be invoked.
1933:      * available on this interface. Use PhoneStateNotifier or similar instead.
2021:      * available on this interface. Use PhoneStateNotifier or similar instead.
2063:      * interface. Use <code>PhoneStateNotifier</code> or an equivalent.
2417:     public PhoneConstants.DataState getDataConnectionState(String apnType) {
2418:         return PhoneConstants.DataState.DISCONNECTED;
2493:     // phones
2573:         if (mImsPhone != null) {
2574:             isPresent = isVideoCallOrConference(mImsPhone.getForegroundCall()) ||
2575:                     isVideoCallOrConference(mImsPhone.getBackgroundCall()) ||
2576:                     isVideoCallOrConference(mImsPhone.getRingingCall());
2718:      * Retrieves the MIN for CDMA phones.
2734:      *  Retrieves PRL Version for CDMA phones
3373:      * Retrieves the MSISDN from the UICC. For GSM/UMTS phones, this is equivalent to
3374:      * {@link #getLine1Number()}. For CDMA phones, {@link #getLine1Number()} returns
3375:      * the MDN, so this method is provided to return the MSISDN on CDMA/LTE phones.
3383:      * Retrieves the EF_PNN from the UICC For GSM/UMTS phones.
3392:      * {@link android.telephony.PhoneStateListener} instead.
3395:     public PhoneConstants.DataState getDataConnectionState() {
3396:         return getDataConnectionState(PhoneConstants.APN_TYPE_DEFAULT);
3413:      * @return {@link PhoneConstants#LTE_ON_CDMA_UNKNOWN}, {@link PhoneConstants#LTE_ON_CDMA_FALSE}
3414:      * or {@link PhoneConstants#LTE_ON_CDMA_TRUE}
3428:         // This function should be overridden by class GsmCdmaPhone.
3477:         return mImsPhone;
3543:      * Return if UT capability of ImsPhone is enabled or not
3547:         if (mImsPhone != null) {
3548:             return mImsPhone.isUtEnabled();
3567:         // dialInternal shall be overriden by GsmCdmaPhone
3572:      * This function is for CSFB SS. GsmCdmaPhone overrides this function.
3601:      * Return the service state of mImsPhone if it is STATE_IN_SERVICE
3606:         if (imsPhone != null
3607:                 && imsPhone.getServiceState().getState() == ServiceState.STATE_IN_SERVICE) {
3681:         if (imsPhone != null) {
3682:             isImsRegistered = imsPhone.isImsRegistered();
3700:         if (imsPhone != null) {
3701:             isWifiCallingEnabled = imsPhone.isWifiCallingEnabled();
3714:         if (imsPhone != null) {
3715:             isAvailable = imsPhone.isImsCapabilityAvailable(capability, regTech);
3728:         if (imsPhone != null) {
3729:             isVolteEnabled = imsPhone.isVolteEnabled();
3742:         if (imsPhone != null) {
3743:             regTech = imsPhone.getImsRegistrationTech();
3755:         if (imsPhone != null) {
3756:             imsPhone.getImsRegistrationTech(callback);
3767:         if (imsPhone != null) {
3768:             imsPhone.getImsRegistrationState(callback);
3885:         int type = PhoneFactory.calculatePreferredNetworkType(mContext, getSubId());
3896:             int type = PhoneFactory.calculatePreferredNetworkType(mContext, getSubId());
3940:         if (mImsPhone == null) {
3944:         return mImsPhone.isImsAvailable();
3955:         if (imsPhone != null) {
3956:             return imsPhone.isVideoEnabled();
4088:         if (imsPhone == null || !imsPhone.isWifiCallingEnabled()) {
4089:             ImsManager imsManager = ImsManager.getInstance(context, phoneId);
4267:         if (mImsPhone != null) {
4269:                 mImsPhone.dump(fd, pw, args);
410:      * state change notification. DefaultPhoneNotifier is
483:      * @param notifier An instance of DefaultPhoneNotifier,
499:      * @param notifier An instance of DefaultPhoneNotifier,
2374:         // This function is added to send the notification to DefaultPhoneNotifier.
2504:         return mIsPhoneInEcmState;
2515:         mIsPhoneInEcmState = isInEcm;
2559:         if (call instanceof ImsPhoneCall) {
2560:             ImsPhoneCall imsPhoneCall = (ImsPhoneCall) call;
2561:             ImsCall imsCall = imsPhoneCall.getImsCall();
2615:                 mPhoneId, UiccController.APP_FAM_3GPP);
3349:      * A fucntion of type getPhoneProp(propType) where propType is an
3447:         return mUiccController.getUiccCard(mPhoneId);
3589:         return SubscriptionController.getInstance().getSubIdUsingPhoneId(mPhoneId);
3597:         return mPhoneId;
3927:         ImsManager imsManager = ImsManager.getInstance(mContext, mPhoneId);
4229:         pw.println(" mPhoneId=" + mPhoneId);
4256:         pw.println(" getPhoneName()=" + getPhoneName());
4257:         pw.println(" getPhoneType()=" + getPhoneType());
android.googlesource.com/platform/superproject:external/guice/examples/src/example/xml/Phone.java: [ master, ]
3: public class Phone {
android.googlesource.com/platform/external/guice:examples/src/example/xml/Phone.java: [ master, ] Duplicate result
android.googlesource.com/platform/superproject:frameworks/base/cmds/statsd/src/atoms.proto: [ master, ]
5591:         PHONE = 9;
2535:         HARDWARE_FAILED_MICROPHONE = 1;
2705: message PhoneSignalStrengthChanged {
2717: message PhoneServiceStateChanged {
2729: message PhoneStateChanged {
116:         PhoneSignalStrengthChanged phone_signal_strength_changed = 40;
171:         PhoneServiceStateChanged phone_service_state_changed = 94;
172:         PhoneStateChanged phone_state_changed = 95;
1290:  *   frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1295:         // The keyguard is hidden when the phone is unlocked.
1297:         // The keyguard is shown when the phone is locked (screen turns off).
1311:  *   frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
2700:  * Logs phone signal strength changes.
2712:  * Logs when the phone state, sim state or signal strength changes
2724:  * Logs when the phone becomes on or off.
3261:  *      frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
1458:     // For multi-sim phones, this distinguishes between the sim cards.
1480:     // For multi-sim phones, this distinguishes between the sim cards.
5386:  * time_in_state files not being present on some phones, have not been addressed. These should be
6599:  * Track how we arbitrate between microphone/input requests.
6614:  * Track how we arbitrate between microphone requests.
6629:  * Track how we arbitrate between microphone/input requests.
6644:  * Track how we arbitrate between microphone/input requests.
android.googlesource.com/platform/external/valgrind:include/vki/vki-linux.h: [ master, ]
1643:   char phone[VKI_ISDN_MSNLEN];
1645: } vki_isdn_net_ioctl_phone;
android.googlesource.com/platform/frameworks/base:cmds/statsd/src/atoms.proto: [ master, ] Duplicate result
android.googlesource.com/platform/frameworks/opt/vcard:java/com/android/vcard/VCardEntry.java: [ master, ]
101:         PHONE,
315:     public static class PhoneData implements EntryElement {
325:         public PhoneData(String data, int type, String label, boolean isPrimary) {
1779:     private void addPhone(int type, String data, String label, boolean isPrimary) {
143:         private String mPhoneticFamily;
144:         private String mPhoneticGiven;
145:         private String mPhoneticMiddle;
167:         public boolean emptyPhoneticStructuredName() {
750:         private final String mPhoneticName; // We won't have this in "TITLE" property.
870:         public String getPhoneticName() {
1555:     private List<PhoneData> mPhoneList;
1865:     private String buildSinglePhoneticNameFromSortAsParam(Map<String, Collection<String>> paramMap) {
2078:     private void handlePhoneticNameFromSound(List<String> elems) {
2633:     public final List<PhoneData> getPhoneList() {
33: import android.provider.ContactsContract.CommonDataKinds.Phone;
337:             builder.withValueBackReference(Phone.RAW_CONTACT_ID, backReferenceIndex);
338:             builder.withValue(Data.MIMETYPE, Phone.CONTENT_ITEM_TYPE);
340:             builder.withValue(Phone.TYPE, mType);
341:             if (mType == Phone.TYPE_CUSTOM) {
342:                 builder.withValue(Phone.LABEL, mLabel);
344:             builder.withValue(Phone.NUMBER, mNumber);
346:                 builder.withValue(Phone.IS_PRIMARY, 1);
388:             return EntryLabel.PHONE;
1786:         if (type == Phone.TYPE_PAGER || VCardConfig.refrainPhoneNumberFormatting(mVCardType)) {
1790:             // Note that some other codes (like the phone number formatter) or modules expect this
2307:                 // Given propValue is in URI format, not in phone number format used until
2315:                     // we may still have non-URI phone number. To keep given data as much as
2340:                     type = Phone.TYPE_CUSTOM;
2355:             // The phone number available via Skype.
2357:             final int type = Phone.TYPE_OTHER;
19: import com.android.vcard.VCardUtils.PhoneNumberUtilsPort;
42: import android.telephony.PhoneNumberUtils;
196:             boolean phoneticNameSpecified = false;
199:                 builder.withValue(StructuredName.PHONETIC_GIVEN_NAME, mPhoneticGiven);
200:                 phoneticNameSpecified = true;
203:                 builder.withValue(StructuredName.PHONETIC_FAMILY_NAME, mPhoneticFamily);
204:                 phoneticNameSpecified = true;
207:                 builder.withValue(StructuredName.PHONETIC_MIDDLE_NAME, mPhoneticMiddle);
208:                 phoneticNameSpecified = true;
211:             // SORT-STRING is used only when phonetic names aren't specified in
213:             if (!phoneticNameSpecified) {
214:                 builder.withValue(StructuredName.PHONETIC_GIVEN_NAME, mSortString);
361:             if (!(obj instanceof PhoneData)) {
364:             PhoneData phoneData = (PhoneData) obj;
365:             return (mType == phoneData.mType
366:                     && TextUtils.equals(mNumber, phoneData.mNumber)
367:                     && TextUtils.equals(mLabel, phoneData.mLabel)
368:                     && (mIsPrimary == phoneData.mIsPrimary));
755:                 final String titleName, final String phoneticName, int type,
761:             mPhoneticName = phoneticName;
806:                 builder.withValue(Organization.PHONETIC_NAME, mPhoneticName);
1781:             mPhoneList = new ArrayList<PhoneData>();
1797:                 // See RFC 3601 and docs for PhoneNumberUtils for more info.
1799:                     builder.append(PhoneNumberUtils.PAUSE);
1802:                     builder.append(PhoneNumberUtils.WAIT);
1804:                 } else if (PhoneNumberUtils.is12Key(ch) || (i == 0 && ch == '+')) {
1810:                 formattedNumber = PhoneNumberUtilsPort.formatNumber(
1816:         PhoneData phoneData = new PhoneData(formattedNumber, type, label, isPrimary);
1817:         mPhoneList.add(phoneData);
1854:             final String titleName, final String phoneticName, int type, final boolean isPrimary) {
1859:                 phoneticName, type, isPrimary));
1894:         final String phoneticName = buildSinglePhoneticNameFromSortAsParam(paramMap);
1929:             addNewOrganization(organizationName, departmentName, null, phoneticName, type,
1948:         addNewOrganization(organizationName, departmentName, null, phoneticName, type, isPrimary);
2001:      * them in appropriate phonetic name variables. This method does not care
2072:      * Note: Some Japanese mobile phones use this field for phonetic name, since
2082:             // This means the other properties like "X-PHONETIC-FIRST-NAME" was already found.
2094:         // phones use this order.
2117:                     // phones' preference.
2177:                 final List<String> phoneticNameList = VCardUtils.constructListFromValue(propValue,
2179:                 handlePhoneticNameFromSound(phoneticNameList);
2304:             String phoneNumber = null;
2312:                     phoneNumber = propValue.substring(4);
2317:                     phoneNumber = propValue;
2320:                 phoneNumber = propValue;
2333:                         phoneNumber);
2352:                 addPhone(type, phoneNumber, label, isPrimary);
2365:             addPhone(type, propValue, null, isPrimary);
2399:         } else if (propertyName.equals(VCardConstants.PROPERTY_X_PHONETIC_FIRST_NAME)) {
2401:         } else if (propertyName.equals(VCardConstants.PROPERTY_X_PHONETIC_MIDDLE_NAME)) {
2403:         } else if (propertyName.equals(VCardConstants.PROPERTY_X_PHONETIC_LAST_NAME)) {
168:             return TextUtils.isEmpty(mPhoneticFamily) && TextUtils.isEmpty(mPhoneticGiven)
169:                     && TextUtils.isEmpty(mPhoneticMiddle);
198:             if (!TextUtils.isEmpty(mPhoneticGiven)) {
202:             if (!TextUtils.isEmpty(mPhoneticFamily)) {
206:             if (!TextUtils.isEmpty(mPhoneticMiddle)) {
226:                     && TextUtils.isEmpty(mPhoneticFamily) && TextUtils.isEmpty(mPhoneticMiddle)
227:                     && TextUtils.isEmpty(mPhoneticGiven) && TextUtils.isEmpty(mSortString));
246:                     && TextUtils.equals(mPhoneticFamily, nameData.mPhoneticFamily)
247:                     && TextUtils.equals(mPhoneticMiddle, nameData.mPhoneticMiddle)
248:                     && TextUtils.equals(mPhoneticGiven, nameData.mPhoneticGiven)
255:                     mFormatted, mPhoneticFamily, mPhoneticMiddle,
256:                     mPhoneticGiven, mSortString};
805:             if (mPhoneticName != null) {
817:                     && TextUtils.isEmpty(mTitle) && TextUtils.isEmpty(mPhoneticName);
871:             return mPhoneticName;
1604:         iterateOneList(mPhoneList, iterator);
1780:         if (mPhoneList == null) {
1809:                 final int formattingType = VCardUtils.getPhoneNumberFormat(mVCardType);
2010:                 && !(TextUtils.isEmpty(mNameData.mPhoneticFamily)
2011:                         && TextUtils.isEmpty(mNameData.mPhoneticMiddle) && TextUtils
2012:                         .isEmpty(mNameData.mPhoneticGiven))) {
2031:                 mNameData.mPhoneticMiddle = sortNames.get(2); //$FALL-THROUGH$
2033:                 mNameData.mPhoneticGiven = sortNames.get(1); //$FALL-THROUGH$
2035:                 mNameData.mPhoneticFamily = sortNames.get(0);
2079:         if (!(TextUtils.isEmpty(mNameData.mPhoneticFamily)
2080:                 && TextUtils.isEmpty(mNameData.mPhoneticMiddle) && TextUtils
2081:                 .isEmpty(mNameData.mPhoneticGiven))) {
2112:                     mNameData.mPhoneticFamily = namesArray[0];
2113:                     mNameData.mPhoneticMiddle = namesArray[1];
2114:                     mNameData.mPhoneticGiven = namesArray[2];
2118:                     mNameData.mPhoneticFamily = namesArray[0];
2119:                     mNameData.mPhoneticGiven = namesArray[1];
2121:                     mNameData.mPhoneticGiven = elems.get(0);
2130:             mNameData.mPhoneticMiddle = elems.get(2);
2132:             mNameData.mPhoneticGiven = elems.get(1);
2134:             mNameData.mPhoneticFamily = elems.get(0);
2332:                 final Object typeObject = VCardUtils.getPhoneTypeFromStrings(typeCollection,
2400:             mNameData.mPhoneticGiven = propValue;
2402:             mNameData.mPhoneticMiddle = propValue;
2404:             mNameData.mPhoneticFamily = propValue;
2500:         } else if (!mNameData.emptyPhoneticStructuredName()) {
2502:                     mNameData.mPhoneticFamily, mNameData.mPhoneticMiddle, mNameData.mPhoneticGiven);
2505:         } else if (mPhoneList != null && mPhoneList.size() > 0) {
2506:             displayName = mPhoneList.get(0).mNumber;
2634:         return mPhoneList;
chromium.googlesource.com/android_tools:sdk/sources/android-25/android/provider/ContactsContract.java: [ master, ]
1117:         public static final int PHONE = 20;
5941:         public static final class Phone implements DataColumnsWithJoins, CommonColumns,
5946:             private Phone() {}
9101:             public static final String PHONE = "phone";
9109:             public static final String PHONE_TYPE = "phone_type";
9115:             public static final String PHONE_ISPRIMARY = "phone_isprimary";
9121:             public static final String SECONDARY_PHONE = "secondary_phone";
9135:             public static final String TERTIARY_PHONE = "tertiary_phone";
1087:     public interface PhoneticNameStyle {
1185:         public static final String PHONETIC_NAME_STYLE = "phonetic_name_style";
1198:         public static final String PHONETIC_NAME = "phonetic_name";
5009:     protected interface PhoneLookupColumns {
5168:     public static final class PhoneLookup implements BaseColumns, PhoneLookupColumns,
5173:         private PhoneLookup() {}
5763:             public static final String PHONETIC_GIVEN_NAME = DATA7;
5769:             public static final String PHONETIC_MIDDLE_NAME = DATA8;
5775:             public static final String PHONETIC_FAMILY_NAME = DATA9;
5787:             public static final String PHONETIC_NAME_STYLE = DATA11;
6834:             public static final String PHONETIC_NAME = DATA8;
6846:             public static final String PHONETIC_NAME_STYLE = DATA10;
9077:             public static final String PHONETIC_NAME = "phonetic_name";
183:     public static final String STREQUENT_PHONE_ONLY = "strequent_phone_only";
990:         public static final String HAS_PHONE_NUMBER = "has_phone_number";
6008:             public static final String SEARCH_PHONE_NUMBER_KEY = "search_phone_number";
8995:         public static final String EXTRA_PHONE_URIS =
9129:             public static final String SECONDARY_PHONE_TYPE = "secondary_phone_type";
9143:             public static final String TERTIARY_PHONE_TYPE = "tertiary_phone_type";
1121:         public static final int STRUCTURED_PHONETIC_NAME = 37;
7637:         public static final String SUMMARY_WITH_PHONES = "summ_phones";
8023:         public static final String UNGROUPED_WITH_PHONES = "summ_phones";
8948:         public static final String ACTION_GET_MULTIPLE_PHONES =
68:  * as a phone number or email addresses.  The set of data kinds that can be
149:      * {@link CommonDataKinds.Phone#CONTENT_URI},
180:      * return only phone-related results. For example, frequently contacted person list should
181:      * include persons contacted via phone (not email, sms, etc.)
203:      * A boolean parameter for {@link CommonDataKinds.Phone#CONTENT_URI Phone.CONTENT_URI},
281:      * in email and phone lookup functionalities, it should also implement
284:      * {@link CommonDataKinds.Phone#CONTENT_FILTER_URI CommonDataKinds.Phone.CONTENT_FILTER_URI}.
581:          * allow creation of shortcuts for data items like email, phone or postal address,
986:          * An indicator of whether this contact has at least one phone number. "1" if there is
987:          * at least one phone number, "0" otherwise.
1110:      * of increasing priority: {@link #EMAIL}, {@link #PHONE},
1295:      * <li>If you need to look up a contact by the phone number, use
1376:      * <td>{@link #HAS_PHONE_NUMBER}</td>
1378:      * <td>An indicator of whether this contact has at least one phone number.
1379:      * "1" if there is at least one phone number, "0" otherwise.</td>
2409:      * Changes to the structured name, organization, phone number, email address,
2493:      * finalizes phone-side deletion by calling {@code resolver.delete(...)}
2496:      * changes to the phone, but not the reverse.  If one of those raw contacts
2497:      * is marked for deletion, it will remain on the phone.  However it will be
2710:      * SOURCE_ID field on the phone.
2731:      * the sync adapter updates the contact on the phone (without the
3234:          * camera that can be used for video chat (e.g. a front-facing camera on a phone).
4244:      * information (such as a phone number) and its
4255:      * {@link CommonDataKinds.Phone Phone.CONTENT_ITEM_TYPE}, then the column
4257:      * phone number, but if the data kind is
4264:      * {@link CommonDataKinds.Phone}, {@link CommonDataKinds.Email} etc. As a
4266:      * For example, {@link CommonDataKinds.Phone Phone.NUMBER} is the same as
4299:      * single transaction, which ensures that the phone-side and server-side
4337:      * values.put(Data.MIMETYPE, Phone.CONTENT_ITEM_TYPE);
4338:      * values.put(Phone.NUMBER, "1-800-GOOG-411");
4339:      * values.put(Phone.TYPE, Phone.TYPE_CUSTOM);
4340:      * values.put(Phone.LABEL, "free directory assistance");
4351:      *          .withValue(Data.MIMETYPE, Phone.CONTENT_ITEM_TYPE)
4352:      *          .withValue(Phone.NUMBER, "1-800-GOOG-411")
4353:      *          .withValue(Phone.TYPE, Phone.TYPE_CUSTOM)
4354:      *          .withValue(Phone.LABEL, "free directory assistance")
4400:      *          new String[] {Data._ID, Phone.NUMBER, Phone.TYPE, Phone.LABEL},
4402:      *                  + Data.MIMETYPE + "='" + Phone.CONTENT_ITEM_TYPE + "'",
4412:      *          new String[] {Data._ID, Phone.NUMBER, Phone.TYPE, Phone.LABEL},
4414:      *                  + Data.MIMETYPE + "='" + Phone.CONTENT_ITEM_TYPE + "'",
4454:      * <li>{@link CommonDataKinds.Phone Phone.CONTENT_ITEM_TYPE}</li>
4493:      * the default phone number to use for the contact).</td>
4677:      * <td>{@link #HAS_PHONE_NUMBER}</td>
5022:          * The phone number as the user entered it.
5028:          * The type of phone number, for example Home or Work.
5034:          * The user defined label for the phone number.
5040:          * The phone number's E164 representation.
5047:      * A table that represents the result of looking up a phone number, for
5066:      * <td>Phone number.</td>
5072:      * <td>Phone number type. See {@link CommonDataKinds.Phone}.</td>
5078:      * <td>Custom label for the phone number. See {@link CommonDataKinds.Phone}.</td>
5132:      * <td>{@link #HAS_PHONE_NUMBER}</td>
5176:          * The content:// style URI for this table. Append the phone number you want to lookup
5184:                 "phone_lookup");
5233:                 "phone_lookup_enterprise");
5236:          * The MIME type of {@link #CONTENT_FILTER_URI} providing a directory of phone lookup rows.
5240:         public static final String CONTENT_TYPE = "vnd.android.cursor.dir/phone_lookup";
5949:             public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/phone_v2";
5955:             public static final String CONTENT_TYPE = "vnd.android.cursor.dir/phone_v2";
5980:              * The content:// style URL for phone lookup using a filter. The filter returns
5982:              * to display names as well as phone numbers. The filter argument should be passed
6005:              * If "1" or "true", phone numbers are searched.  If "0" or "false", phone numbers
6032:              * The phone number as the user entered it.
6038:              * The phone number's E164 representation. This value can be omitted in which
7466:          * that users can use for calling purposes. {@link Phone} and {@link SipAddress} are the
7471:          * each column. For example the meaning for {@link Phone}'s type is different than
7478:              * Similar to {@link Phone#CONTENT_URI}, but returns callable data instead of only
7479:              * phone numbers.
7484:              * Similar to {@link Phone#CONTENT_FILTER_URI}, but allows users to filter callable
7491:              * Similar to {@link Phone#ENTERPRISE_CONTENT_FILTER_URI}, but allows users to filter
7501:          * to start communicating with a person ({@link Phone} and {@link Email}). Note that this
7505:          * can use to initiate communications with another contact. {@link Phone} and {@link Email}
7631:          * {@link CommonDataKinds.GroupMembership} in this group, and also have phone numbers.
7763:      * phone numbers. Read-only value that is only present when querying
8019:          * no {@link CommonDataKinds.GroupMembership} entries, and also have phone numbers.
8083:      * no {@link CommonDataKinds.GroupMembership} entries, and also have phone
8170:      * {@link ContactsContract.CommonDataKinds.Phone#CONTENT_FILTER_URI}, and users can benefit
8185:      * interactions using the same contact data field (for example a phone number can be used to
8186:      * make phone calls or send SMS).
8241:          * Type of usage for voice interaction, which includes phone call, voice chat, and
8371:          * For example, passing the value {@link CommonDataKinds.Phone#CONTENT_ITEM_TYPE} can
8372:          * cause phone numbers to be displayed more prominently in QuickContacts.
8581:          *             {@link CommonDataKinds.Phone#CONTENT_ITEM_TYPE} can cause phone numbers to be
8621:          *             {@link CommonDataKinds.Phone#CONTENT_ITEM_TYPE} can cause phone numbers to be
8813:          * phone number or human readable username/user_id like "a_super_cool_user_name". This label
8818:          * <li><em>Note: Some apps may choose to use phone number as the unique contact ID in DATA1.
8819:          * If this applies to you and you’d like phone number to be shown below the Contact Name by
8822:          * make sure it does not include prefix text such as "Message +<phone>" or "Free Message
8823:          * +<phone>", etc. If you must show the prefix text in the Contacts App, please use a
8833:          * will use existing phone number entries as contact ID's for such app.
8894:          * otherwise, the value will be a phone number), and should be the unambiguous contact
8895:          * endpoint. This value is app-specific, it could be some proprietary ID or a phone number.
8931:          * list of phone numbers which come from the contacts or
8932:          * {@link #EXTRA_PHONE_URIS}.
8934:          * The phone numbers being passed in through {@link #EXTRA_PHONE_URIS}
8940:          * {@link android.app.Activity#RESULT_OK}, the array of picked phone
8942:          * {@link #EXTRA_PHONE_URIS}; otherwise, the
8984:          * The phone numbers want to be picked by default should be passed in as
8985:          * input value. These phone numbers could belong to the contacts or not.
8987:          * The phone numbers which were picked by the user are returned as output
8990:          * Type: array of URIs, the tel URI is used for the phone numbers which don't
8991:          * belong to any contact, the content URI is used for phone id in contacts.
8996:             "com.android.contacts.extra.PHONE_URIS";
9098:              * The extra field for the contact phone number.
9104:              * The extra field for the contact phone number type.
9106:              * {@link CommonDataKinds.Phone},
9112:              * The extra field for the phone isprimary flag.
9118:              * The extra field for an optional second contact phone number.
9124:              * The extra field for an optional second contact phone number type.
9126:              * {@link CommonDataKinds.Phone},
9132:              * The extra field for an optional third contact phone number.
9138:              * The extra field for an optional third contact phone number type.
9140:              * {@link CommonDataKinds.Phone},
9242:              * For example, an Exchange contact can only have one phone numbers of type Home,
9243:              * so the contact editor may choose a different type for this phone number to
9244:              * avoid dropping the valueable part of the row, which is the phone number.
110:  * {@link PhoneLookup}, which is used for quick caller-ID lookup</li>
430:          * {@link PhoneLookup#ENTERPRISE_CONTENT_FILTER_URI}, may contain this kind of URI.
850:      * @see PhoneLookup
901:      * @see PhoneLookup
1091:          * Pinyin is a phonetic method of entering Chinese characters. Typically not explicitly
1103:          * Hangul is the Korean phonetic alphabet.
1111:      * {@link #ORGANIZATION}, {@link #NICKNAME}, {@link #STRUCTURED_PHONETIC_NAME},
1120:         /** Display name comes from a structured name that only has phonetic components. */
1182:          * The phonetic alphabet used to represent the {@link #PHONETIC_NAME}.  See
1183:          * {@link PhoneticNameStyle}.
1189:          * Pronunciation of the full name in the phonetic alphabet specified by
1190:          * {@link #PHONETIC_NAME_STYLE}.
1194:          * interest only in countries with commonly used phonetic alphabets,
1195:          * such as Japan and Korea. See {@link PhoneticNameStyle}.
1205:          * it is the Hiragana version of the phonetic name.
1296:      * {@link PhoneLookup#CONTENT_FILTER_URI PhoneLookup.CONTENT_FILTER_URI},
1496:          * {@link PhoneLookup#ENTERPRISE_CONTENT_FILTER_URI} may contain this kind of URI.
1739:          * {@link PhoneLookup#ENTERPRISE_CONTENT_FILTER_URI}.
1747:          * {@link PhoneLookup#ENTERPRISE_CONTENT_FILTER_URI}.
1756:          * {@link PhoneLookup#ENTERPRISE_CONTENT_FILTER_URI} may return such a contact.
2483:      * AggregationExceptions, PhoneLookup rows are deleted automatically. When all raw
3221:          * An allowed flag of {@link #CHAT_CAPABILITY}. Indicates audio-chat capability (microphone
5007:      * @see PhoneLookup
5052:      * Uri uri = Uri.withAppendedPath(PhoneLookup.CONTENT_FILTER_URI, Uri.encode(phoneNumber));
5053:      * resolver.query(uri, new String[]{PhoneLookup.DISPLAY_NAME,...
5060:      * <th colspan='4'>PhoneLookup</th>
5179:          * Uri lookupUri = Uri.withAppendedPath(PhoneLookup.CONTENT_FILTER_URI,
5180:          *         Uri.encode(phoneNumber));
5228:          * Uri lookupUri = Uri.withAppendedPath(PhoneLookup.ENTERPRISE_CONTENT_FILTER_URI,
5229:          *         Uri.encode(phoneNumber));
5694:          * <td>{@link #PHONETIC_GIVEN_NAME}</td>
5696:          * <td>Used for phonetic spelling of the name, e.g. Pinyin, Katakana, Hiragana</td>
5700:          * <td>{@link #PHONETIC_MIDDLE_NAME}</td>
5706:          * <td>{@link #PHONETIC_FAMILY_NAME}</td>
5760:              * The phonetic version of the given name for the contact.
5766:              * The phonetic version of the additional name for the contact.
5772:              * The phonetic version of the family name for the contact.
5784:              * The alphabet used for capturing the phonetic name.
5785:              * See ContactsContract.PhoneticNameStyle.
5883:          * A data kind representing a telephone number.
5953:              * phones.
5963:                     "phones");
5977:                     Uri.withAppendedPath(Data.ENTERPRISE_CONTENT_URI, "phones");
6072:                     case TYPE_HOME: return com.android.internal.R.string.phoneTypeHome;
6073:                     case TYPE_MOBILE: return com.android.internal.R.string.phoneTypeMobile;
6074:                     case TYPE_WORK: return com.android.internal.R.string.phoneTypeWork;
6075:                     case TYPE_FAX_WORK: return com.android.internal.R.string.phoneTypeFaxWork;
6076:                     case TYPE_FAX_HOME: return com.android.internal.R.string.phoneTypeFaxHome;
6077:                     case TYPE_PAGER: return com.android.internal.R.string.phoneTypePager;
6078:                     case TYPE_OTHER: return com.android.internal.R.string.phoneTypeOther;
6079:                     case TYPE_CALLBACK: return com.android.internal.R.string.phoneTypeCallback;
6080:                     case TYPE_CAR: return com.android.internal.R.string.phoneTypeCar;
6081:                     case TYPE_COMPANY_MAIN: return com.android.internal.R.string.phoneTypeCompanyMain;
6082:                     case TYPE_ISDN: return com.android.internal.R.string.phoneTypeIsdn;
6083:                     case TYPE_MAIN: return com.android.internal.R.string.phoneTypeMain;
6084:                     case TYPE_OTHER_FAX: return com.android.internal.R.string.phoneTypeOtherFax;
6085:                     case TYPE_RADIO: return com.android.internal.R.string.phoneTypeRadio;
6086:                     case TYPE_TELEX: return com.android.internal.R.string.phoneTypeTelex;
6087:                     case TYPE_TTY_TDD: return com.android.internal.R.string.phoneTypeTtyTdd;
6088:                     case TYPE_WORK_MOBILE: return com.android.internal.R.string.phoneTypeWorkMobile;
6089:                     case TYPE_WORK_PAGER: return com.android.internal.R.string.phoneTypeWorkPager;
6090:                     case TYPE_ASSISTANT: return com.android.internal.R.string.phoneTypeAssistant;
6091:                     case TYPE_MMS: return com.android.internal.R.string.phoneTypeMms;
6092:                     default: return com.android.internal.R.string.phoneTypeCustom;
6769:          * <td>{@link #PHONETIC_NAME}</td>
6781:          * <td>PHONETIC_NAME_STYLE</td>
6831:              * The phonetic name of this company as the user entered it.
6843:              * The alphabet used for capturing the phonetic name.
6844:              * See {@link ContactsContract.PhoneticNameStyle}.
7759:      * <td>{@link #SUMMARY_WITH_PHONES}</td>
8080:      * <td>{@link #UNGROUPED_WITH_PHONES}</td>
8505:          *            {@link PhoneLookup#ENTERPRISE_CONTENT_FILTER_URI}.
8541:          *            {@link PhoneLookup#ENTERPRISE_CONTENT_FILTER_URI}.
8574:          *            {@link PhoneLookup#ENTERPRISE_CONTENT_FILTER_URI}.
8614:          *            {@link PhoneLookup#ENTERPRISE_CONTENT_FILTER_URI}.
8930:          * Starts an Activity that lets the user select the multiple phones from a
8949:                 "com.android.contacts.action.GET_MULTIPLE_PHONES";
8982:          * Used with {@link #ACTION_GET_MULTIPLE_PHONES} as the input or output value.
9074:              * The extra field for the contact phonetic name.
android.googlesource.com/platform/superproject:tools/adt/idea/android/gen/icons/AndroidIcons.java: [ master, ]
166:     public static final Icon Phone = load("/icons/nele/phone.png");
83:     public static final Icon Mobile_32 = load("/icons/formfactors/phone_tablet_32.png"); // 32x32
89:     public static final Icon Mobile_64 = load("/icons/formfactors/64/phone_tablet.png"); // 64x64
android.googlesource.com/platform/tools/adt/idea:android/gen/icons/AndroidIcons.java: [ master, ] Duplicate result
android.googlesource.com/platform/packages/apps/ContactsCommon:src/com/android/contacts/common/model/account/BaseAccountType.java: [ master, ]
104:         static final int PHONE = 10;
60:     protected static final int FLAGS_PHONE = EditorInfo.TYPE_CLASS_PHONE;
256:     protected DataKind addDataKindPhone(Context context) throws DefinitionException {
540:     public static class PhoneActionInflater extends CommonInflater {
552:     public static class PhoneActionAltInflater extends CommonInflater {
1034:     private static class PhoneKindBuilder extends KindBuilder {
65:     protected static final int FLAGS_PHONETIC = EditorInfo.TYPE_CLASS_TEXT
125:     protected static EditType buildPhoneType(int type) {
220:     protected DataKind addDataKindPhoneticName(Context context) throws DefinitionException {
30: import android.provider.ContactsContract.CommonDataKinds.Phone;
121:         this.titleRes = R.string.account_phone;
126:         return new EditType(type, Phone.getTypeLabelResource(type));
257:         DataKind kind = addKind(new DataKind(Phone.CONTENT_ITEM_TYPE, R.string.phoneLabelsGroup,
258:                 Weight.PHONE, true));
263:         kind.actionBody = new SimpleInflater(Phone.NUMBER);
264:         kind.typeColumn = Phone.TYPE;
266:         kind.typeList.add(buildPhoneType(Phone.TYPE_MOBILE));
267:         kind.typeList.add(buildPhoneType(Phone.TYPE_HOME));
268:         kind.typeList.add(buildPhoneType(Phone.TYPE_WORK));
269:         kind.typeList.add(buildPhoneType(Phone.TYPE_FAX_WORK).setSecondary(true));
270:         kind.typeList.add(buildPhoneType(Phone.TYPE_FAX_HOME).setSecondary(true));
271:         kind.typeList.add(buildPhoneType(Phone.TYPE_PAGER).setSecondary(true));
272:         kind.typeList.add(buildPhoneType(Phone.TYPE_OTHER));
274:                 buildPhoneType(Phone.TYPE_CUSTOM).setSecondary(true).setCustomColumn(Phone.LABEL));
275:         kind.typeList.add(buildPhoneType(Phone.TYPE_CALLBACK).setSecondary(true));
276:         kind.typeList.add(buildPhoneType(Phone.TYPE_CAR).setSecondary(true));
277:         kind.typeList.add(buildPhoneType(Phone.TYPE_COMPANY_MAIN).setSecondary(true));
278:         kind.typeList.add(buildPhoneType(Phone.TYPE_ISDN).setSecondary(true));
279:         kind.typeList.add(buildPhoneType(Phone.TYPE_MAIN).setSecondary(true));
280:         kind.typeList.add(buildPhoneType(Phone.TYPE_OTHER_FAX).setSecondary(true));
281:         kind.typeList.add(buildPhoneType(Phone.TYPE_RADIO).setSecondary(true));
282:         kind.typeList.add(buildPhoneType(Phone.TYPE_TELEX).setSecondary(true));
283:         kind.typeList.add(buildPhoneType(Phone.TYPE_TTY_TDD).setSecondary(true));
284:         kind.typeList.add(buildPhoneType(Phone.TYPE_WORK_MOBILE).setSecondary(true));
285:         kind.typeList.add(buildPhoneType(Phone.TYPE_WORK_PAGER).setSecondary(true));
286:         kind.typeList.add(buildPhoneType(Phone.TYPE_ASSISTANT).setSecondary(true));
287:         kind.typeList.add(buildPhoneType(Phone.TYPE_MMS).setSecondary(true));
290:         kind.fieldList.add(new EditField(Phone.NUMBER, R.string.phoneLabelsGroup, FLAGS_PHONE));
509:             return Phone.TYPE;
513:             return Phone.LABEL;
1037:             return "phone";
1045:                     Phone.CONTENT_ITEM_TYPE, Phone.TYPE, R.string.phoneLabelsGroup, Weight.PHONE,
1046:                     new PhoneActionInflater(), new SimpleInflater(Phone.NUMBER));
1052:             kind.fieldList.add(new EditField(Phone.NUMBER, R.string.phoneLabelsGroup, FLAGS_PHONE));
1059:             return new EditType(type, Phone.getTypeLabelResource(type)).setSecondary(secondary);
1064:             if ("home".equals(type)) return build(Phone.TYPE_HOME, false);
1065:             if ("mobile".equals(type)) return build(Phone.TYPE_MOBILE, false);
1066:             if ("work".equals(type)) return build(Phone.TYPE_WORK, false);
1067:             if ("fax_work".equals(type)) return build(Phone.TYPE_FAX_WORK, true);
1068:             if ("fax_home".equals(type)) return build(Phone.TYPE_FAX_HOME, true);
1069:             if ("pager".equals(type)) return build(Phone.TYPE_PAGER, true);
1070:             if ("other".equals(type)) return build(Phone.TYPE_OTHER, false);
1071:             if ("callback".equals(type)) return build(Phone.TYPE_CALLBACK, true);
1072:             if ("car".equals(type)) return build(Phone.TYPE_CAR, true);
1073:             if ("company_main".equals(type)) return build(Phone.TYPE_COMPANY_MAIN, true);
1074:             if ("isdn".equals(type)) return build(Phone.TYPE_ISDN, true);
1075:             if ("main".equals(type)) return build(Phone.TYPE_MAIN, true);
1076:             if ("other_fax".equals(type)) return build(Phone.TYPE_OTHER_FAX, true);
1077:             if ("radio".equals(type)) return build(Phone.TYPE_RADIO, true);
1078:             if ("telex".equals(type)) return build(Phone.TYPE_TELEX, true);
1079:             if ("tty_tdd".equals(type)) return build(Phone.TYPE_TTY_TDD, true);
1080:             if ("work_mobile".equals(type)) return build(Phone.TYPE_WORK_MOBILE, true);
1081:             if ("work_pager".equals(type)) return build(Phone.TYPE_WORK_PAGER, true);
1084:             if ("assistant".equals(type)) return build(Phone.TYPE_ASSISTANT, true);
1085:             if ("mms".equals(type)) return build(Phone.TYPE_MMS, true);
1087:                 return build(Phone.TYPE_CUSTOM, true).setCustomColumn(Phone.LABEL);
66:             | EditorInfo.TYPE_TEXT_VARIATION_PHONETIC;
169:         kind.fieldList.add(new EditField(StructuredName.PHONETIC_FAMILY_NAME,
170:                 R.string.name_phonetic_family, FLAGS_PHONETIC));
171:         kind.fieldList.add(new EditField(StructuredName.PHONETIC_MIDDLE_NAME,
172:                 R.string.name_phonetic_middle, FLAGS_PHONETIC));
173:         kind.fieldList.add(new EditField(StructuredName.PHONETIC_GIVEN_NAME,
174:                 R.string.name_phonetic_given, FLAGS_PHONETIC));
221:         DataKind kind = addKind(new DataKind(DataKind.PSEUDO_MIME_TYPE_PHONETIC_NAME,
222:                 R.string.name_phonetic, Weight.NONE, true));
228:         kind.fieldList.add(new EditField(DataKind.PSEUDO_COLUMN_PHONETIC_NAME,
229:                 R.string.name_phonetic, FLAGS_PHONETIC).setShortForm(true));
230:         kind.fieldList.add(new EditField(StructuredName.PHONETIC_FAMILY_NAME,
231:                 R.string.name_phonetic_family, FLAGS_PHONETIC).setLongForm(true));
232:         kind.fieldList.add(new EditField(StructuredName.PHONETIC_MIDDLE_NAME,
233:                 R.string.name_phonetic_middle, FLAGS_PHONETIC).setLongForm(true));
234:         kind.fieldList.add(new EditField(StructuredName.PHONETIC_GIVEN_NAME,
235:                 R.string.name_phonetic_given, FLAGS_PHONETIC).setLongForm(true));
261:         kind.actionHeader = new PhoneActionInflater();
262:         kind.actionAltHeader = new PhoneActionAltInflater();
706:             addBuilder(new PhoneKindBuilder());
729:          * (structured, display and phonetic)
867:      * DataKind parser for Name. (structured, display, phonetic)
890:             // - DataKind.PSEUDO_MIME_TYPE_PHONETIC_NAME
943:             ks.fieldList.add(new EditField(StructuredName.PHONETIC_FAMILY_NAME,
944:                     R.string.name_phonetic_family, FLAGS_PHONETIC));
945:             ks.fieldList.add(new EditField(StructuredName.PHONETIC_MIDDLE_NAME,
946:                     R.string.name_phonetic_middle, FLAGS_PHONETIC));
947:             ks.fieldList.add(new EditField(StructuredName.PHONETIC_GIVEN_NAME,
948:                     R.string.name_phonetic_given, FLAGS_PHONETIC));
986:             // Phonetic name
988:                     DataKind.PSEUDO_MIME_TYPE_PHONETIC_NAME, null,
989:                     R.string.name_phonetic, Weight.NONE,
996:             kp.fieldList.add(new EditField(DataKind.PSEUDO_COLUMN_PHONETIC_NAME,
997:                     R.string.name_phonetic, FLAGS_PHONETIC).setShortForm(true));
998:             kp.fieldList.add(new EditField(StructuredName.PHONETIC_FAMILY_NAME,
999:                     R.string.name_phonetic_family, FLAGS_PHONETIC).setLongForm(true));
1000:             kp.fieldList.add(new EditField(StructuredName.PHONETIC_MIDDLE_NAME,
1001:                     R.string.name_phonetic_middle, FLAGS_PHONETIC).setLongForm(true));
1002:             kp.fieldList.add(new EditField(StructuredName.PHONETIC_GIVEN_NAME,
1003:                     R.string.name_phonetic_given, FLAGS_PHONETIC).setLongForm(true));
1050:             kind.actionAltHeader = new PhoneActionAltInflater();
543:             return ContactDisplayUtils.isCustomPhoneType(type);
548:             return ContactDisplayUtils.getPhoneLabelResourceId(type);
555:             return ContactDisplayUtils.isCustomPhoneType(type);
899:             final boolean supportsPhoneticFamilyName =
900:                     getAttr(attrs, "supportsPhoneticFamilyName", false);
901:             final boolean supportsPhoneticMiddleName =
902:                     getAttr(attrs, "supportsPhoneticMiddleName", false);
903:             final boolean supportsPhoneticGivenName =
904:                     getAttr(attrs, "supportsPhoneticGivenName", false);
911:             checkAttributeTrue(supportsPhoneticFamilyName, "supportsPhoneticFamilyName");
912:             checkAttributeTrue(supportsPhoneticMiddleName, "supportsPhoneticMiddleName");
913:             checkAttributeTrue(supportsPhoneticGivenName, "supportsPhoneticGivenName");
android.googlesource.com/platform/packages/apps/Bluetooth:src/com/android/bluetooth/map/BluetoothMapContentObserver.java: [ master, ]
2528:         public String phone;
3598:     private void registerPhoneServiceStateListener() {
3604:     private void unRegisterPhoneServiceStateListener() {
3669:     private PhoneStateListener mPhoneListener = new PhoneStateListener() {
453:         if (tm.getPhoneType() == TelephonyManager.PHONE_TYPE_CDMA) {
1443:                                 String phone = "";
1445:                                     phone = c.getString(c.getColumnIndex(Sms.ADDRESS));
1446:                                     if (phone != null && !phone.isEmpty()) {
1447:                                         name = BluetoothMapContent.getContactNameFromPhone(phone,
1450:                                             name = phone;
1453:                                         name = phone;
1460:                                         phone = tm.getLine1Number();
1461:                                         name = phone;
2539:         PushMsgInfo(long id, int transparent, int retry, String phone, Uri uri) {
2543:             this.phone = phone;
2693:                     // Only send to recipient's first phone number
2705:                     String phone = recipient.getFirstPhoneNumber();
2737:                         handle = sendMmsMessage(folder, new String[] {phone},
2756:                             uri = addMessageToUri(mResolver, contentUri, phone, msgBody, "",
2803:                                         new PushMsgInfo(handle, transparent, retry, phone, uri);
3231:             Log.d(TAG, "sendMessage to " + msgInfo.phone);
3234:                 smsMng.sendTextMessageWithoutPersisting(msgInfo.phone, null, parts.get(0),
3237:                 smsMng.sendMultipartTextMessageWithoutPersisting(msgInfo.phone, null, parts,
3672:             Log.d(TAG, "Phone service state change: " + serviceState.getState());
47: import android.telephony.PhoneStateListener;
3601:         tm.listen(mPhoneListener, PhoneStateListener.LISTEN_SERVICE_STATE);
3607:         tm.listen(mPhoneListener, PhoneStateListener.LISTEN_NONE);
2694:                     telNums.add(recipient.getFirstPhoneNumber());
3688:         registerPhoneServiceStateListener();
3698:         unRegisterPhoneServiceStateListener();
android.googlesource.com/platform/packages/apps/Contacts:src/com/android/contacts/model/account/BaseAccountType.java: [ master, ]
106:         static final int PHONE = 10;
62:     protected static final int FLAGS_PHONE = EditorInfo.TYPE_CLASS_PHONE;
248:     protected DataKind addDataKindPhone(Context context) throws DefinitionException {
538:     public static class PhoneActionInflater extends CommonInflater {
550:     public static class PhoneActionAltInflater extends CommonInflater {
1015:     private static class PhoneKindBuilder extends KindBuilder {
67:     protected static final int FLAGS_PHONETIC = EditorInfo.TYPE_CLASS_TEXT
127:     protected static EditType buildPhoneType(int type) {
213:     protected DataKind addDataKindPhoneticName(Context context) throws DefinitionException {
30: import android.provider.ContactsContract.CommonDataKinds.Phone;
123:         this.titleRes = R.string.account_phone;
128:         return new EditType(type, Phone.getTypeLabelResource(type));
249:         DataKind kind = addKind(new DataKind(Phone.CONTENT_ITEM_TYPE, R.string.phoneLabelsGroup,
250:                 Weight.PHONE, true));
255:         kind.actionBody = new SimpleInflater(Phone.NUMBER);
256:         kind.typeColumn = Phone.TYPE;
258:         kind.typeList.add(buildPhoneType(Phone.TYPE_MOBILE));
259:         kind.typeList.add(buildPhoneType(Phone.TYPE_HOME));
260:         kind.typeList.add(buildPhoneType(Phone.TYPE_WORK));
261:         kind.typeList.add(buildPhoneType(Phone.TYPE_FAX_WORK).setSecondary(true));
262:         kind.typeList.add(buildPhoneType(Phone.TYPE_FAX_HOME).setSecondary(true));
263:         kind.typeList.add(buildPhoneType(Phone.TYPE_PAGER).setSecondary(true));
264:         kind.typeList.add(buildPhoneType(Phone.TYPE_OTHER));
266:                 buildPhoneType(Phone.TYPE_CUSTOM).setSecondary(true).setCustomColumn(Phone.LABEL));
267:         kind.typeList.add(buildPhoneType(Phone.TYPE_CALLBACK).setSecondary(true));
268:         kind.typeList.add(buildPhoneType(Phone.TYPE_CAR).setSecondary(true));
269:         kind.typeList.add(buildPhoneType(Phone.TYPE_COMPANY_MAIN).setSecondary(true));
270:         kind.typeList.add(buildPhoneType(Phone.TYPE_ISDN).setSecondary(true));
271:         kind.typeList.add(buildPhoneType(Phone.TYPE_MAIN).setSecondary(true));
272:         kind.typeList.add(buildPhoneType(Phone.TYPE_OTHER_FAX).setSecondary(true));
273:         kind.typeList.add(buildPhoneType(Phone.TYPE_RADIO).setSecondary(true));
274:         kind.typeList.add(buildPhoneType(Phone.TYPE_TELEX).setSecondary(true));
275:         kind.typeList.add(buildPhoneType(Phone.TYPE_TTY_TDD).setSecondary(true));
276:         kind.typeList.add(buildPhoneType(Phone.TYPE_WORK_MOBILE).setSecondary(true));
277:         kind.typeList.add(buildPhoneType(Phone.TYPE_WORK_PAGER).setSecondary(true));
278:         kind.typeList.add(buildPhoneType(Phone.TYPE_ASSISTANT).setSecondary(true));
279:         kind.typeList.add(buildPhoneType(Phone.TYPE_MMS).setSecondary(true));
282:         kind.fieldList.add(new EditField(Phone.NUMBER, R.string.phoneLabelsGroup, FLAGS_PHONE));
507:             return Phone.TYPE;
511:             return Phone.LABEL;
1018:             return "phone";
1026:                     Phone.CONTENT_ITEM_TYPE, Phone.TYPE, R.string.phoneLabelsGroup, Weight.PHONE,
1027:                     new PhoneActionInflater(), new SimpleInflater(Phone.NUMBER));
1033:             kind.fieldList.add(new EditField(Phone.NUMBER, R.string.phoneLabelsGroup, FLAGS_PHONE));
1040:             return new EditType(type, Phone.getTypeLabelResource(type)).setSecondary(secondary);
1045:             if ("home".equals(type)) return build(Phone.TYPE_HOME, false);
1046:             if ("mobile".equals(type)) return build(Phone.TYPE_MOBILE, false);
1047:             if ("work".equals(type)) return build(Phone.TYPE_WORK, false);
1048:             if ("fax_work".equals(type)) return build(Phone.TYPE_FAX_WORK, true);
1049:             if ("fax_home".equals(type)) return build(Phone.TYPE_FAX_HOME, true);
1050:             if ("pager".equals(type)) return build(Phone.TYPE_PAGER, true);
1051:             if ("other".equals(type)) return build(Phone.TYPE_OTHER, false);
1052:             if ("callback".equals(type)) return build(Phone.TYPE_CALLBACK, true);
1053:             if ("car".equals(type)) return build(Phone.TYPE_CAR, true);
1054:             if ("company_main".equals(type)) return build(Phone.TYPE_COMPANY_MAIN, true);
1055:             if ("isdn".equals(type)) return build(Phone.TYPE_ISDN, true);
1056:             if ("main".equals(type)) return build(Phone.TYPE_MAIN, true);
1057:             if ("other_fax".equals(type)) return build(Phone.TYPE_OTHER_FAX, true);
1058:             if ("radio".equals(type)) return build(Phone.TYPE_RADIO, true);
1059:             if ("telex".equals(type)) return build(Phone.TYPE_TELEX, true);
1060:             if ("tty_tdd".equals(type)) return build(Phone.TYPE_TTY_TDD, true);
1061:             if ("work_mobile".equals(type)) return build(Phone.TYPE_WORK_MOBILE, true);
1062:             if ("work_pager".equals(type)) return build(Phone.TYPE_WORK_PAGER, true);
1065:             if ("assistant".equals(type)) return build(Phone.TYPE_ASSISTANT, true);
1066:             if ("mms".equals(type)) return build(Phone.TYPE_MMS, true);
1068:                 return build(Phone.TYPE_CUSTOM, true).setCustomColumn(Phone.LABEL);
68:             | EditorInfo.TYPE_TEXT_VARIATION_PHONETIC;
169:         kind.fieldList.add(new EditField(StructuredName.PHONETIC_FAMILY_NAME,
170:                 R.string.name_phonetic_family, FLAGS_PHONETIC));
171:         kind.fieldList.add(new EditField(StructuredName.PHONETIC_MIDDLE_NAME,
172:                 R.string.name_phonetic_middle, FLAGS_PHONETIC));
173:         kind.fieldList.add(new EditField(StructuredName.PHONETIC_GIVEN_NAME,
174:                 R.string.name_phonetic_given, FLAGS_PHONETIC));
194:                     FLAGS_PERSON_NAME).setPhoneticsColumn(StructuredName.PHONETIC_FAMILY_NAME));
196:                     FLAGS_PERSON_NAME).setOptional(true).setPhoneticsColumn(StructuredName.PHONETIC_MIDDLE_NAME));
198:                     FLAGS_PERSON_NAME).setPhoneticsColumn(StructuredName.PHONETIC_GIVEN_NAME));
201:                     FLAGS_PERSON_NAME).setPhoneticsColumn(StructuredName.PHONETIC_GIVEN_NAME));
203:                     FLAGS_PERSON_NAME).setOptional(true).setPhoneticsColumn(StructuredName.PHONETIC_MIDDLE_NAME));
205:                     FLAGS_PERSON_NAME).setPhoneticsColumn(StructuredName.PHONETIC_FAMILY_NAME));
214:         DataKind kind = addKind(new DataKind(DataKind.PSEUDO_MIME_TYPE_PHONETIC_NAME,
215:                 R.string.name_phonetic, Weight.NONE, true));
222:         kind.fieldList.add(new EditField(StructuredName.PHONETIC_FAMILY_NAME,
223:                 R.string.name_phonetic_family, FLAGS_PHONETIC));
224:         kind.fieldList.add(new EditField(StructuredName.PHONETIC_MIDDLE_NAME,
225:                 R.string.name_phonetic_middle, FLAGS_PHONETIC));
226:         kind.fieldList.add(new EditField(StructuredName.PHONETIC_GIVEN_NAME,
227:                 R.string.name_phonetic_given, FLAGS_PHONETIC));
253:         kind.actionHeader = new PhoneActionInflater();
254:         kind.actionAltHeader = new PhoneActionAltInflater();
704:             addBuilder(new PhoneKindBuilder());
727:          * (structured, display and phonetic)
865:      * DataKind parser for Name. (structured, display, phonetic)
888:             // - DataKind.PSEUDO_MIME_TYPE_PHONETIC_NAME
929:             ks.fieldList.add(new EditField(StructuredName.PHONETIC_FAMILY_NAME,
930:                     R.string.name_phonetic_family, FLAGS_PHONETIC));
931:             ks.fieldList.add(new EditField(StructuredName.PHONETIC_MIDDLE_NAME,
932:                     R.string.name_phonetic_middle, FLAGS_PHONETIC));
933:             ks.fieldList.add(new EditField(StructuredName.PHONETIC_GIVEN_NAME,
934:                     R.string.name_phonetic_given, FLAGS_PHONETIC));
969:             // Phonetic name
971:                     DataKind.PSEUDO_MIME_TYPE_PHONETIC_NAME, null,
972:                     R.string.name_phonetic, Weight.NONE,
979:             kp.fieldList.add(new EditField(StructuredName.PHONETIC_FAMILY_NAME,
980:                     R.string.name_phonetic_family, FLAGS_PHONETIC));
981:             kp.fieldList.add(new EditField(StructuredName.PHONETIC_MIDDLE_NAME,
982:                     R.string.name_phonetic_middle, FLAGS_PHONETIC));
983:             kp.fieldList.add(new EditField(StructuredName.PHONETIC_GIVEN_NAME,
984:                     R.string.name_phonetic_given, FLAGS_PHONETIC));
1031:             kind.actionAltHeader = new PhoneActionAltInflater();
541:             return ContactDisplayUtils.isCustomPhoneType(type);
546:             return ContactDisplayUtils.getPhoneLabelResourceId(type);
553:             return ContactDisplayUtils.isCustomPhoneType(type);
896:             final boolean supportsPhoneticFamilyName =
897:                     getAttr(attrs, "supportsPhoneticFamilyName", false);
898:             final boolean supportsPhoneticMiddleName =
899:                     getAttr(attrs, "supportsPhoneticMiddleName", false);
900:             final boolean supportsPhoneticGivenName =
901:                     getAttr(attrs, "supportsPhoneticGivenName", false);
907:             checkAttributeTrue(supportsPhoneticFamilyName, "supportsPhoneticFamilyName");
908:             checkAttributeTrue(supportsPhoneticMiddleName, "supportsPhoneticMiddleName");
909:             checkAttributeTrue(supportsPhoneticGivenName, "supportsPhoneticGivenName");
android.googlesource.com/platform/external/rapidjson:bin/types/mixed.json: [ master, ]
45:     "phone": "+1 (919) 438-2678",
104:     "phone": "+1 (889) 457-2319",
163:     "phone": "+1 (974) 410-2655",
222:     "phone": "+1 (983) 439-3000",
281:     "phone": "+1 (968) 578-2974",
340:     "phone": "+1 (980) 434-3976",
399:     "phone": "+1 (950) 466-3377",
458:     "phone": "+1 (956) 506-3807",
517:     "phone": "+1 (976) 455-2880",
576:     "phone": "+1 (941) 539-3851",
android.googlesource.com/platform/packages/apps/Exchange:src/com/android/exchange/adapter/ContactsSyncParser.java: [ master, ]
752:         String phone;
751:     static class PhoneRow implements UntypedRow {
755:         public PhoneRow(String _phone, int _type) {
1154:         public void addPhone(Entity entity, int type, String phone) {
70:     private static final int MAX_PHONE_ROWS = 2;
25: import android.provider.ContactsContract.CommonDataKinds.Phone;
72:     private static final String COMMON_TYPE_ROW = Phone.TYPE; // Could have been any typed row
148:                     workPhones.add(new PhoneRow(getValue(), Phone.TYPE_WORK));
151:                     ops.addPhone(entity, Phone.TYPE_MMS, getValue());
154:                     ops.addPhone(entity, Phone.TYPE_FAX_WORK, getValue());
156:                 case Tags.CONTACTS2_COMPANY_MAIN_PHONE:
157:                     ops.addPhone(entity, Phone.TYPE_COMPANY_MAIN, getValue());
160:                     ops.addPhone(entity, Phone.TYPE_FAX_HOME, getValue());
164:                     homePhones.add(new PhoneRow(getValue(), Phone.TYPE_HOME));
167:                     ops.addPhone(entity, Phone.TYPE_MOBILE, getValue());
170:                     ops.addPhone(entity, Phone.TYPE_CAR, getValue());
173:                     ops.addPhone(entity, Phone.TYPE_RADIO, getValue());
176:                     ops.addPhone(entity, Phone.TYPE_PAGER, getValue());
179:                     ops.addPhone(entity, Phone.TYPE_ASSISTANT, getValue());
322:         ops.addUntyped(entity, homePhones, Phone.CONTENT_ITEM_TYPE, Phone.TYPE_HOME,
323:                 MAX_PHONE_ROWS);
324:         ops.addUntyped(entity, workPhones, Phone.CONTENT_ITEM_TYPE, Phone.TYPE_WORK,
325:                 MAX_PHONE_ROWS);
756:             phone = _phone;
762:             builder.withValue(Im.DATA, phone);
763:             builder.withValue(Phone.TYPE, type);
768:             return type == _type && phone.equalsIgnoreCase(value);
931:                             final int subtype = cv.getAsInteger(Phone.TYPE);
1155:             RowBuilder builder = typedRowBuilder(entity, Phone.CONTENT_ITEM_TYPE, type);
1157:             if (cv != null && cvCompareString(cv, Phone.NUMBER, phone)) {
1160:             builder.withValue(Phone.TYPE, type);
1161:             builder.withValue(Phone.NUMBER, phone);
146:                 case Tags.CONTACTS_BUSINESS2_TELEPHONE_NUMBER:
147:                 case Tags.CONTACTS_BUSINESS_TELEPHONE_NUMBER:
162:                 case Tags.CONTACTS_HOME_TELEPHONE_NUMBER:
163:                 case Tags.CONTACTS_HOME2_TELEPHONE_NUMBER:
166:                 case Tags.CONTACTS_MOBILE_TELEPHONE_NUMBER:
169:                 case Tags.CONTACTS_CAR_TELEPHONE_NUMBER:
172:                 case Tags.CONTACTS_RADIO_TELEPHONE_NUMBER:
178:                 case Tags.CONTACTS_ASSISTANT_TELEPHONE_NUMBER:
1091:                     cvCompareString(cv, StructuredName.PHONETIC_GIVEN_NAME, yomiFirstName) &&
1092:                     cvCompareString(cv, StructuredName.PHONETIC_FAMILY_NAME, yomiLastName) &&
1100:             builder.withValue(StructuredName.PHONETIC_GIVEN_NAME, yomiFirstName);
1101:             builder.withValue(StructuredName.PHONETIC_FAMILY_NAME, yomiLastName);
1298:                     cvCompareString(cv, Organization.PHONETIC_NAME, yomiCompanyName) &&
1308:             builder.withValue(Organization.PHONETIC_NAME, yomiCompanyName);
115:         ArrayList<UntypedRow> homePhones = new ArrayList<UntypedRow>();
116:         ArrayList<UntypedRow> workPhones = new ArrayList<UntypedRow>();
github.com/android-pay/s2ap-quickstart-java:src/main/java/com/google/wallet/objects/webservice/WebserviceWalletUser.java: [ master, ]
22:   String phone;
173:   public String getPhone() {
180:   public void setPhone(String phone) {
171:    * @return the phone
174:     return phone;
178:    * @param phone the phone to set
181:     this.phone = phone;
android.googlesource.com/platform/external/libppp:src/datalink.h: [ master, ]
76:     } phone;
97:   } phone;
82:       int timeout;		/* Redial timeout value (end of phone list) */
94:     char *next;			/* Next phone from the list */
95:     char *alt;			/* Alternate (after fail) phone from the list */
96:     const char *chosen;		/* Chosen phone number after DIAL */
75:       char list[SCRIPT_LEN];	/* Telephone Numbers */
155: extern const char *datalink_ChoosePhoneNumber(struct datalink *);
github.com/android-pay/s2ap-quickstart-csharp:WalletObjectsCSharp/webservice/WebserviceWalletUser.cs: [ master, ]
32: 	   internal string phone;
159: 	  public virtual string Phone
158: 	  /// <returns> the phone </returns>
163: 			return phone;
167: 			this.phone = value;
github.com/MobileChromeApps/AndroidApkTemplate:apk-template/res/raw/messaging_api.js: [ master, ]
52:       phone: to,
android.googlesource.com/platform/external/libchrome:device/bluetooth/bluetooth_common.h: [ master, ]
33:   PHONE,
android.googlesource.com/platform/external/snakeyaml:src/test/java/org/yaml/snakeyaml/resolver/ResolverTest.java: [ master, ]
75:     class Phone {
78:         public Phone(String n) {
105:         private class RepresentPhone implements Represent {
119:         private class ConstructPhone extends AbstractConstruct {
141:         private class RepresentPhone implements Represent {
43:         yaml.addImplicitResolver(new Tag(Tag.PREFIX + "Phone"), regexp, "0123456789");
44:         Phone phone1 = new Phone("12-34-567");
45:         Phone phone2 = new Phone("11-22-333");
46:         Phone phone3 = new Phone("44-55-777");
47:         List<Phone> etalonList = new ArrayList<Phone>();
48:         etalonList.add(phone1);
49:         etalonList.add(phone2);
50:         etalonList.add(phone3);
53:         List<Phone> parsedList = (List<Phone>) yaml.load(output);
55:         assertEquals(phone1, parsedList.get(0));
56:         assertEquals(phone2, parsedList.get(1));
57:         assertEquals(phone3, parsedList.get(2));
64:         yaml.addImplicitResolver(new Tag(Tag.PREFIX + "Phone"), regexp, "\0");
69:         map.put("a", new Phone("12-34-567"));
88:             if (!(obj instanceof Phone)) {
96:             return "Phone: " + number;
102:             this.representers.put(Phone.class, new RepresentPhone());
107:                 Phone phone = (Phone) data;
108:                 String value = phone.getNumber();
109:                 return representScalar(new Tag(Tag.PREFIX + "Phone"), value);
116:             this.yamlConstructors.put(new Tag(Tag.PREFIX + "Phone"), new ConstructPhone());
122:                 return new Phone(val);
130:             this.representers.put(Phone.class, new RepresentPhone());
135:                 Point phone = (Point) data;
136:                 String value = "x" + (int) phone.getX() + "_y" + (int) phone.getY();
143:                 Phone phone = (Phone) data;
144:                 String value = phone.getNumber();
145:                 return representScalar(new Tag(Tag.PREFIX + "Phone"), value);
android.googlesource.com/platform/external/grpc-grpc:third_party/nanopb/tests/common/person.proto: [ master, ]
21:   repeated PhoneNumber phone = 4 [(nanopb).max_count = 5];
10:   enum PhoneType {
16:   message PhoneNumber {
18:     optional PhoneType type = 2 [default = HOME];
android.googlesource.com/platform/superproject:external/grpc-grpc/third_party/nanopb/tests/common/person.proto: [ master, ] Duplicate result
android.googlesource.com/platform/external/nanopb-c:tests/common/person.proto: [ master, ] Duplicate result
android.googlesource.com/platform/external/python/cpython3:Lib/ctypes/test/test_structures.py: [ master, ]
285:         class Phone(Structure):
318:         class Phone(Structure):
291:                         ("phone", Phone),
297:         self.assertEqual(p.phone.areacode, b"1234")
298:         self.assertEqual(p.phone.number, b"5678")
324:                         ("phone", Phone),
330:                              "(Phone) <class 'TypeError'>: "
336:                              "(Phone) <class 'TypeError'>: too many initializers")
android.googlesource.com/platform/frameworks/policies/base:phone/com/android/internal/policy/impl/PhoneWindowManager.java: [ master, ]
128:     static final int PHONE_LAYER = 3;
117: public class PhoneWindowManager implements WindowManagerPolicy {
136:     static final int PRIORITY_PHONE_LAYER = 9;
1011:     static ITelephony getPhoneInterface() {
88: import static android.view.WindowManager.LayoutParams.TYPE_PHONE;
89: import static android.view.WindowManager.LayoutParams.TYPE_PRIORITY_PHONE;
111:  * WindowManagerPolicy implementation for the Android phone UI.  This
661:             case TYPE_PHONE:
662:             case TYPE_PRIORITY_PHONE:
771:         case TYPE_PHONE:
772:             return PHONE_LAYER;
787:         case TYPE_PRIORITY_PHONE:
788:             return PRIORITY_PHONE_LAYER;
1677:         final ITelephony phone = getPhoneInterface();
1678:         if (phone == null) {
1683:             return phone.isOffhook();
1790:             // This is necessary because the phone app will disable the keyguard
113:  * PhoneWindowManager.  This is used to protect some internal state, and
508:                 "PhoneWindowManager.mBroadcastWakeLock");
1061:                             ITelephony phoneServ = getPhoneInterface();
1062:                             if (phoneServ != null) {
1063:                                 incomingRinging = phoneServ.isRinging();
1674:      * @return Whether a telephone call is in progress right now.
1819:                     ITelephony phoneServ = getPhoneInterface();
1820:                     if (phoneServ != null) {
1823:                                 handled = hungUp = phoneServ.endCall();
1825:                                 if (phoneServ.isRinging()) {
1828:                                     phoneServ.silenceRinger();
1830:                                 } else if (phoneServ.isOffhook() &&
1836:                                     handled = hungUp = phoneServ.endCall();
1890:                     // case, the PhoneWindow class will do the same thing, except it will
1908:                         ITelephony phoneServ = getPhoneInterface();
1909:                         if (phoneServ != null) {
1910:                             if (phoneServ.isRinging()) {
1913:                                 phoneServ.answerRingingCall();
1937:                         ITelephony phoneServ = getPhoneInterface();
1938:                         if (phoneServ != null) {
1939:                             if (phoneServ.isRinging()) {
1944:                                 phoneServ.silenceRinger();
1068:                             Log.w(TAG, "RemoteException from getPhoneInterface()", ex);
1923:                         Log.w(TAG, "CALL button: RemoteException from getPhoneInterface()", ex);
1954:                         Log.w(TAG, "VOLUME button: RemoteException from getPhoneInterface()", ex);
github.com/google-developer-training/android-fundamentals-phone-sms:PhoneCallingSample/app/src/main/java/com/example/android/phonecallingsample/MainActivity.java: [ master, ]
42:     private static final int MY_PERMISSIONS_REQUEST_CALL_PHONE = 1;
17: package com.example.android.phonecallingsample;
96:     private void checkForPhonePermission() {
175:     private class MyPhoneCallListener extends PhoneStateListener {
37:  * This app accepts a phone number and makes a phone call.
50:      *     Checks for phone permission.
65:             // Check for phone permission.
67:             // Register the PhoneStateListener to monitor phone activity.
94:      * Checks whether the app has phone-calling permission.
98:                 Manifest.permission.CALL_PHONE) != PackageManager.PERMISSION_GRANTED) {
101:             // MY_PERMISSIONS_REQUEST_CALL_PHONE is an
105:                     new String[]{Manifest.permission.CALL_PHONE},
106:                     MY_PERMISSIONS_REQUEST_CALL_PHONE);
126:             case MY_PERMISSIONS_REQUEST_CALL_PHONE: {
127:                 if (permissions[0].equalsIgnoreCase(Manifest.permission.CALL_PHONE)
144:      * Uses an implicit intent to make the phone call.
147:      * @param view View (phone_icon) that was clicked.
151:         // Use format with "tel:" and phone number to create phoneNumber.
153:         // Log the concatenated phone number for dialing.
159:         // Set the data for the intent as the phone number.
161:         // If package resolves to an app, check for phone permission,
172:      * Monitors and logs phone call activities, and shows the phone state
181:             String message = getString(R.string.phone_status);
191:                     // Phone call is active -- off the hook.
198:                     // Phone is idle before and after phone call.
200:                     // restart activity when phone call ends.
217:                     message = message + "Phone off";
226:      * Makes the call button (phone_icon) invisible so that it can't be used,
230:         Toast.makeText(this, R.string.phone_disabled, Toast.LENGTH_LONG).show();
231:         ImageButton callButton = (ImageButton) findViewById(R.id.phone_icon);
240:      * Makes the call button (phone_icon) visible so that it can be used.
243:         ImageButton callButton = (ImageButton) findViewById(R.id.phone_icon);
27: import android.telephony.PhoneStateListener;
51:      *     Sets the PhoneStateListener.
69:             mTelephonyManager.listen(mListener, PhoneStateListener.LISTEN_CALL_STATE);
152:         String phoneNumber = String.format("tel: %s", editText.getText().toString());
154:         Log.d(TAG, getString(R.string.dial_number) + phoneNumber);
155:         Toast.makeText(this, getString(R.string.dial_number) + phoneNumber,
160:         callIntent.setData(Uri.parse(phoneNumber));
262:             mTelephonyManager.listen(mListener, PhoneStateListener.LISTEN_NONE);
45:     private MyPhoneCallListener mListener;
66:             checkForPhonePermission();
68:             mListener = new MyPhoneCallListener();
164:             checkForPhonePermission();
github.com/google-developer-training/android-fundamentals-phone-sms:PhoneCallingSampleChallenge/app/src/main/java/com/example/android/phonecallingsamplechallenge/MainActivity.java: [ master, ]
45:     private static final int MY_PERMISSIONS_REQUEST_CALL_PHONE = 1;
17: package com.example.android.phonecallingsamplechallenge;
99:     private void checkForPhonePermission() {
188:     private class MyPhoneCallListener extends PhoneStateListener {
39:  * This app accepts a phone number and makes a phone call.
40:  * For incoming calls, the app shows the phone number of the caller.
53:      *     Checks for phone permission.
68:             // Check for phone permission.
70:             // Register the PhoneStateListener to monitor phone activity.
97:      * Checks whether the app has phone-calling permission.
101:                 Manifest.permission.CALL_PHONE) != PackageManager.PERMISSION_GRANTED) {
104:             // MY_PERMISSIONS_REQUEST_CALL_PHONE is an
108:                     new String[]{Manifest.permission.CALL_PHONE},
109:                     MY_PERMISSIONS_REQUEST_CALL_PHONE);
129:             case MY_PERMISSIONS_REQUEST_CALL_PHONE: {
130:                 if (permissions[0].equalsIgnoreCase(Manifest.permission.CALL_PHONE)
148:      * Uses an implicit intent to make the phone call.
164:         // Use format with "tel:" and phone number to create phoneNumber.
166:         // Log the concatenated phone number for dialing.
172:         // Set the data for the intent as the phone number.
174:         // If package resolves to an app, check for phone permission,
185:      * Monitors and logs phone call activities, and shows the phone state
194:             String message = getString(R.string.phone_status);
204:                     // Phone call is active -- off the hook.
211:                     // Phone is idle before and after phone call.
213:                     // restart activity when phone call ends.
230:                     message = message + "Phone off";
239:      * Makes the call button (phone icon) invisible so that it can't be used,
243:         Toast.makeText(this, R.string.phone_disabled, Toast.LENGTH_LONG).show();
244:         ImageButton callButton = (ImageButton) findViewById(R.id.phone_icon);
253:      * Makes the call button (phone icon) visible so that it can be used.
256:         ImageButton callButton = (ImageButton) findViewById(R.id.phone_icon);
27: import android.telephony.PhoneNumberUtils;
28: import android.telephony.PhoneStateListener;
54:      *     Sets the PhoneStateListener.
72:             mTelephonyManager.listen(mListener, PhoneStateListener.LISTEN_CALL_STATE);
162:                     PhoneNumberUtils.normalizeNumber(editText.getText().toString());
165:         String phoneNumber = String.format("tel: %s", normalizedPhoneNumber);
167:         Log.d(TAG, getString(R.string.dial_number) + phoneNumber);
168:         Toast.makeText(this, getString(R.string.dial_number) + phoneNumber,
173:         callIntent.setData(Uri.parse(phoneNumber));
273:             mTelephonyManager.listen(mListener, PhoneStateListener.LISTEN_NONE);
48:     private MyPhoneCallListener mListener;
69:             checkForPhonePermission();
71:             mListener = new MyPhoneCallListener();
154:         String normalizedPhoneNumber;
159:             normalizedPhoneNumber = editText.getText().toString();
161:             normalizedPhoneNumber =
177:             checkForPhonePermission();
android.googlesource.com/platform/external/sqlite:android/PhoneNumberUtils.cpp: [ master, ]
281: static bool phone_number_compare_inter(const char* const org_a, const char* const org_b,
444: bool phone_number_compare_strict(const char* a, const char* b)
453: bool phone_number_stripped_reversed_inter(const char* in, char* out, const int len, int *outlen) {
138:  * digit to compare two phone numbers.
260:  * Compare phone numbers a and b, return true if they're identical
268:  * "the display language is English but the phone should be in Japan", but
270:  * in the country where the phone is used. More specifically, "880-1234-1234"
271:  * is not valid phone number in Japan since the trunk prefix in Japan is not 8
312:             // Different Country Calling Code. Must be different phone number.
380:                 return phone_number_compare_inter(org_a, org_b, false);
395:                 return phone_number_compare_inter(org_a, org_b, false);
446:     return phone_number_compare_inter(a, b, true);
450:  * Imitates the Java method PhoneNumberUtils.getStrippedReversed.
android.googlesource.com/platform/test/mlts/benchmark:src/com/android/nn/benchmark/evaluators/PhoneErrorRate.java: [ master, ]
13:     static private final float PHONE_ERROR_RATE_LIMIT = 5f;  // 5%
12: public class PhoneErrorRate extends BaseSequenceEvaluator {
10:  * This validates that the Phone Error Rate (PER) is within the limit.
21:         if (per > PHONE_ERROR_RATE_LIMIT) {
22:             outValidationErrors.add("Phone error rate exceeded the limit: " + per);
29:         keys.add("max_phone_error_rate");
33:     /** Calculates Phone Error Rate in percent. */
36:         int[] outputPhones = new int[inferenceCount];
37:         int[] expectedOutputPhones = new int[inferenceCount];
39:             outputPhones[i] = SequenceUtils.indexOfLargest(outputs[i]);
40:             expectedOutputPhones[i] = SequenceUtils.indexOfLargest(expectedOutputs[i]);
42:         int errorCount = SequenceUtils.calculateEditDistance(outputPhones, expectedOutputPhones);
github.com/apache/incubator-milagro-mfa-sdk-android:mpin-sdk-core/ext/boost/boost/predef/platform/windows_phone.h: [ master, ]
25: #define BOOST_PLAT_WINDOWS_PHONE BOOST_VERSION_NUMBER_NOT_AVAILABLE
29: #   define BOOST_PLAT_WINDOWS_PHONE BOOST_VERSION_NUMBER_AVAILABLE
9: #define BOOST_PREDEF_PLAT_WINDOWS_PHONE_H
33: #   define BOOST_PLAT_WINDOWS_PHONE_AVALIABLE
37: #define BOOST_PLAT_WINDOWS_PHONE_NAME "Windows Phone"
8: #ifndef BOOST_PREDEF_PLAT_WINDOWS_PHONE_H
16: [heading `BOOST_PLAT_WINDOWS_PHONE`]
21:     [[`WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP`] [__predef_detection__]]
27: #if BOOST_OS_WINDOWS && defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
28: #   undef BOOST_PLAT_WINDOWS_PHONE
32: #if BOOST_PLAT_WINDOWS_PHONE
40: BOOST_PREDEF_DECLARE_TEST(BOOST_PLAT_WINDOWS_PHONE,BOOST_PLAT_WINDOWS_PHONE_NAME)
android.googlesource.com/platform/packages/apps/Car/tests:TestMediaApp/src/com/android/car/media/testmediaapp/phone/TmaLauncherActivity.java: [ master, ]
1: package com.android.car.media.testmediaapp.phone;
19:  * Runs on a phone, thus making the browse tree available to bluetooth.
github.com/googlearchive/android-AutofillFramework:Application/build/generated/source/r/debug/com/example/android/autofill/app/R.java: [ master, ]
5261:     public static final int recycler_view_label_phone=0x7f10007b;
16198:      * <tr><td>phone</td><td>3</td><td></td></tr>
16214:      * <tr><td>textPhonetic</td><td>c1</td><td></td></tr>
github.com/googlearchive/android-AutofillFramework:Application/build/generated/source/r/release/com/example/android/autofill/app/R.java: [ master, ] Duplicate result
android.googlesource.com/platform/external/qt:Windows-4.7.4/src/corelib/global/qnamespace.h: [ master, ]
1040:         Key_Phone = 0x010000e3,
android.googlesource.com/platform/external/libppp:src/command.c: [ master, ]
119: #define	VAR_PHONE	12
1998:   case VAR_PHONE:
1999:     strncpy(cx->cfg.phone.list, argp, sizeof cx->cfg.phone.list - 1);
2000:     cx->cfg.phone.list[sizeof cx->cfg.phone.list - 1] = '\0';
2001:     cx->phone.alt = cx->phone.next = NULL;
2171:     *cx->cfg.cbcp.phone = '\0';
2174:       strncpy(cx->cfg.cbcp.phone, arg->argv[arg->argn],
2175:               sizeof cx->cfg.cbcp.phone - 1);
2176:       cx->cfg.cbcp.phone[sizeof cx->cfg.cbcp.phone - 1] = '\0';
2359:   "CBCP control", "set cbcp [*|phone[,phone...] [delay [timeout]]]",
2433:   {"phone", NULL, SetVariable, LOCAL_AUTH | LOCAL_CX, "telephone number(s)",
2434:   "set phone phone1[:phone2[...]]", (const void *)VAR_PHONE},
android.googlesource.com/platform/packages/providers/ContactsProvider:src/com/android/providers/contacts/ContactsProvider2.java: [ master, ]
262:     private static final int PHONE_NUMBER_LENGTH_LIMIT = 1000;
351:     public static final int PHONE_LOOKUP = 4000;
352:     public static final int PHONE_LOOKUP_ENTERPRISE = 4001;
590:     private static final String PHONE_FILTER_SORT_ORDER = EMAIL_FILTER_SORT_ORDER;
220:     /* package */ static final String PHONEBOOK_COLLATOR_NAME = "PHONEBOOK";
331:     public static final int PHONES = 3002;
332:     public static final int PHONES_ID = 3003;
333:     public static final int PHONES_FILTER = 3004;
345:     public static final int PHONES_ENTERPRISE = 3016;
347:     public static final int PHONES_FILTER_ENTERPRISE = 3018;
1444:     private boolean mIsPhone;
9665:     protected boolean isPhone() {
786:     private static final ProjectionMap sStrequentPhoneOnlyProjectionMap
917:     private static final ProjectionMap sPhoneLookupProjectionMap = ProjectionMap.builder()
1443:     private boolean mIsPhoneInitialized;
4676:     private void maybeTrimLongPhoneNumber(ContentValues values) {
7113:     private Cursor queryMergedDataPhones(Uri uri, String[] projection, String selection,
7341:     private Cursor queryPhoneLookupEnterprise(final Uri uri, String[] projection, String selection,
9349:     private boolean isPhoneNumber(String query) {
9361:     public static int countPhoneNumberDigits(String query) {
80: import android.provider.ContactsContract.CommonDataKinds.Phone;
261:     /** Maximum length of a phone number that can be inserted into the database */
640:             .add(Contacts.HAS_PHONE_NUMBER)
700:             .add(Data.PREFERRED_PHONE_ACCOUNT_COMPONENT_NAME)
701:             .add(Data.PREFERRED_PHONE_ACCOUNT_ID)
754:             .add(Contacts.HAS_PHONE_NUMBER)
781:      * Used for Strequent URI with {@link ContactsContract#STREQUENT_PHONE_ONLY}, which allows
791:             .add(Phone.NUMBER)
792:             .add(Phone.TYPE)
793:             .add(Phone.LABEL)
794:             .add(Phone.IS_SUPER_PRIMARY)
795:             .add(Phone.CONTACT_ID)
940:             .add(PhoneLookup.HAS_PHONE_NUMBER, "contacts_view." + Contacts.HAS_PHONE_NUMBER)
942:             .add(PhoneLookup.NUMBER, Phone.NUMBER)
943:             .add(PhoneLookup.TYPE, Phone.TYPE)
944:             .add(PhoneLookup.LABEL, Phone.LABEL)
945:             .add(PhoneLookup.NORMALIZED_NUMBER, Phone.NORMALIZED_NUMBER)
946:             .add(Data.PREFERRED_PHONE_ACCOUNT_COMPONENT_NAME)
947:             .add(Data.PREFERRED_PHONE_ACCOUNT_ID)
997:                         + " WHERE " + Contacts.HAS_PHONE_NUMBER + ")")
1046:                             + " WHERE " + Contacts.HAS_PHONE_NUMBER
1283:         matcher.addURI(ContactsContract.AUTHORITY, "phone_lookup/*", PHONE_LOOKUP);
1284:         matcher.addURI(ContactsContract.AUTHORITY, "phone_lookup_enterprise/*",
1285:                 PHONE_LOOKUP_ENTERPRISE);
1507:             // In production code we don't want to throw here, so that phone will still work
1650:         handlerMap.put(Phone.CONTENT_ITEM_TYPE,
2954:         if (Phone.CONTENT_ITEM_TYPE.equals(mimeType)) {
4678:         if (data1 != null && data1.length() > PHONE_NUMBER_LENGTH_LIMIT) {
4679:             values.put(Data.DATA1, data1.substring(0, PHONE_NUMBER_LENGTH_LIMIT));
4692:         if (Phone.CONTENT_ITEM_TYPE.equals(mimeType)) {
5926:                         uri, ContactsContract.STREQUENT_PHONE_ONLY, false);
5943:                 // String that will store the query for starred contacts. For phone only queries,
5944:                 // these will return a list of all phone numbers that belong to starred contacts.
5949:                     // In phone only mode, we need to look at view_data instead of
5950:                     // contacts/raw_contacts to obtain actual phone numbers. One problem is that
5954:                     // For starred phone numbers, we select only phone numbers that belong to
5972:                             mDbHelper.get().getMimeTypeId(Phone.CONTENT_ITEM_TYPE);
5987:                     // Construct the query string for frequent phone numbers
5989:                     // For frequent phone numbers, we start from data usage table and join
5991:                     // data rows (almost always it should be), and we don't want any phone
6196:                     // In this case, because we dedupe phone numbers, the address book indexer needs
6199:                     // So use count(distinct pair(CONTACT_ID, PHONE NUMBER)) instead of count(*).
6201:                     // CONTACT_ID || ',' || PHONE NUMBER instead.
6248:                             Phone.SEARCH_DISPLAY_NAME_KEY, true);
6250:                             Phone.SEARCH_PHONE_NUMBER_KEY, true);
6283:                                     + " FROM " + Tables.PHONE_LOOKUP
6309:                         // If it is neither a phone number nor a name, the query should return
6317:                     // If the row is for a phone number that has a normalized form, we should use
6322:                         + Phone.NORMALIZED_NUMBER + " IS NOT NULL)";
6324:                         + " THEN " + Phone.NORMALIZED_NUMBER
6325:                         + " ELSE " + Phone.NUMBER + " END), " + RawContacts.CONTACT_ID;
6327:                     groupBy = "(CASE WHEN " + Phone.NORMALIZED_NUMBER
6328:                         + " IS NOT NULL THEN " + Phone.NORMALIZED_NUMBER
6329:                         + " ELSE " + Phone.NUMBER + " END), " + RawContacts.CONTACT_ID;
6334:                         sortOrder = accountPromotionSortOrder + ", " + PHONE_FILTER_SORT_ORDER;
6336:                         sortOrder = PHONE_FILTER_SORT_ORDER;
6348:                     initialUri = Phone.CONTENT_FILTER_URI;
6349:                     contactIdString = Phone.CONTACT_ID;
6523:                 // we only want data items that are either email addresses or phone numbers
6537:                 // but we want all the email addresses and phone numbers that belong to
6555:                 // All contacts where the phone number matches the query (determined by checking
6556:                 // Tables.PHONE_LOOKUP
6560:                             " FROM " + Tables.PHONE_LOOKUP + " JOIN " + Tables.RAW_CONTACTS +
6561:                             " ON (" + Tables.PHONE_LOOKUP + "." +
6702:             case PHONE_LOOKUP_ENTERPRISE: {
6704:                     throw new IllegalArgumentException("Phone number missing in URI: " + uri);
6709:             case PHONE_LOOKUP: {
6710:                 // Phone lookup cannot be combined with a selection
6755:                     // phone_number_compare_loose.
6773:                         // phone_number_compare_loose in SQLite works only with non-normalized
7111:      * Handles {@link Phone#ENTERPRISE_CONTENT_URI}.
7118:         final StringBuilder newPathBuilder = new StringBuilder(Phone.CONTENT_URI.getPath());
7344:         // Unlike PHONE_LOOKUP, only decode once here even for SIP address. See bug 25900607.
7491:         // same index at the same time (which actually happens on the phone app) we only execute
8042:                 sb.append("(SELECT MIN(" + Phone.NUMBER + ")");
8044:                         Tables.DATA_JOIN_RAW_CONTACTS + " JOIN " + Tables.PHONE_LOOKUP);
8046:                 sb.append("=" + Tables.PHONE_LOOKUP + "." + PhoneLookupColumns.DATA_ID);
8105:             //  - We can't match against tokens, because phone-numbers can't contain @
8112:             // normalized version of the phone number (phoneNumber can only have + and digits)
8129:             // general case: not a phone number, not an email-address
9193:                 return Phone.CONTENT_TYPE;
9195:                 return Phone.CONTENT_ITEM_TYPE;
9196:             case PHONE_LOOKUP:
9197:             case PHONE_LOOKUP_ENTERPRISE:
9286:             case PHONE_LOOKUP:
9287:             case PHONE_LOOKUP_ENTERPRISE:
9353:         // Assume a phone number if it has at least 1 digit.
9358:      * Returns the number of digits in a phone number ignoring special characters such as '-'.
9359:      * If the string is not a valid phone number, 0 is returned.
9374:                 return 0;  // Not a phone number.
9687:      * Returns a sort order String for promoting data rows (email addresses, phone numbers, etc.)
94: import android.provider.ContactsContract.PhoneLookup;
110: import android.telephony.PhoneNumberUtils;
137: import com.android.providers.contacts.ContactsDatabaseHelper.PhoneLookupColumns;
624:             .add(Contacts.PHONETIC_NAME)
625:             .add(Contacts.PHONETIC_NAME_STYLE)
633:             .add(ContactsColumns.PHONEBOOK_LABEL_PRIMARY)
634:             .add(ContactsColumns.PHONEBOOK_BUCKET_PRIMARY)
635:             .add(ContactsColumns.PHONEBOOK_LABEL_ALTERNATIVE)
636:             .add(ContactsColumns.PHONEBOOK_BUCKET_ALTERNATIVE)
814:             .add(RawContacts.PHONETIC_NAME)
815:             .add(RawContacts.PHONETIC_NAME_STYLE)
818:             .add(RawContactsColumns.PHONEBOOK_LABEL_PRIMARY)
819:             .add(RawContactsColumns.PHONEBOOK_BUCKET_PRIMARY)
820:             .add(RawContactsColumns.PHONEBOOK_LABEL_ALTERNATIVE)
821:             .add(RawContactsColumns.PHONEBOOK_BUCKET_ALTERNATIVE)
866:     /** Contains columns in PhoneLookup which are not contained in the data view. */
868:             .add(PhoneLookup.DATA_ID, Data._ID)
869:             .add(PhoneLookup.NUMBER, SipAddress.SIP_ADDRESS)
870:             .add(PhoneLookup.TYPE, "0")
871:             .add(PhoneLookup.LABEL, "NULL")
872:             .add(PhoneLookup.NORMALIZED_NUMBER, "NULL")
918:             .add(PhoneLookup._ID, "contacts_view." + Contacts._ID)
919:             .add(PhoneLookup.CONTACT_ID, "contacts_view." + Contacts._ID)
920:             .add(PhoneLookup.DATA_ID, PhoneLookup.DATA_ID)
921:             .add(PhoneLookup.LOOKUP_KEY, "contacts_view." + Contacts.LOOKUP_KEY)
922:             .add(PhoneLookup.DISPLAY_NAME_SOURCE, "contacts_view." + Contacts.DISPLAY_NAME_SOURCE)
923:             .add(PhoneLookup.DISPLAY_NAME, "contacts_view." + Contacts.DISPLAY_NAME)
924:             .add(PhoneLookup.DISPLAY_NAME_ALTERNATIVE,
926:             .add(PhoneLookup.PHONETIC_NAME, "contacts_view." + Contacts.PHONETIC_NAME)
927:             .add(PhoneLookup.PHONETIC_NAME_STYLE, "contacts_view." + Contacts.PHONETIC_NAME_STYLE)
928:             .add(PhoneLookup.SORT_KEY_PRIMARY, "contacts_view." + Contacts.SORT_KEY_PRIMARY)
929:             .add(PhoneLookup.SORT_KEY_ALTERNATIVE, "contacts_view." + Contacts.SORT_KEY_ALTERNATIVE)
930:             .add(PhoneLookup.LR_LAST_TIME_CONTACTED, "contacts_view." + Contacts.LR_LAST_TIME_CONTACTED)
931:             .add(PhoneLookup.LR_TIMES_CONTACTED, "contacts_view." + Contacts.LR_TIMES_CONTACTED)
932:             .add(PhoneLookup.STARRED, "contacts_view." + Contacts.STARRED)
933:             .add(PhoneLookup.IN_DEFAULT_DIRECTORY, "contacts_view." + Contacts.IN_DEFAULT_DIRECTORY)
934:             .add(PhoneLookup.IN_VISIBLE_GROUP, "contacts_view." + Contacts.IN_VISIBLE_GROUP)
935:             .add(PhoneLookup.PHOTO_ID, "contacts_view." + Contacts.PHOTO_ID)
936:             .add(PhoneLookup.PHOTO_FILE_ID, "contacts_view." + Contacts.PHOTO_FILE_ID)
937:             .add(PhoneLookup.PHOTO_URI, "contacts_view." + Contacts.PHOTO_URI)
938:             .add(PhoneLookup.PHOTO_THUMBNAIL_URI, "contacts_view." + Contacts.PHOTO_THUMBNAIL_URI)
939:             .add(PhoneLookup.CUSTOM_RINGTONE, "contacts_view." + Contacts.CUSTOM_RINGTONE)
941:             .add(PhoneLookup.SEND_TO_VOICEMAIL, "contacts_view." + Contacts.SEND_TO_VOICEMAIL)
994:             .add(Groups.SUMMARY_WITH_PHONES,
1042:             .add(Settings.UNGROUPED_WITH_PHONES,
1229:         matcher.addURI(ContactsContract.AUTHORITY, "data/phones", PHONES);
1230:         matcher.addURI(ContactsContract.AUTHORITY, "data_enterprise/phones", PHONES_ENTERPRISE);
1231:         matcher.addURI(ContactsContract.AUTHORITY, "data/phones/#", PHONES_ID);
1232:         matcher.addURI(ContactsContract.AUTHORITY, "data/phones/filter", PHONES_FILTER);
1233:         matcher.addURI(ContactsContract.AUTHORITY, "data/phones/filter/*", PHONES_FILTER);
1234:         matcher.addURI(ContactsContract.AUTHORITY, "data/phones/filter_enterprise",
1235:                 PHONES_FILTER_ENTERPRISE);
1236:         matcher.addURI(ContactsContract.AUTHORITY, "data/phones/filter_enterprise/*",
1237:                 PHONES_FILTER_ENTERPRISE);
3683:             case PHONES_ID:
4062:             case PHONES_ID:
5925:                 final boolean phoneOnly = readBooleanQueryParameter(
5947:                 if (