Found 21651 results in 3550 files, showing top 50 files (show more).
android.googlesource.com/platform/packages/services/Telephony:src/com/android/phone/PhoneInterfaceManager.java: [ master, ]
393:         public Phone phone;
17: package com.android.phone;
201: public class PhoneInterfaceManager extends ITelephony.Stub {
1808:     private PhoneInterfaceManager(PhoneGlobals app) {
1825:     private Phone getDefaultPhone() {
1859:     private Phone getPhone(int subId) {
2502:     public String getNetworkCountryIsoForPhone(int phoneId) {
6271:     public int checkCarrierPrivilegesForPackageAnyPhone(String pkgName) {
6294:     public List<String> getCarrierPackageNamesForIntentAndPhone(Intent intent, int phoneId) {
6750:     public boolean isWorldPhone(int subId, String callingPackage, String callingFeatureId) {
317:     private PhoneConfigurationManager mPhoneConfigurationManager;
1839:     private Phone getPhoneFromRequest(MainThreadRequest request) {
1847:     private Phone getPhoneFromSubId(int subId) {
2278:     private void shutdownRadioUsingPhoneId(int phoneId) {
2935:     public int getActivePhoneType() {
2940:     public int getActivePhoneTypeForSlot(int slotIndex) {
3979:     private void checkModifyPhoneStatePermission(int subId, String message) {
4618:     private Phone getPhoneFromSlotIdOrThrowException(int slotIndex) {
6338:     public List<String> getPackagesWithCarrierPrivilegesForAllPhones() {
6876:     public int getSubIdForPhoneAccount(PhoneAccount phoneAccount) {
6886:     public int getSubIdForPhoneAccountHandle(
6901:     public @Nullable PhoneAccountHandle getPhoneAccountHandleForSubscriptionId(int subscriptionId) {
21: import static com.android.internal.telephony.PhoneConstants.PHONE_TYPE_IMS;
142: import com.android.internal.telephony.Phone;
177: import com.android.phone.settings.PickSmsSubscriptionActivity;
178: import com.android.phone.vvm.PhoneAccountHandleConverter;
179: import com.android.phone.vvm.RemoteVvmTaskManager;
180: import com.android.phone.vvm.VisualVoicemailSettingsUtil;
181: import com.android.phone.vvm.VisualVoicemailSmsFilterConfig;
392:         // In cases where subId is unavailable, the caller needs to specify the phone.
401:         MainThreadRequest(Object argument, Phone phone, WorkSource workSource) {
403:             if (phone != null) {
404:                 this.phone = phone;
432:      * A handler that processes messages on the main thread in the phone process. Since many
433:      * of the Phone calls are not thread safe this is needed to shuttle the requests from the
434:      * inbound binder threads to the main thread in the phone process.  The Binder thread
451:             final Phone defaultPhone = getDefaultPhone();
456:                     final Phone phone = getPhoneFromRequest(request);
475:                         request.result = phone != null
476:                                 ? phone.handleUssdRequest(ussdRequest, wrappedCallback) : false;
487:                     final Phone phone = getPhoneFromRequest(request);
488:                     request.result = phone != null ?
765:                     Phone phone = getPhoneFromRequest(request);
766:                     if (phone != null) {
767:                         phone.isNrDualConnectivityEnabled(onCompleted, request.workSource);
769:                         loge("isNRDualConnectivityEnabled: No phone object");
804:                     Phone phone = getPhoneFromRequest(request);
805:                     if (phone != null) {
806:                         phone.setNrDualConnectivityState((int) request.argument, onCompleted,
809:                         loge("enableNrDualConnectivity: No phone object");
932:                     request.phone.getCallForwardingOption(callForwardingReason, onCompleted);
994:                     request.phone.setCallForwardingOption(
1419:                     request.phone.requestCellInfoUpdate(request.workSource, onCompleted);
1433:                     request.phone.requestCellInfoUpdate(request.workSource,
1461:                     Phone phone = getPhoneFromRequest(request);
1462:                     phone.getCellIdentity(ws, obtainMessage(EVENT_GET_CELL_LOCATION_DONE, request));
1470:                         phone = getPhoneFromRequest(request);
1471:                         request.result = (phone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA)
1493:                             .enablePhone(request.phone, enable, onCompleted);
1499:                     int phoneId = request.phone.getPhoneId();
1514:                             .getPhoneStatusFromModem(request.phone, onCompleted);
1519:                     int id = request.phone.getPhoneId();
1542:                     request.phone.setSystemSelectionChannels(args.first, onCompleted);
1722:     private Object sendRequest(int command, Object argument, Phone phone, WorkSource workSource) {
1724:                 command, argument, SubscriptionManager.INVALID_SUBSCRIPTION_ID, phone, workSource);
1733:             int command, Object argument, Integer subId, Phone phone, WorkSource workSource) {
1739:         if (subId != SubscriptionManager.INVALID_SUBSCRIPTION_ID && phone != null) {
1740:             throw new IllegalArgumentException("subId and phone cannot both be specified!");
1741:         } else if (phone != null) {
1742:             request = new MainThreadRequest(argument, phone, workSource);
1782:      * Same as {@link #sendRequestAsync(int,Object)} except it takes a Phone and WorkSource.
1786:             int command, Object argument, Phone phone, WorkSource workSource) {
1787:         MainThreadRequest request = new MainThreadRequest(argument, phone, workSource);
1826:         Phone thePhone = getPhone(getDefaultSubscription());
1840:         if (request.phone != null) {
1841:             return request.phone;
1853:         Phone phone = getPhoneFromRequest(request);
1854:         return phone == null ? null :
1855:                 UiccController.getInstance().getUiccCard(phone.getPhoneId());
1858:     // returns phone associated with the subId.
1863:     private void sendEraseModemConfig(Phone phone) {
1864:         if (phone != null) {
1866:                   mApp, phone.getSubId(), "eraseModemConfig");
1904:             // PENDING: should we just silently fail if phone is offhook or ringing?
1925:         // from the context of the phone app.
1928:         if (mAppOps.noteOp(AppOpsManager.OPSTR_CALL_PHONE, Binder.getCallingUid(), callingPackage)
2146:             final Phone phone = getPhone(getDefaultSubscription());
2147:             if (phone != null) {
2148:                 phone.updateServiceLocation(workSource);
2193:             final Phone phone = getPhone(subId);
2194:             if (phone != null) {
2195:                 return phone.getServiceState().getState() != ServiceState.STATE_POWER_OFF;
2213:             final Phone phone = getPhone(subId);
2214:             if (phone != null) {
2215:                 phone.setRadioPower(!isRadioOnForSubscriber(subId));
2231:             final Phone phone = getPhone(subId);
2232:             if (phone == null) {
2235:             if ((phone.getServiceState().getState() != ServiceState.STATE_POWER_OFF) != turnOn) {
2253:                 Phone phone = PhoneFactory.getPhone(i);
2254:                 if (phone != null && phone.isRadioAvailable()) return true;
2270:                 logv("Shutting down Phone " + i);
2279:         Phone phone = PhoneFactory.getPhone(phoneId);
2280:         if (phone != null && phone.isRadioAvailable()) {
2281:             phone.shutdownRadio();
2290:             final Phone defaultPhone = PhoneFactory.getDefaultPhone();
2295:                 loge("There's no default phone.");
2308:             final Phone phone = getPhone(subId);
2309:             if (phone != null) {
2310:                 phone.setRadioPower(turnOn);
2328:             final Phone phone = getPhone(subId);
2329:             if (phone != null) {
2330:                 phone.getDataEnabledSettings().setDataEnabled(
2349:             final Phone phone = getPhone(subId);
2350:             if (phone != null) {
2351:                 phone.getDataEnabledSettings().setDataEnabled(
2366:             final Phone phone = getPhone(subId);
2367:             if (phone != null) {
2368:                 return phone.isDataAllowed(ApnSetting.TYPE_DEFAULT);
2417:             Phone phone = PhoneFactory.getPhone(slotIndex);
2418:             return phone == null ? TelephonyManager.CALL_STATE_IDLE :
2419:                     PhoneConstantConversions.convertCallState(phone.getState());
2434:             final Phone phone = getPhone(subId);
2435:             if (phone != null) {
2436:                 return PhoneConstantConversions.convertDataState(phone.getDataConnectionState());
2455:             final Phone phone = getPhone(subId);
2456:             if (phone != null) {
2457:                 return DefaultPhoneNotifier.convertDataActivityState(phone.getDataActivityState());
2486:                 return (getDefaultPhone().getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA)
2507:             if (phoneId == SubscriptionManager.INVALID_PHONE_INDEX) {
2508:                 // Get default phone in this case.
2509:                 phoneId = SubscriptionManager.DEFAULT_PHONE_INDEX;
2512:             Phone phone = PhoneFactory.getPhone(phoneId);
2513:             if (phone == null) return "";
2514:             ServiceStateTracker sst = phone.getServiceStateTracker();
2519:             EmergencyNumberTracker ent = phone.getEmergencyNumberTracker();
2604:         for (Phone phone : PhoneFactory.getPhones()) {
2605:             List<CellInfo> info = phone.getAllCellInfo();
2644:             for (Phone phone : PhoneFactory.getPhones()) {
2646:                         CMD_GET_ALL_CELL_INFO, null, phone, workSource);
2706:         final Phone phone = getPhoneFromSubId(subId);
2707:         if (phone == null) throw new IllegalArgumentException("Invalid Subscription Id: " + subId);
2709:         sendRequestAsync(CMD_REQUEST_CELL_INFO_UPDATE, cb, phone, workSource);
2727:         Phone phone = PhoneFactory.getPhone(slotIndex);
2728:         if (phone == null) {
2731:         int subId = phone.getSubId();
2739:             return phone.getImei();
2747:         Phone phone = PhoneFactory.getPhone(slotIndex);
2749:         if (phone != null) {
2750:             String imei = phone.getImei();
2758:         Phone phone = PhoneFactory.getPhone(slotIndex);
2759:         if (phone == null) {
2763:         int subId = phone.getSubId();
2771:             return phone.getMeid();
2779:         Phone phone = PhoneFactory.getPhone(slotIndex);
2781:         if (phone != null) {
2782:             String meid = phone.getMeid();
2791:         Phone phone = PhoneFactory.getPhone(slotIndex);
2792:         if (phone == null) {
2795:         int subId = phone.getSubId();
2804:             return phone.getDeviceSvn();
2814:             final Phone phone = getPhone(subId);
2815:             return phone == null ? TelephonyManager.UNKNOWN_CARRIER_ID : phone.getCarrierId();
2825:             final Phone phone = getPhone(subId);
2826:             return phone == null ? null : phone.getCarrierName();
2836:             final Phone phone = getPhone(subId);
2837:             return phone == null ? TelephonyManager.UNKNOWN_CARRIER_ID
2838:                     : phone.getSpecificCarrierId();
2848:             final Phone phone = getPhone(subId);
2849:             return phone == null ? null : phone.getSpecificCarrierName();
2860:         final Phone phone = PhoneFactory.getPhone(slotIndex);
2861:         if (phone == null) {
2866:             return CarrierResolver.getCarrierIdFromMccMnc(phone.getContext(), mccmnc);
2877:      * Make sure the caller has the MODIFY_PHONE_STATE permission.
2882:         mApp.enforceCallingOrSelfPermission(android.Manifest.permission.MODIFY_PHONE_STATE, null);
2902:      * Make sure the caller has the CALL_PHONE permission.
2907:         mApp.enforceCallingOrSelfPermission(android.Manifest.permission.CALL_PHONE, null);
2943:             final Phone phone = PhoneFactory.getPhone(slotIndex);
2944:             if (phone == null) {
2945:                 return PhoneConstants.PHONE_TYPE_NONE;
2947:                 return phone.getPhoneType();
2974:             final Phone phone = getPhone(subId);
2975:             if (phone != null) {
2976:                 return phone.getCdmaEriIconIndex();
3007:             final Phone phone = getPhone(subId);
3008:             if (phone != null) {
3009:                 return phone.getCdmaEriIconMode();
3038:             final Phone phone = getPhone(subId);
3039:             if (phone != null) {
3040:                 return phone.getCdmaEriText();
3059:             final Phone phone = getPhone(subId);
3060:             if (phone != null && phone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA) {
3061:                 return phone.getLine1Number();
3063:                 loge("getCdmaMdn: no phone found. Invalid subId: " + subId);
3081:             final Phone phone = getPhone(subId);
3082:             if (phone != null && phone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA) {
3083:                 return phone.getCdmaMin();
3095:         if (mApp.checkCallingOrSelfPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
3097:             throw new SecurityException("Caller must hold the MODIFY_PHONE_STATE permission");
3261:             final Phone phone = getPhone(subId);
3262:             if (phone != null) {
3263:                 phone.setVoiceActivationState(activationState);
3282:             final Phone phone = getPhone(subId);
3283:             if (phone != null) {
3284:                 phone.setDataActivationState(activationState);
3300:         final Phone phone = getPhone(subId);
3303:             if (phone != null) {
3304:                 return phone.getVoiceActivationState();
3320:         final Phone phone = getPhone(subId);
3323:             if (phone != null) {
3324:                 return phone.getDataActivationState();
3346:             final Phone phone = getPhone(subId);
3347:             if (phone != null) {
3348:                 return phone.getVoiceMessageCount();
3365:             final Phone phone = getPhone(subId);
3366:             return (phone == null ? false : phone.isConcurrentVoiceAndDataAllowed());
3379:         final Phone defaultPhone = getDefaultPhone();
3417:             for (Phone phone : PhoneFactory.getPhones()) {
3418:                 if (phone.isInEmergencySmsMode()) {
3429:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3456:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3494:             Phone phone = getPhone(subId);
3495:             if (phone == null) {
3500:             phone.getImsRegistrationState(regState -> {
3527:             Phone phone = getPhone(subId);
3528:             if (phone == null) {
3533:             phone.getImsRegistrationTech(regTech -> {
3552:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3578:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3629:             Phone phone = getPhone(subId);
3630:             if (phone == null) return false;
3631:             return phone.isImsCapabilityAvailable(capability, regTech);
3679:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3716:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3750:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3785:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3837:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3919:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3986:         Phone phone = getPhone(subId);
3987:         if (phone == null) {
3988:             loge("phone instance null for subid " + subId);
3992:             if (!doesImsCapabilityRequireProvisioning(phone.getContext(), subId, capability)) {
3996:             if (!doesRcsCapabilityRequireProvisioning(phone.getContext(), subId, capability)) {
4430:             final Phone phone = getPhone(subId);
4431:             if (phone != null) {
4432:                 return phone.getServiceState().getDataNetworkType();
4464:             final Phone phone = getPhone(subId);
4465:             if (phone != null) {
4466:                 return phone.getServiceState().getDataNetworkType();
4489:             final Phone phone = getPhone(subId);
4490:             if (phone != null) {
4491:                 return phone.getServiceState().getVoiceNetworkType();
4516:             final Phone phone = PhoneFactory.getPhone(slotIndex);
4517:             if (phone != null) {
4518:                 return phone.getIccCard().hasIccCard();
4533:      * @return {@link Phone#LTE_ON_CDMA_UNKNOWN}, {@link Phone#LTE_ON_CDMA_FALSE}
4534:      * or {@link Phone#LTE_ON_CDMA_TRUE}
4553:             final Phone phone = getPhone(subId);
4554:             if (phone == null) {
4622:                     + " does not correspond to an active phone");
4653:     private IccOpenLogicalChannelResponse iccOpenLogicalChannelWithPermission(Phone phone,
4670:                     CMD_OPEN_CHANNEL, new Pair<String, Integer>(aid, p2), phone,
4695:     private boolean iccCloseLogicalChannelWithPermission(Phone phone, int channel) {
4701:             Boolean success = (Boolean) sendRequest(CMD_CLOSE_CHANNEL, channel, phone,
4738:     private String iccTransmitApduLogicalChannelWithPermission(Phone phone, int channel, int cla,
4747:                     new IccAPDUArgument(channel, cla, command, p1, p2, p3, data), phone,
4794:     private String iccTransmitApduBasicChannelWithPermission(Phone phone, String callingPackage,
4812:                     new IccAPDUArgument(0, cla, command, p1, p2, p3, data), phone,
5046:         Phone phone = PhoneFactory.getPhone(slotIndex);
5047:         if (phone != null) {
5049:                     mApp, phone.getSubId(), "resetModemConfig");
5072:         Phone phone = PhoneFactory.getPhone(slotIndex);
5073:         if (phone != null) {
5075:                     mApp, phone.getSubId(), "rebootModem");
5091:         final Phone defaultPhone = getDefaultPhone();
5423:             final Phone phone = getPhone(subId);
5424:             if (phone == null) {
5427:             OperatorInfo networkSelection = phone.getSavedNetworkSelection();
5429:                 ? phone.getManualNetworkSelectionPlmn() : networkSelection.getOperatorNumeric();
5484:             Phone phone = getPhone(subId);
5485:             if (phone == null) {
5515:             sendRequestAsync(CMD_GET_CALL_FORWARDING, argument, phone, null);
5536:             Phone phone = getPhone(subId);
5537:             if (phone == null) {
5550:             sendRequestAsync(CMD_SET_CALL_FORWARDING, arguments, phone, null);
5565:             Phone phone = getPhone(subId);
5566:             if (phone == null) {
5578:             sendRequestAsync(CMD_GET_CALL_WAITING, argument, phone, null);
5594:             Phone phone = getPhone(subId);
5595:             if (phone == null) {
5607:             sendRequestAsync(CMD_SET_CALL_WAITING, arguments, phone, null);
5714:         final Phone defaultPhone = getDefaultPhone();
5974:         final Phone phone = getPhone(subId);
5976:             if (phone != null) {
5977:                 return phone.hasMatchedTetherApnSetting();
5997:         final Phone phone = getPhone(subId);
5999:             if (phone != null) {
6004:                 phone.setAlwaysReportSignalStrength(isEnable);
6006:                 loge("setAlwaysReportSignalStrength: no phone found for subId="
6035:      * Accepts either ACCESS_NETWORK_STATE, MODIFY_PHONE_STATE or carrier privileges.
6053:             Phone phone = PhoneFactory.getPhone(phoneId);
6054:             if (phone != null) {
6055:                 boolean retVal = phone.isUserDataEnabled();
6059:                 if (DBG) loge("isUserDataEnabled: no phone subId=" + subId + " retVal=false");
6082:                 mApp.enforceCallingOrSelfPermission(android.Manifest.permission.READ_PHONE_STATE,
6093:             Phone phone = PhoneFactory.getPhone(phoneId);
6094:             if (phone != null) {
6095:                 boolean retVal = phone.getDataEnabledSettings().isDataEnabled();
6099:                 if (DBG) loge("isDataEnabled: no phone subId=" + subId + " retVal=false");
6120:             mApp.enforceCallingOrSelfPermission(android.Manifest.permission.READ_PHONE_STATE,
6132:             Phone phone = PhoneFactory.getPhone(phoneId);
6133:             if (phone != null) {
6136:                     retVal = phone.isUserDataEnabled();
6138:                     retVal = phone.getDataEnabledSettings().isDataEnabledForReason(reason);
6144:                     loge("isDataEnabledForReason: no phone subId="
6155:             Phone phone) {
6156:         if (uid == Process.SYSTEM_UID || uid == Process.PHONE_UID) {
6166:         PackageManager pkgMgr = phone.getContext().getPackageManager();
6171:             int subId = phone.getSubId();
6179:                     phone.getContext().getSystemService(Context.TELEPHONY_SUBSCRIPTION_SERVICE);
6191:     private int getCarrierPrivilegeStatusFromCarrierConfigRules(int privilegeFromSim, Phone phone,
6200:             int subId = phone.getSubId();
6208:                     phone.getContext().getSystemService(Context.TELEPHONY_SUBSCRIPTION_SERVICE);
6218:         final Phone phone = getPhone(subId);
6219:         if (phone == null) {
6223:         UiccCard card = UiccController.getInstance().getUiccCard(phone.getPhoneId());
6231:                 phone.getContext().getPackageManager()), Binder.getCallingUid(), phone);
6237:         final Phone phone = getPhone(subId);
6238:         if (phone == null) {
6243:                 UiccController.getInstance().getUiccProfileForPhone(phone.getPhoneId());
6250:                         phone.getContext().getPackageManager(), uid), uid, phone);
6355:         final Phone phone = getPhone(subId);
6356:         UiccCard card = phone == null ? null : phone.getUiccCard();
6376:             final Phone phone = getPhone(subId);
6377:             if (phone == null) {
6380:             final String subscriberId = phone.getSubscriberId();
6603:             final Phone phone = getPhone(subId);
6604:             return phone == null ? false : phone.setOperatorBrandOverride(brand);
6619:             final Phone phone = getPhone(subId);
6620:             if (phone == null) {
6623:             return phone.setRoamingOverride(gsmRoamingList, gsmNonRoamingList, cdmaRoamingList,
6674:         Phone phone = PhoneFactory.getPhone(phoneId);
6676:         if (phone == null) {
6683:                             mApp, phone.getSubId(), "getRadioAccessFamily");
6693:         final Phone defaultPhone = getDefaultPhone();
6707:         final Phone defaultPhone = getDefaultPhone();
6761:                     .getBoolean(CarrierConfigManager.KEY_WORLD_PHONE_BOOL);
6792:         final Phone phone = getPhone(subscriptionId);
6793:         if (phone == null) {
6794:             loge("isRttSupported: no Phone found. Invalid subId:" + subscriptionId);
6801:                     phone.getContext().getResources().getBoolean(R.bool.config_support_rtt);
6834:      * Returns the unique device ID of phone, for example, the IMEI for
6838:      *   {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
6842:         final Phone phone = PhoneFactory.getPhone(0);
6843:         if (phone == null) {
6846:         int subId = phone.getSubId();
6854:             return phone.getDeviceId();
6867:         Phone phone = getPhone(subId);
6868:         if (phone != null) {
6869:             return phone.isImsRegistered();
6890:             throw new SecurityException("Requires READ_PHONE_STATE permission.");
6906:             Phone phone = getPhone(subscriptionId);
6907:             if (phone == null) {
6910:             return PhoneUtils.makePstnPhoneAccountHandle(phone);
6922:             Phone phone = getPhone(subId);
6923:             if (phone != null) {
6924:                 return phone.isWifiCallingEnabled();
6939:             Phone phone = getPhone(subId);
6940:             if (phone != null) {
6941:                 return phone.isVideoEnabled();
6957:             Phone phone = getPhone(subId);
6958:             if (phone != null) {
6959:                 return phone.getImsRegistrationTech();
7018:         final Phone phone = getPhone(subId);
7019:         if (phone == null) {
7026:                     phone.getContext().getOpPackageName(), phone.getContext().getAttributionTag());
7035:             final Locale localeFromDefaultSim = phone.getLocaleFromSimAndCarrierPrefs();
7163:             final Phone phone = getPhone(subId);
7164:             if (phone == null) {
7168:             ServiceState ss = phone.getServiceState();
7181:      * Returns the URI for the per-account voicemail ringtone set in Phone settings.
7192:             Phone phone = PhoneUtils.getPhoneForPhoneAccountHandle(accountHandle);
7193:             if (phone == null) {
7194:                 phone = getDefaultPhone();
7197:             return VoicemailNotificationSettingsUtil.getRingtoneUri(phone.getContext());
7207:      * has permission {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}.
7217:         final Phone defaultPhone = getDefaultPhone();
7228:             Phone phone = PhoneUtils.getPhoneForPhoneAccountHandle(phoneAccountHandle);
7229:             if (phone == null) {
7230:                 phone = defaultPhone;
7232:             VoicemailNotificationSettingsUtil.setRingtoneUri(phone.getContext(), uri);
7239:      * Returns whether vibration is set for voicemail notification in Phone settings.
7249:             Phone phone = PhoneUtils.getPhoneForPhoneAccountHandle(accountHandle);
7250:             if (phone == null) {
7251:                 phone = getDefaultPhone();
7254:             return VoicemailNotificationSettingsUtil.isVibrationEnabled(phone.getContext());
7264:      * has permission {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}.
7274:         final Phone defaultPhone = getDefaultPhone();
7285:             Phone phone = PhoneUtils.getPhoneForPhoneAccountHandle(phoneAccountHandle);
7286:             if (phone == null) {
7287:                 phone = defaultPhone;
7289:             VoicemailNotificationSettingsUtil.setVibrationEnabled(phone.getContext(), enabled);
7296:      * Make sure either called from same process as self (phone) or IPC caller has read privilege.
7301:         mApp.enforceCallingOrSelfPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE,
7306:      * Make sure either called from same process as self (phone) or IPC caller has send SMS
7349:         Phone phone = getPhone(subId);
7353:             if (phone == null) {
7358:                 aid = UiccController.getInstance().getUiccCard(phone.getPhoneId())
7378:         Phone phone = getPhone(subId);
7382:             if (phone == null) {
7387:                 esn = phone.getEsn();
7406:         Phone phone = getPhone(subId);
7410:             if (phone == null) {
7415:                 cdmaPrlVersion = phone.getCdmaPrlVersion();
7509:         final Phone phone = getPhone(subId);
7512:         if (phone == null) {
7517:             phone.carrierActionSetRadioEnabled(enabled);
7537:         final Phone phone = getPhone(subId);
7540:         if (phone == null) {
7545:             phone.carrierActionReportDefaultNetworkStatus(report);
7561:         final Phone phone = getPhone(subId);
7562:         if (phone == null) {
7567:             phone.carrierActionResetAll();
7574:      * Called when "adb shell dumpsys phone" is invoked. Dump is also automatically invoked when a
7581:             writer.println("Permission Denial: can't dump Phone from pid="
7624:             Phone phone = getPhone(subId);
7625:             if (phone != null) {
7627:                     phone.carrierActionSetMeteredApnsEnabled(enabled);
7629:                     phone.getDataEnabledSettings().setDataEnabled(reason, enabled);
7649:         Phone phone = getPhone(subId);
7653:             if (phone != null) {
7654:                 return phone.getClientRequestStats();
7681:         Phone phone = PhoneFactory.getPhone(slotIndex);
7687:             if (phone != null) {
7688:                 phone.setSimPowerState(state, workSource);
7710:      * Check if phone is in emergency callback mode
7711:      * @return true if phone is in emergency callback mode
7717:         final Phone phone = getPhone(subId);
7721:             if (phone != null) {
7722:                 return phone.isInEcm();
7742:             Phone p = getPhone(subId);
7762:         Phone phone = PhoneFactory.getPhone(slotIndex);
7763:         if (phone != null) {
7764:             if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp, phone.getSubId(),
7771:                 return phone.getRadioPowerState();
7784:      * {@link android.Manifest.permission#READ_PHONE_STATE} or that the calling app has carrier
7804:             Phone phone = getPhone(subId);
7805:             isEnabled =  phone != null ? phone.getDataRoamingEnabled() : false;
7817:      * {@link android.Manifest.permission#MODIFY_PHONE_STATE} or that the calling app has carrier
7830:             Phone phone = getPhone(subId);
7831:             if (phone != null) {
7832:                 phone.setDataRoamingEnabled(isEnabled);
7848:             Phone phone = getPhone(subId);
7849:             if (phone != null) {
7850:                 isAllowed = phone.isCspPlmnEnabled();
7869:             // even without READ_PRIVILEGED_PHONE_STATE, we allow the call to continue if the caller
8006:      * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}.
8015:             Phone phone = getPhone(subId);
8016:             if (phone == null) {
8019:             UiccCard uiccCard = phone.getUiccCard();
8056:      * not set, return {@link Phone#PREFERRED_NT_MODE}.
8064:         return Phone.PREFERRED_NT_MODE;
8074:             final Phone phone = getPhone(subId);
8075:             if (phone == null) {
8079:             phone.setCarrierTestOverride(mccmnc, imsi, iccid, gid1, gid2, plmn, spn,
8097:             final Phone phone = getPhone(subId);
8098:             if (phone == null) {
8102:             return phone.getCarrierIdListVersion();
8185:             throw new SecurityException("Requires READ_PHONE_STATE permission.");
8190:             for (Phone phone: PhoneFactory.getPhones()) {
8191:                 if (phone.getEmergencyNumberTracker() != null
8192:                         && phone.getEmergencyNumberTracker().getEmergencyNumberList() != null) {
8194:                             phone.getSubId(),
8195:                             phone.getEmergencyNumberTracker().getEmergencyNumberList());
8206:         final Phone defaultPhone = getDefaultPhone();
8214:             for (Phone phone: PhoneFactory.getPhones()) {
8215:                 if (phone.getEmergencyNumberTracker() != null
8216:                         && phone.getEmergencyNumberTracker()
8237:             for (Phone phone: PhoneFactory.getPhones()) {
8238:                 EmergencyNumberTracker tracker = phone.getEmergencyNumberTracker();
8259:             for (Phone phone: PhoneFactory.getPhones()) {
8260:                 EmergencyNumberTracker tracker = phone.getEmergencyNumberTracker();
8279:             final Phone phone = getPhone(subId);
8280:             if (phone == null) {
8284:             return phone.getEmergencyNumberDbVersion();
8296:             for (Phone phone: PhoneFactory.getPhones()) {
8297:                 EmergencyNumberTracker tracker = phone.getEmergencyNumberTracker();
8313:             for (Phone phone: PhoneFactory.getPhones()) {
8314:                 EmergencyNumberTracker tracker = phone.getEmergencyNumberTracker();
8330:             for (Phone phone: PhoneFactory.getPhones()) {
8331:                 EmergencyNumberTracker tracker = phone.getEmergencyNumberTracker();
8344:         Phone phone = getPhone(subId);
8345:         if (phone == null) {
8351:                     .getUiccProfileForPhone(phone.getPhoneId());
8370:             Phone phone = PhoneFactory.getPhone(slotIndex);
8371:             if (phone == null) {
8374:                 return (Boolean) sendRequest(CMD_REQUEST_ENABLE_MODEM, enable, phone, null);
8387:         Phone phone = PhoneFactory.getPhone(slotIndex);
8388:         if (phone == null) return false;
8391:                 mApp, phone.getSubId(), callingPackage, callingFeatureId,
8393:             throw new SecurityException("Requires READ_PHONE_STATE permission.");
8399:                 return mPhoneConfigurationManager.getPhoneStatusFromCache(phone.getPhoneId());
8401:                 return (Boolean) sendRequest(CMD_GET_MODEM_STATUS, null, phone, null);
8469:      * Note: Switch from multi-sim to single-sim is only possible with MODIFY_PHONE_STATE
8470:      * permission, but the other way around is possible with either MODIFY_PHONE_STATE
8499:         Phone phone = getPhone(subId);
8500:         if (phone == null) {
8505:             UiccCard uiccCard = phone.getUiccCard();
8575:         Phone phone = getDefaultPhone();
8576:         if (phone == null) return -1;
8577:         HalVersion hv = phone.getHalVersion();
8607:         enforceReadPrivilegedPermission("Needs READ_PRIVILEGED_PHONE_STATE for "
8613:             Phone phone = getPhone(subId);
8614:             if (phone == null) return false;
8616:             boolean isMetered = ApnSettingUtils.isMeteredApnType(apnType, phone);
8617:             return !isMetered || phone.getDataEnabledSettings().isDataEnabled(apnType);
8630:             Phone phone = getPhone(subId);
8631:             if (phone == null) return true; // By default return true.
8633:             return ApnSettingUtils.isMeteredApnType(apnType, phone);
8645:             Phone phone = getPhone(subscriptionId);
8646:             if (phone == null) {
8666:             sendRequestAsync(CMD_SET_SYSTEM_SELECTION_CHANNELS, argument, phone, null);
8746:             Phone phone = getPhone(subscriptionId);
8747:             if (phone == null) return false;
8751:                     return phone.getDataEnabledSettings().isDataAllowedInVoiceCall();
8753:                     return phone.getDataEnabledSettings().isMmsAlwaysAllowed();
8769:             Phone phone = getPhone(subscriptionId);
8770:             if (phone == null) return;
8774:                     phone.getDataEnabledSettings().setAllowDataDuringVoiceCall(enabled);
8777:                     phone.getDataEnabledSettings().setAlwaysAllowMmsData(enabled);
8799:             for (Phone phone : PhoneFactory.getPhones()) {
8800:                 Phone defaultPhone = phone.getImsPhone();
8801:                 if (defaultPhone != null && defaultPhone.getPhoneType() == PHONE_TYPE_IMS) {
8846:             Phone phone = getPhone(subId);
8847:             if (phone != null && phone.getIccCard() != null) {
8848:                 return phone.getIccCard().getIccLockEnabled();
8872:         Phone phone = getPhone(subId);
8873:         if (phone == null) {
8880:                     new Pair<Boolean, String>(enabled, password), phone, null);
8904:         Phone phone = getPhone(subId);
8905:         if (phone == null) {
8912:                     new Pair<String, String>(oldPassword, newPassword), phone, null);
8971:             throw new SecurityException("Requires READ_PHONE_STATE permission.");
8974:         Phone phone = getPhone(subId);
8975:         if (phone == null) {
8976:             throw new RuntimeException("phone is not available");
8981:             return phone.getEquivalentHomePlmns();
22: import static com.android.internal.telephony.PhoneConstants.SUBSCRIPTION_KEY;
63: import android.telecom.PhoneAccount;
64: import android.telecom.PhoneAccountHandle;
84: import android.telephony.PhoneCapability;
85: 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;
160: import com.android.internal.telephony.imsphone.ImsPhone;
161: import com.android.internal.telephony.imsphone.ImsPhoneCallTracker;
202:     private static final String LOG_TAG = "PhoneInterfaceManager";
203:     private static final boolean DBG = (PhoneGlobals.DBG_LEVEL >= 2);
307:     private static PhoneInterfaceManager sInstance;
309:     private PhoneGlobals mApp;
706:                     defaultPhone.nvReadItem((Integer) request.argument, onCompleted,
733:                     defaultPhone.nvWriteItem(idValue.first, idValue.second, onCompleted,
744:                     defaultPhone.nvWriteCdmaPrl((byte[]) request.argument, onCompleted);
754:                     defaultPhone.resetModemConfig(onCompleted);
886:                     defaultPhone.invokeOemRilRequestRaw((byte[]) request.argument, onCompleted);
1168:                     if (defaultPhone != null) {
1169:                         defaultPhone.getModemActivityInfo(onCompleted, request.workSource);
1232:                     defaultPhone.setAllowedCarriers(argument, onCompleted, request.workSource);
1260:                     defaultPhone.getAllowedCarriers(onCompleted, request.workSource);
1482:                     defaultPhone.rebootModem(onCompleted);
1492:                     PhoneConfigurationManager.getInstance()
1502:                         mPhoneConfigurationManager.addToPhoneStatusCache(phoneId, msg.arg1 == 1);
1513:                     PhoneConfigurationManager.getInstance()
1601:                     defaultPhone.eraseModemConfig(onCompleted);
1647:                     getDefaultPhone().getContext().sendBroadcastAsUser(
1793:      * Initialize the singleton PhoneInterfaceManager instance.
1794:      * This is only done once, at startup, from PhoneApp.onCreate().
1796:     /* package */ static PhoneInterfaceManager init(PhoneGlobals app) {
1797:         synchronized (PhoneInterfaceManager.class) {
1799:                 sInstance = new PhoneInterfaceManager(app);
1810:         mCM = PhoneGlobals.getInstance().mCM;
1811:         mImsResolver = PhoneGlobals.getInstance().getImsResolver();
1819:         mPhoneConfigurationManager = PhoneConfigurationManager.getInstance();
1827:         return (thePhone != null) ? thePhone : PhoneFactory.getDefaultPhone();
1849:                 ? getDefaultPhone() : getPhone(subId);
1860:         return PhoneFactory.getPhone(mSubscriptionController.getPhoneId(subId));
1878:         PackageManager pm = getDefaultPhone().getContext().getPackageManager();
1905:             PhoneConstants.State state = mCM.getState(subId);
1906:             if (state != PhoneConstants.State.OFFHOOK && state != PhoneConstants.State.RINGING) {
1965:         return (resultArray[0] == PhoneConstants.PIN_RESULT_SUCCESS) ? true : false;
1970:         return (resultArray[0] == PhoneConstants.PIN_RESULT_SUCCESS) ? true : false;
1978:             final UnlockSim checkSimPin = new UnlockSim(getPhone(subId).getIccCard());
1991:             final UnlockSim checkSimPuk = new UnlockSim(getPhone(subId).getIccCard());
2008:         private int mResult = PhoneConstants.PIN_GENERAL_FAILURE;
2038:                                             mResult = PhoneConstants.PIN_PASSWORD_INCORRECT;
2043:                                             mResult = PhoneConstants.PIN_OPERATION_ABORTED;
2045:                                             mResult = PhoneConstants.PIN_GENERAL_FAILURE;
2048:                                         mResult = PhoneConstants.PIN_RESULT_SUCCESS;
2256:             logv(TelephonyManager.getDefault().getPhoneCount() + " Phones are shutdown.");
2291:             if (defaultPhone != null) {
2292:                 defaultPhone.setRadioPower(turnOn);
2438:                 return PhoneConstantConversions.convertDataState(
2439:                         PhoneConstants.DataState.DISCONNECTED);
2511:             final int subId = mSubscriptionController.getSubIdUsingPhoneId(phoneId);
2719:             getDefaultPhone().setCellInfoListRate(rateInMillis, workSource);
2923:         Log.d(LOG_TAG, "[PhoneIntfMgr] " + msg);
2927:         Log.v(LOG_TAG, "[PhoneIntfMgr] " + msg);
2931:         Log.e(LOG_TAG, "[PhoneIntfMgr] " + msg);
3093:     public void requestNumberVerification(PhoneNumberRange range, long timeoutMillis,
3122:             return getDefaultPhone().needsOtaServiceProvisioning();
3157:             PhoneAccountHandle phoneAccountHandle = PhoneAccountHandleConverter.fromSubId(subId);
3158:             if (phoneAccountHandle == null) {
3161:             return VisualVoicemailSettingsUtil.dump(mApp, phoneAccountHandle);
3246:         SmsController smsController = PhoneFactory.getSmsController();
3381:         TelecomManager tm = defaultPhone.getContext().getSystemService(TelecomManager.class);
3390:             defaultPhone.sendDialerSpecialCode(inputCode);
3445:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3469:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone.
3565:         // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3592:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone.
3608:         // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3687:         // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3705:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3725:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3740:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3759:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3775:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3794:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3810:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3826:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3846:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3862:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3877:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3893:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3909:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3928:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3947:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3965:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
4010:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
4040:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
4073:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
4132:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
4301:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
4326:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
4352:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
4378:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
4548:             return PhoneConstants.LTE_ON_CDMA_UNKNOWN;
4555:                 return PhoneConstants.LTE_ON_CDMA_UNKNOWN;
4558:                         .orElse(PhoneConstants.LTE_ON_CDMA_FALSE);
4619:         int phoneId = UiccController.getInstance().getPhoneIdFromSlotId(slotIndex);
4620:         if (phoneId == -1) {
4624:         return PhoneFactory.getPhone(phoneId);
4659:                 ComponentInfo bestComponent = EuiccConnector.findBestComponent(getDefaultPhone()
4801:                 ComponentInfo bestComponent = EuiccConnector.findBestComponent(getDefaultPhone()
5092:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp, defaultPhone.getSubId(),
5099:             return defaultPhone.getPcscfAddress(apnType);
5343:             getDefaultPhone().setImsRegistrationState(registered);
5654:                     request, messenger, binder, getPhone(subId),
5715:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp, defaultPhone.getSubId(),
5723:             return PhoneFactory.calculatePreferredNetworkType(defaultPhone.getContext(), 0);
6051:             int phoneId = mSubscriptionController.getPhoneId(subId);
6052:             if (DBG) log("isUserDataEnabled: subId=" + subId + " phoneId=" + phoneId);
6091:             int phoneId = mSubscriptionController.getPhoneId(subId);
6092:             if (DBG) log("isDataEnabled: subId=" + subId + " phoneId=" + phoneId);
6127:             int phoneId = mSubscriptionController.getPhoneId(subId);
6129:                 log("isDataEnabledForReason: subId=" + subId + " phoneId=" + phoneId
6259:         int phoneId = SubscriptionManager.getPhoneId(subId);
6260:         UiccCard card = UiccController.getInstance().getUiccCard(phoneId);
6267:             getPhone(phoneId), pkgName);
6284:                 getPhone(i), pkgName);
6295:         if (!SubscriptionManager.isValidPhoneId(phoneId)) {
6296:             loge("phoneId " + phoneId + " is not valid.");
6299:         UiccCard card = UiccController.getInstance().getUiccCard(phoneId);
6301:             loge("getCarrierPackageNamesForIntentAndPhone: No UICC");
6308:     public List<String> getPackagesWithCarrierPrivileges(int phoneId) {
6312:         UiccCard card = UiccController.getInstance().getUiccCard(phoneId);
6673:     public int getRadioAccessFamily(int phoneId, String callingPackage) {
6684:             raf = ProxyController.getInstance().getRadioAccessFamily(phoneId);
6698:             ImsManager.getInstance(defaultPhone.getContext(),
6699:                     defaultPhone.getPhoneId()).setVtSetting(enable);
6708:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp, defaultPhone.getSubId(),
6720:                     ImsManager.getInstance(defaultPhone.getContext(), defaultPhone.getPhoneId());
6835:      * GSM and the MEID for CDMA phones. Return null if device ID is not available.
6879:             return PhoneUtils.getSubIdForPhoneAccount(phoneAccount);
6887:             PhoneAccountHandle phoneAccountHandle, String callingPackage, String callingFeatureId) {
6894:             return PhoneUtils.getSubIdForPhoneAccountHandle(phoneAccountHandle);
6991:             cleanUpSmsRawTable(getDefaultPhone().getContext());
7002:               sendEraseModemConfig(getDefaultPhone());
7183:      * @param accountHandle The handle for the {@link PhoneAccount} for which to retrieve the
7186:      * PhoneAccount.
7189:     public Uri getVoicemailRingtoneUri(PhoneAccountHandle accountHandle) {
7209:      * @param phoneAccountHandle The handle for the {@link PhoneAccount} for which to set the
7212:      * PhoneAccount.
7216:             PhoneAccountHandle phoneAccountHandle, Uri uri) {
7219:         TelecomManager tm = defaultPhone.getContext().getSystemService(TelecomManager.class);
7222:                     mApp, PhoneUtils.getSubIdForPhoneAccountHandle(phoneAccountHandle),
7241:      * @param accountHandle The handle for the {@link PhoneAccount} for which to retrieve the
7243:      * @return {@code true} if the vibration is set for this PhoneAccount, {@code false} otherwise.
7246:     public boolean isVoicemailVibrationEnabled(PhoneAccountHandle accountHandle) {
7266:      * @param phoneAccountHandle The handle for the {@link PhoneAccount} for which to set the
7269:      * specific PhoneAccount.
7273:             PhoneAccountHandle phoneAccountHandle, boolean enabled) {
7276:         TelecomManager tm = defaultPhone.getContext().getSystemService(TelecomManager.class);
7279:                     mApp, PhoneUtils.getSubIdForPhoneAccountHandle(phoneAccountHandle),
7595:         return new TelephonyShellCommand(this, getDefaultPhone().getContext()).exec(
7871:             if (checkCarrierPrivilegesForPackageAnyPhone(callingPackage)
8060:         int phoneId = mSubscriptionController.getPhoneId(subId);
8061:         if (phoneId >= 0 && phoneId < list.size() && list.get(phoneId) != null) {
8062:             return list.get(phoneId);
8210:                             mApp, defaultPhone.getSubId(), "isEmergencyNumber(Potential)");
8426:                 getDefaultPhone().getSubId(), callingPackage, callingFeatureId,
8449:         PhoneCapability staticCapability =
8555:             int phoneCount = TelephonyManager.getDefault().getPhoneCount();
8557:             int[] logicalSlotsMapping = new int[phoneCount];
8690:         SmsPermissions permissions = new SmsPermissions(getDefaultPhone(), mApp,
8716:             return SubscriptionManager.getResourcesForSubId(getDefaultPhone().getContext(), subId)
8733:             return SubscriptionManager.getResourcesForSubId(getDefaultPhone().getContext(), subId)
8802:                     ImsPhone imsPhone = (ImsPhone) defaultPhone;
8804:                             (ImsPhoneCallTracker) imsPhone.getCallTracker();
8806:                     Rlog.i(LOG_TAG, "setCepEnabled isCepEnabled=" + isCepEnabled + ", for imsPhone "
8807:                             + imsPhone.getMsisdn());
8941:         // *  Inherited from PhoneWindowManager  *
131: import com.android.internal.telephony.DefaultPhoneNotifier;
489:                             getPhoneFromRequest(request).handlePinMmi((String) request.argument)
848:                     getPhoneFromRequest(request).getPreferredNetworkType(onCompleted);
876:                     getPhoneFromRequest(request).setPreferredNetworkType(networkType, onCompleted);
900:                     getPhoneFromRequest(request).setVoiceMailNumber(tagNum.first, tagNum.second,
912:                     getPhoneFromRequest(request).setNetworkSelectionModeAutomatic(onCompleted);
922:                     getPhoneFromRequest(request).getAvailableNetworks(onCompleted);
1035:                     getPhoneFromRequest(request).getCallWaiting(onCompleted);
1081:                     getPhoneFromRequest(request).setCallWaiting(enable, onCompleted);
1148:                     getPhoneFromRequest(request).selectNetworkManually(selArg.operatorInfo,
1343:                     getPhoneFromRequest(request).getNetworkSelectionMode(onCompleted);
1364:                     getPhoneFromRequest(request).queryCdmaRoamingPreference(onCompleted);
1380:                     getPhoneFromRequest(request).setCdmaRoamingPreference(mode, onCompleted);
1391:                     getPhoneFromRequest(request).queryCdmaSubscriptionMode(onCompleted);
1407:                     getPhoneFromRequest(request).setCdmaSubscriptionMode(
1523:                         mPhoneConfigurationManager.addToPhoneStatusCache(id,
1611:                     getPhoneFromRequest(request).getIccCard().changeIccLockPassword(
1629:                     getPhoneFromRequest(request).getIccCard().setIccLockEnabled(
1843:             return getPhoneFromSubId(request.subId);
2177:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
2252:             for (int i = 0; i < TelephonyManager.getDefault().getPhoneCount(); i++) {
2269:             for (int i = 0; i < TelephonyManager.getDefault().getPhoneCount(); i++) {
2271:                 shutdownRadioUsingPhoneId(i);
2796:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
2936:         return getActivePhoneTypeForSlot(getSlotForDefaultSubscription());
2966:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
2999:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
3030:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
3171:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
3339:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
3399:                     .enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3436:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3462:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3519:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3559:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3584:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3684:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3721:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3755:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3790:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3842:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3924:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
4006:         checkModifyPhoneStatePermission(subId, "setRcsProvisioningStatusForCapability");
4070:         checkModifyPhoneStatePermission(subId, "setImsProvisioningStatusForCapability");
4422:                 && !TelephonyPermissions.checkCallingOrSelfReadPhoneStateNoThrow(
4456:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
4481:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
4574:         return mSubscriptionController.getPhoneId(getDefaultSubscription());
4636:         return iccOpenLogicalChannelWithPermission(getPhoneFromSubId(subId), callingPackage, aid,
4649:         return iccOpenLogicalChannelWithPermission(getPhoneFromSlotIdOrThrowException(slotIndex),
4684:         return iccCloseLogicalChannelWithPermission(getPhoneFromSubId(subId), channel);
4691:         return iccCloseLogicalChannelWithPermission(getPhoneFromSlotIdOrThrowException(slotIndex),
4720:         return iccTransmitApduLogicalChannelWithPermission(getPhoneFromSubId(subId), channel, cla,
4734:                 getPhoneFromSlotIdOrThrowException(slotIndex), channel, cla, command, p1, p2, p3,
4773:         return iccTransmitApduBasicChannelWithPermission(getPhoneFromSubId(subId), callingPackage,
4789:                 getPhoneFromSlotIdOrThrowException(slotIndex), callingPackage, cla, command, p1,
4874:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
4912:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp, subId, callingPackage,
5286:                 .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
5414:                     .enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
5738:                 .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
5787:                 .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
5832:                 .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
5836:             return getPhoneFromSubId(subId).getAllowedNetworkTypes(reason);
5880:                 .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
5902:                 .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
5908:                     getPhoneFromSubId(subId).getCarrierBandwidth();
5927:                 .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
5931:             return getPhoneFromSubId(subId).getEffectiveAllowedNetworkTypes();
5953:             getPhoneFromSubId(subId).setAllowedNetworkTypes(reason, allowedNetworkTypes);
6275:         for (int i = 0; i < TelephonyManager.getDefault().getPhoneCount(); i++) {
6339:         enforceReadPrivilegedPermission("getPackagesWithCarrierPrivilegesForAllPhones");
6345:             for (int i = 0; i < TelephonyManager.getDefault().getPhoneCount(); i++) {
6423:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneNumber(
6450:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
6473:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
6682:                     .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
6732:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
6751:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
6888:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp, getDefaultSubscription(),
6889:                 callingPackage, callingFeatureId, "getSubIdForPhoneAccountHandle")) {
6902:         enforceReadPrivilegedPermission("getPhoneAccountHandleForSubscriptionId, "
7127:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
7645:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
7797:             TelephonyPermissions.enforeceCallingOrSelfReadPhoneStatePermissionOrCarrierPrivilege(
7842:                 .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
7970:                         slot.getPhoneId(),
8111:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
8119:             return mPhoneConfigurationManager.getNumberOfModemsWithSimultaneousDataConnections();
8128:                 .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
8155:                 .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
8182:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
8209:                     .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
8390:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
8425:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp,
8450:                 mPhoneConfigurationManager.getStaticPhoneCapability();
8490:             mPhoneConfigurationManager.switchMultiSimConfig(numOfSims);
8530:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
8537:             return mPhoneConfigurationManager.isRebootRequiredForModemConfigChange();
8546:         metrics.updateEnabledModemBitmap((1 << TelephonyManager.from(mApp).getPhoneCount()) - 1);
8560:                 if (SubscriptionManager.isValidPhoneId(slotInfos[i].getLogicalSlotIdx())) {
8676:                 SubscriptionManager.getPhoneId(subId), UiccController.APP_FAM_3GPP);
8803:                     ImsPhoneCallTracker imsPhoneCallTracker =
8805:                     imsPhoneCallTracker.setConferenceEventPackageEnabled(isCepEnabled);
8969:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
android.googlesource.com/platform/superproject:packages/services/Telephony/src/com/android/phone/PhoneInterfaceManager.java: [ master, ]
384:         public Phone phone;
17: package com.android.phone;
198: public class PhoneInterfaceManager extends ITelephony.Stub {
1655:     private PhoneInterfaceManager(PhoneGlobals app) {
1672:     private Phone getDefaultPhone() {
1706:     private Phone getPhone(int subId) {
2347:     public String getNetworkCountryIsoForPhone(int phoneId) {
5936:     public int checkCarrierPrivilegesForPackageAnyPhone(String pkgName) {
5959:     public List<String> getCarrierPackageNamesForIntentAndPhone(Intent intent, int phoneId) {
6417:     public boolean isWorldPhone(int subId, String callingPackage, String callingFeatureId) {
308:     private PhoneConfigurationManager mPhoneConfigurationManager;
1686:     private Phone getPhoneFromRequest(MainThreadRequest request) {
1694:     private Phone getPhoneFromSubId(int subId) {
2125:     private void shutdownRadioUsingPhoneId(int phoneId) {
2780:     public int getActivePhoneType() {
2785:     public int getActivePhoneTypeForSlot(int slotIndex) {
3824:     private void checkModifyPhoneStatePermission(int subId, String message) {
4463:     private Phone getPhoneFromSlotIdOrThrowException(int slotIndex) {
6003:     public List<String> getPackagesWithCarrierPrivilegesForAllPhones() {
6543:     public int getSubIdForPhoneAccount(PhoneAccount phoneAccount) {
6553:     public int getSubIdForPhoneAccountHandle(
6568:     public @Nullable PhoneAccountHandle getPhoneAccountHandleForSubscriptionId(int subscriptionId) {
21: import static com.android.internal.telephony.PhoneConstants.PHONE_TYPE_IMS;
140: import com.android.internal.telephony.Phone;
174: import com.android.phone.settings.PickSmsSubscriptionActivity;
175: import com.android.phone.vvm.PhoneAccountHandleConverter;
176: import com.android.phone.vvm.RemoteVvmTaskManager;
177: import com.android.phone.vvm.VisualVoicemailSettingsUtil;
178: import com.android.phone.vvm.VisualVoicemailSmsFilterConfig;
383:         // In cases where subId is unavailable, the caller needs to specify the phone.
392:         MainThreadRequest(Object argument, Phone phone, WorkSource workSource) {
394:             if (phone != null) {
395:                 this.phone = phone;
423:      * A handler that processes messages on the main thread in the phone process. Since many
424:      * of the Phone calls are not thread safe this is needed to shuttle the requests from the
425:      * inbound binder threads to the main thread in the phone process.  The Binder thread
442:             final Phone defaultPhone = getDefaultPhone();
447:                     final Phone phone = getPhoneFromRequest(request);
466:                         request.result = phone != null
467:                                 ? phone.handleUssdRequest(ussdRequest, wrappedCallback) : false;
478:                     final Phone phone = getPhoneFromRequest(request);
479:                     request.result = phone != null ?
1266:                     request.phone.requestCellInfoUpdate(request.workSource, onCompleted);
1280:                     request.phone.requestCellInfoUpdate(request.workSource,
1308:                     Phone phone = getPhoneFromRequest(request);
1309:                     phone.getCellIdentity(ws, obtainMessage(EVENT_GET_CELL_LOCATION_DONE, request));
1317:                         phone = getPhoneFromRequest(request);
1318:                         request.result = (phone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA)
1340:                             .enablePhone(request.phone, enable, onCompleted);
1346:                     int phoneId = request.phone.getPhoneId();
1361:                             .getPhoneStatusFromModem(request.phone, onCompleted);
1366:                     int id = request.phone.getPhoneId();
1389:                     request.phone.setSystemSelectionChannels(args.first, onCompleted);
1569:     private Object sendRequest(int command, Object argument, Phone phone, WorkSource workSource) {
1571:                 command, argument, SubscriptionManager.INVALID_SUBSCRIPTION_ID, phone, workSource);
1580:             int command, Object argument, Integer subId, Phone phone, WorkSource workSource) {
1586:         if (subId != SubscriptionManager.INVALID_SUBSCRIPTION_ID && phone != null) {
1587:             throw new IllegalArgumentException("subId and phone cannot both be specified!");
1588:         } else if (phone != null) {
1589:             request = new MainThreadRequest(argument, phone, workSource);
1629:      * Same as {@link #sendRequestAsync(int,Object)} except it takes a Phone and WorkSource.
1633:             int command, Object argument, Phone phone, WorkSource workSource) {
1634:         MainThreadRequest request = new MainThreadRequest(argument, phone, workSource);
1673:         Phone thePhone = getPhone(getDefaultSubscription());
1687:         if (request.phone != null) {
1688:             return request.phone;
1700:         Phone phone = getPhoneFromRequest(request);
1701:         return phone == null ? null :
1702:                 UiccController.getInstance().getUiccCard(phone.getPhoneId());
1705:     // returns phone associated with the subId.
1710:     private void sendEraseModemConfig(Phone phone) {
1711:         if (phone != null) {
1713:                   mApp, phone.getSubId(), "eraseModemConfig");
1751:             // PENDING: should we just silently fail if phone is offhook or ringing?
1772:         // from the context of the phone app.
1775:         if (mAppOps.noteOp(AppOpsManager.OPSTR_CALL_PHONE, Binder.getCallingUid(), callingPackage)
1993:             final Phone phone = getPhone(getDefaultSubscription());
1994:             if (phone != null) {
1995:                 phone.updateServiceLocation(workSource);
2040:             final Phone phone = getPhone(subId);
2041:             if (phone != null) {
2042:                 return phone.getServiceState().getState() != ServiceState.STATE_POWER_OFF;
2060:             final Phone phone = getPhone(subId);
2061:             if (phone != null) {
2062:                 phone.setRadioPower(!isRadioOnForSubscriber(subId));
2078:             final Phone phone = getPhone(subId);
2079:             if (phone == null) {
2082:             if ((phone.getServiceState().getState() != ServiceState.STATE_POWER_OFF) != turnOn) {
2100:                 Phone phone = PhoneFactory.getPhone(i);
2101:                 if (phone != null && phone.isRadioAvailable()) return true;
2117:                 logv("Shutting down Phone " + i);
2126:         Phone phone = PhoneFactory.getPhone(phoneId);
2127:         if (phone != null && phone.isRadioAvailable()) {
2128:             phone.shutdownRadio();
2137:             final Phone defaultPhone = PhoneFactory.getDefaultPhone();
2142:                 loge("There's no default phone.");
2155:             final Phone phone = getPhone(subId);
2156:             if (phone != null) {
2157:                 phone.setRadioPower(turnOn);
2175:             final Phone phone = getPhone(subId);
2176:             if (phone != null) {
2177:                 phone.getDataEnabledSettings().setUserDataEnabled(true);
2195:             final Phone phone = getPhone(subId);
2196:             if (phone != null) {
2197:                 phone.getDataEnabledSettings().setUserDataEnabled(false);
2211:             final Phone phone = getPhone(subId);
2212:             if (phone != null) {
2213:                 return phone.isDataAllowed(ApnSetting.TYPE_DEFAULT);
2262:             Phone phone = PhoneFactory.getPhone(slotIndex);
2263:             return phone == null ? TelephonyManager.CALL_STATE_IDLE :
2264:                     PhoneConstantConversions.convertCallState(phone.getState());
2279:             final Phone phone = getPhone(subId);
2280:             if (phone != null) {
2281:                 return PhoneConstantConversions.convertDataState(phone.getDataConnectionState());
2300:             final Phone phone = getPhone(subId);
2301:             if (phone != null) {
2302:                 return DefaultPhoneNotifier.convertDataActivityState(phone.getDataActivityState());
2331:                 return (getDefaultPhone().getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA)
2352:             if (phoneId == SubscriptionManager.INVALID_PHONE_INDEX) {
2353:                 // Get default phone in this case.
2354:                 phoneId = SubscriptionManager.DEFAULT_PHONE_INDEX;
2357:             Phone phone = PhoneFactory.getPhone(phoneId);
2358:             if (phone == null) return "";
2359:             ServiceStateTracker sst = phone.getServiceStateTracker();
2364:             EmergencyNumberTracker ent = phone.getEmergencyNumberTracker();
2449:         for (Phone phone : PhoneFactory.getPhones()) {
2450:             List<CellInfo> info = phone.getAllCellInfo();
2489:             for (Phone phone : PhoneFactory.getPhones()) {
2491:                         CMD_GET_ALL_CELL_INFO, null, phone, workSource);
2551:         final Phone phone = getPhoneFromSubId(subId);
2552:         if (phone == null) throw new IllegalArgumentException("Invalid Subscription Id: " + subId);
2554:         sendRequestAsync(CMD_REQUEST_CELL_INFO_UPDATE, cb, phone, workSource);
2572:         Phone phone = PhoneFactory.getPhone(slotIndex);
2573:         if (phone == null) {
2576:         int subId = phone.getSubId();
2584:             return phone.getImei();
2592:         Phone phone = PhoneFactory.getPhone(slotIndex);
2594:         if (phone != null) {
2595:             String imei = phone.getImei();
2603:         Phone phone = PhoneFactory.getPhone(slotIndex);
2604:         if (phone == null) {
2608:         int subId = phone.getSubId();
2616:             return phone.getMeid();
2624:         Phone phone = PhoneFactory.getPhone(slotIndex);
2626:         if (phone != null) {
2627:             String meid = phone.getMeid();
2636:         Phone phone = PhoneFactory.getPhone(slotIndex);
2637:         if (phone == null) {
2640:         int subId = phone.getSubId();
2649:             return phone.getDeviceSvn();
2659:             final Phone phone = getPhone(subId);
2660:             return phone == null ? TelephonyManager.UNKNOWN_CARRIER_ID : phone.getCarrierId();
2670:             final Phone phone = getPhone(subId);
2671:             return phone == null ? null : phone.getCarrierName();
2681:             final Phone phone = getPhone(subId);
2682:             return phone == null ? TelephonyManager.UNKNOWN_CARRIER_ID
2683:                     : phone.getSpecificCarrierId();
2693:             final Phone phone = getPhone(subId);
2694:             return phone == null ? null : phone.getSpecificCarrierName();
2705:         final Phone phone = PhoneFactory.getPhone(slotIndex);
2706:         if (phone == null) {
2711:             return CarrierResolver.getCarrierIdFromMccMnc(phone.getContext(), mccmnc);
2722:      * Make sure the caller has the MODIFY_PHONE_STATE permission.
2727:         mApp.enforceCallingOrSelfPermission(android.Manifest.permission.MODIFY_PHONE_STATE, null);
2747:      * Make sure the caller has the CALL_PHONE permission.
2752:         mApp.enforceCallingOrSelfPermission(android.Manifest.permission.CALL_PHONE, null);
2788:             final Phone phone = PhoneFactory.getPhone(slotIndex);
2789:             if (phone == null) {
2790:                 return PhoneConstants.PHONE_TYPE_NONE;
2792:                 return phone.getPhoneType();
2819:             final Phone phone = getPhone(subId);
2820:             if (phone != null) {
2821:                 return phone.getCdmaEriIconIndex();
2852:             final Phone phone = getPhone(subId);
2853:             if (phone != null) {
2854:                 return phone.getCdmaEriIconMode();
2883:             final Phone phone = getPhone(subId);
2884:             if (phone != null) {
2885:                 return phone.getCdmaEriText();
2904:             final Phone phone = getPhone(subId);
2905:             if (phone != null && phone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA) {
2906:                 return phone.getLine1Number();
2908:                 loge("getCdmaMdn: no phone found. Invalid subId: " + subId);
2926:             final Phone phone = getPhone(subId);
2927:             if (phone != null && phone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA) {
2928:                 return phone.getCdmaMin();
2940:         if (mApp.checkCallingOrSelfPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
2942:             throw new SecurityException("Caller must hold the MODIFY_PHONE_STATE permission");
3106:             final Phone phone = getPhone(subId);
3107:             if (phone != null) {
3108:                 phone.setVoiceActivationState(activationState);
3127:             final Phone phone = getPhone(subId);
3128:             if (phone != null) {
3129:                 phone.setDataActivationState(activationState);
3145:         final Phone phone = getPhone(subId);
3148:             if (phone != null) {
3149:                 return phone.getVoiceActivationState();
3165:         final Phone phone = getPhone(subId);
3168:             if (phone != null) {
3169:                 return phone.getDataActivationState();
3191:             final Phone phone = getPhone(subId);
3192:             if (phone != null) {
3193:                 return phone.getVoiceMessageCount();
3210:             final Phone phone = getPhone(subId);
3211:             return (phone == null ? false : phone.isConcurrentVoiceAndDataAllowed());
3224:         final Phone defaultPhone = getDefaultPhone();
3262:             for (Phone phone : PhoneFactory.getPhones()) {
3263:                 if (phone.isInEmergencySmsMode()) {
3274:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3301:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3339:             Phone phone = getPhone(subId);
3340:             if (phone == null) {
3345:             phone.getImsRegistrationState(regState -> {
3372:             Phone phone = getPhone(subId);
3373:             if (phone == null) {
3378:             phone.getImsRegistrationTech(regTech -> {
3397:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3423:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3474:             Phone phone = getPhone(subId);
3475:             if (phone == null) return false;
3476:             return phone.isImsCapabilityAvailable(capability, regTech);
3524:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3561:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3595:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3630:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3682:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3764:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3831:         Phone phone = getPhone(subId);
3832:         if (phone == null) {
3833:             loge("phone instance null for subid " + subId);
3837:             if (!doesImsCapabilityRequireProvisioning(phone.getContext(), subId, capability)) {
3841:             if (!doesRcsCapabilityRequireProvisioning(phone.getContext(), subId, capability)) {
4275:             final Phone phone = getPhone(subId);
4276:             if (phone != null) {
4277:                 return phone.getServiceState().getDataNetworkType();
4309:             final Phone phone = getPhone(subId);
4310:             if (phone != null) {
4311:                 return phone.getServiceState().getDataNetworkType();
4334:             final Phone phone = getPhone(subId);
4335:             if (phone != null) {
4336:                 return phone.getServiceState().getVoiceNetworkType();
4361:             final Phone phone = PhoneFactory.getPhone(slotIndex);
4362:             if (phone != null) {
4363:                 return phone.getIccCard().hasIccCard();
4378:      * @return {@link Phone#LTE_ON_CDMA_UNKNOWN}, {@link Phone#LTE_ON_CDMA_FALSE}
4379:      * or {@link Phone#LTE_ON_CDMA_TRUE}
4398:             final Phone phone = getPhone(subId);
4399:             if (phone == null) {
4467:                     + " does not correspond to an active phone");
4498:     private IccOpenLogicalChannelResponse iccOpenLogicalChannelWithPermission(Phone phone,
4515:                     CMD_OPEN_CHANNEL, new Pair<String, Integer>(aid, p2), phone,
4540:     private boolean iccCloseLogicalChannelWithPermission(Phone phone, int channel) {
4546:             Boolean success = (Boolean) sendRequest(CMD_CLOSE_CHANNEL, channel, phone,
4583:     private String iccTransmitApduLogicalChannelWithPermission(Phone phone, int channel, int cla,
4592:                     new IccAPDUArgument(channel, cla, command, p1, p2, p3, data), phone,
4639:     private String iccTransmitApduBasicChannelWithPermission(Phone phone, String callingPackage,
4657:                     new IccAPDUArgument(0, cla, command, p1, p2, p3, data), phone,
4891:         Phone phone = PhoneFactory.getPhone(slotIndex);
4892:         if (phone != null) {
4894:                     mApp, phone.getSubId(), "resetModemConfig");
4917:         Phone phone = PhoneFactory.getPhone(slotIndex);
4918:         if (phone != null) {
4920:                     mApp, phone.getSubId(), "rebootModem");
4936:         final Phone defaultPhone = getDefaultPhone();
5268:             final Phone phone = getPhone(subId);
5269:             if (phone == null) {
5272:             OperatorInfo networkSelection = phone.getSavedNetworkSelection();
5274:                 ? phone.getManualNetworkSelectionPlmn() : networkSelection.getOperatorNumeric();
5484:         final Phone defaultPhone = getDefaultPhone();
5670:         final Phone phone = getPhone(subId);
5672:             if (phone != null) {
5673:                 return phone.hasMatchedTetherApnSetting();
5697:             Phone phone = PhoneFactory.getPhone(phoneId);
5698:             if (phone != null) {
5700:                 phone.getDataEnabledSettings().setUserDataEnabled(enable);
5702:                 loge("setUserDataEnabled: no phone found. Invalid subId=" + subId);
5720:         final Phone phone = getPhone(subId);
5722:             if (phone != null) {
5727:                 phone.setAlwaysReportSignalStrength(isEnable);
5729:                 loge("setAlwaysReportSignalStrength: no phone found for subId="
5758:      * Accepts either ACCESS_NETWORK_STATE, MODIFY_PHONE_STATE or carrier privileges.
5776:             Phone phone = PhoneFactory.getPhone(phoneId);
5777:             if (phone != null) {
5778:                 boolean retVal = phone.isUserDataEnabled();
5782:                 if (DBG) loge("isUserDataEnabled: no phone subId=" + subId + " retVal=false");
5805:             Phone phone = PhoneFactory.getPhone(phoneId);
5806:             if (phone != null) {
5807:                 boolean retVal = phone.getDataEnabledSettings().isDataEnabled();
5811:                 if (DBG) loge("isDataEnabled: no phone subId=" + subId + " retVal=false");
5820:             Phone phone) {
5821:         if (uid == Process.SYSTEM_UID || uid == Process.PHONE_UID) {
5831:         PackageManager pkgMgr = phone.getContext().getPackageManager();
5836:             int subId = phone.getSubId();
5844:                     phone.getContext().getSystemService(Context.TELEPHONY_SUBSCRIPTION_SERVICE);
5856:     private int getCarrierPrivilegeStatusFromCarrierConfigRules(int privilegeFromSim, Phone phone,
5865:             int subId = phone.getSubId();
5873:                     phone.getContext().getSystemService(Context.TELEPHONY_SUBSCRIPTION_SERVICE);
5883:         final Phone phone = getPhone(subId);
5884:         if (phone == null) {
5888:         UiccCard card = UiccController.getInstance().getUiccCard(phone.getPhoneId());
5896:                 phone.getContext().getPackageManager()), Binder.getCallingUid(), phone);
5902:         final Phone phone = getPhone(subId);
5903:         if (phone == null) {
5908:                 UiccController.getInstance().getUiccProfileForPhone(phone.getPhoneId());
5915:                         phone.getContext().getPackageManager(), uid), uid, phone);
6020:         final Phone phone = getPhone(subId);
6021:         UiccCard card = phone == null ? null : phone.getUiccCard();
6043:             final Phone phone = getPhone(subId);
6044:             if (phone == null) {
6047:             final String subscriberId = phone.getSubscriberId();
6270:             final Phone phone = getPhone(subId);
6271:             return phone == null ? false : phone.setOperatorBrandOverride(brand);
6286:             final Phone phone = getPhone(subId);
6287:             if (phone == null) {
6290:             return phone.setRoamingOverride(gsmRoamingList, gsmNonRoamingList, cdmaRoamingList,
6341:         Phone phone = PhoneFactory.getPhone(phoneId);
6343:         if (phone == null) {
6350:                             mApp, phone.getSubId(), "getRadioAccessFamily");
6360:         final Phone defaultPhone = getDefaultPhone();
6374:         final Phone defaultPhone = getDefaultPhone();
6428:                     .getBoolean(CarrierConfigManager.KEY_WORLD_PHONE_BOOL);
6459:         final Phone phone = getPhone(subscriptionId);
6460:         if (phone == null) {
6461:             loge("isRttSupported: no Phone found. Invalid subId:" + subscriptionId);
6468:                     phone.getContext().getResources().getBoolean(R.bool.config_support_rtt);
6501:      * Returns the unique device ID of phone, for example, the IMEI for
6505:      *   {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
6509:         final Phone phone = PhoneFactory.getPhone(0);
6510:         if (phone == null) {
6513:         int subId = phone.getSubId();
6521:             return phone.getDeviceId();
6534:         Phone phone = getPhone(subId);
6535:         if (phone != null) {
6536:             return phone.isImsRegistered();
6557:             throw new SecurityException("Requires READ_PHONE_STATE permission.");
6573:             Phone phone = getPhone(subscriptionId);
6574:             if (phone == null) {
6577:             return PhoneUtils.makePstnPhoneAccountHandle(phone);
6589:             Phone phone = getPhone(subId);
6590:             if (phone != null) {
6591:                 return phone.isWifiCallingEnabled();
6606:             Phone phone = getPhone(subId);
6607:             if (phone != null) {
6608:                 return phone.isVideoEnabled();
6624:             Phone phone = getPhone(subId);
6625:             if (phone != null) {
6626:                 return phone.getImsRegistrationTech();
6684:         final Phone phone = getPhone(subId);
6685:         if (phone == null) {
6692:                     phone.getContext().getOpPackageName(), phone.getContext().getAttributionTag());
6701:             final Locale localeFromDefaultSim = phone.getLocaleFromSimAndCarrierPrefs();
6829:             final Phone phone = getPhone(subId);
6830:             if (phone == null) {
6834:             ServiceState ss = phone.getServiceState();
6847:      * Returns the URI for the per-account voicemail ringtone set in Phone settings.
6858:             Phone phone = PhoneUtils.getPhoneForPhoneAccountHandle(accountHandle);
6859:             if (phone == null) {
6860:                 phone = getDefaultPhone();
6863:             return VoicemailNotificationSettingsUtil.getRingtoneUri(phone.getContext());
6873:      * has permission {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}.
6883:         final Phone defaultPhone = getDefaultPhone();
6894:             Phone phone = PhoneUtils.getPhoneForPhoneAccountHandle(phoneAccountHandle);
6895:             if (phone == null) {
6896:                 phone = defaultPhone;
6898:             VoicemailNotificationSettingsUtil.setRingtoneUri(phone.getContext(), uri);
6905:      * Returns whether vibration is set for voicemail notification in Phone settings.
6915:             Phone phone = PhoneUtils.getPhoneForPhoneAccountHandle(accountHandle);
6916:             if (phone == null) {
6917:                 phone = getDefaultPhone();
6920:             return VoicemailNotificationSettingsUtil.isVibrationEnabled(phone.getContext());
6930:      * has permission {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}.
6940:         final Phone defaultPhone = getDefaultPhone();
6951:             Phone phone = PhoneUtils.getPhoneForPhoneAccountHandle(phoneAccountHandle);
6952:             if (phone == null) {
6953:                 phone = defaultPhone;
6955:             VoicemailNotificationSettingsUtil.setVibrationEnabled(phone.getContext(), enabled);
6962:      * Make sure either called from same process as self (phone) or IPC caller has read privilege.
6967:         mApp.enforceCallingOrSelfPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE,
6972:      * Make sure either called from same process as self (phone) or IPC caller has send SMS
7015:         Phone phone = getPhone(subId);
7019:             if (phone == null) {
7024:                 aid = UiccController.getInstance().getUiccCard(phone.getPhoneId())
7044:         Phone phone = getPhone(subId);
7048:             if (phone == null) {
7053:                 esn = phone.getEsn();
7072:         Phone phone = getPhone(subId);
7076:             if (phone == null) {
7081:                 cdmaPrlVersion = phone.getCdmaPrlVersion();
7175:         final Phone phone = getPhone(subId);
7178:         if (phone == null) {
7183:             phone.carrierActionSetMeteredApnsEnabled(enabled);
7200:         final Phone phone = getPhone(subId);
7203:         if (phone == null) {
7208:             phone.carrierActionSetRadioEnabled(enabled);
7228:         final Phone phone = getPhone(subId);
7231:         if (phone == null) {
7236:             phone.carrierActionReportDefaultNetworkStatus(report);
7252:         final Phone phone = getPhone(subId);
7253:         if (phone == null) {
7258:             phone.carrierActionResetAll();
7265:      * Called when "adb shell dumpsys phone" is invoked. Dump is also automatically invoked when a
7272:             writer.println("Permission Denial: can't dump Phone from pid="
7303:             Phone phone = getPhone(subId);
7304:             if (phone != null) {
7305:                 phone.getDataEnabledSettings().setPolicyDataEnabled(enabled);
7324:         Phone phone = getPhone(subId);
7328:             if (phone != null) {
7329:                 return phone.getClientRequestStats();
7356:         Phone phone = PhoneFactory.getPhone(slotIndex);
7362:             if (phone != null) {
7363:                 phone.setSimPowerState(state, workSource);
7385:      * Check if phone is in emergency callback mode
7386:      * @return true if phone is in emergency callback mode
7392:         final Phone phone = getPhone(subId);
7396:             if (phone != null) {
7397:                 return phone.isInEcm();
7417:             Phone p = getPhone(subId);
7437:         Phone phone = PhoneFactory.getPhone(slotIndex);
7438:         if (phone != null) {
7439:             if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp, phone.getSubId(),
7446:                 return phone.getRadioPowerState();
7459:      * {@link android.Manifest.permission#READ_PHONE_STATE} or that the calling app has carrier
7479:             Phone phone = getPhone(subId);
7480:             isEnabled =  phone != null ? phone.getDataRoamingEnabled() : false;
7492:      * {@link android.Manifest.permission#MODIFY_PHONE_STATE} or that the calling app has carrier
7505:             Phone phone = getPhone(subId);
7506:             if (phone != null) {
7507:                 phone.setDataRoamingEnabled(isEnabled);
7523:             Phone phone = getPhone(subId);
7524:             if (phone != null) {
7525:                 isAllowed = phone.isCspPlmnEnabled();
7544:             // even without READ_PRIVILEGED_PHONE_STATE, we allow the call to continue if the caller
7681:      * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}.
7690:             Phone phone = getPhone(subId);
7691:             if (phone == null) {
7694:             UiccCard uiccCard = phone.getUiccCard();
7731:      * not set, return {@link Phone#PREFERRED_NT_MODE}.
7739:         return Phone.PREFERRED_NT_MODE;
7749:             final Phone phone = getPhone(subId);
7750:             if (phone == null) {
7754:             phone.setCarrierTestOverride(mccmnc, imsi, iccid, gid1, gid2, plmn, spn,
7772:             final Phone phone = getPhone(subId);
7773:             if (phone == null) {
7777:             return phone.getCarrierIdListVersion();
7846:             throw new SecurityException("Requires READ_PHONE_STATE permission.");
7851:             for (Phone phone: PhoneFactory.getPhones()) {
7852:                 if (phone.getEmergencyNumberTracker() != null
7853:                         && phone.getEmergencyNumberTracker().getEmergencyNumberList() != null) {
7855:                             phone.getSubId(),
7856:                             phone.getEmergencyNumberTracker().getEmergencyNumberList());
7867:         final Phone defaultPhone = getDefaultPhone();
7875:             for (Phone phone: PhoneFactory.getPhones()) {
7876:                 if (phone.getEmergencyNumberTracker() != null
7877:                         && phone.getEmergencyNumberTracker()
7898:             for (Phone phone: PhoneFactory.getPhones()) {
7899:                 EmergencyNumberTracker tracker = phone.getEmergencyNumberTracker();
7920:             for (Phone phone: PhoneFactory.getPhones()) {
7921:                 EmergencyNumberTracker tracker = phone.getEmergencyNumberTracker();
7940:             final Phone phone = getPhone(subId);
7941:             if (phone == null) {
7945:             return phone.getEmergencyNumberDbVersion();
7957:             for (Phone phone: PhoneFactory.getPhones()) {
7958:                 EmergencyNumberTracker tracker = phone.getEmergencyNumberTracker();
7974:             for (Phone phone: PhoneFactory.getPhones()) {
7975:                 EmergencyNumberTracker tracker = phone.getEmergencyNumberTracker();
7991:             for (Phone phone: PhoneFactory.getPhones()) {
7992:                 EmergencyNumberTracker tracker = phone.getEmergencyNumberTracker();
8005:         Phone phone = getPhone(subId);
8006:         if (phone == null) {
8012:                     .getUiccProfileForPhone(phone.getPhoneId());
8031:             Phone phone = PhoneFactory.getPhone(slotIndex);
8032:             if (phone == null) {
8035:                 return (Boolean) sendRequest(CMD_REQUEST_ENABLE_MODEM, enable, phone, null);
8048:         Phone phone = PhoneFactory.getPhone(slotIndex);
8049:         if (phone == null) return false;
8052:                 mApp, phone.getSubId(), callingPackage, callingFeatureId,
8054:             throw new SecurityException("Requires READ_PHONE_STATE permission.");
8060:                 return mPhoneConfigurationManager.getPhoneStatusFromCache(phone.getPhoneId());
8062:                 return (Boolean) sendRequest(CMD_GET_MODEM_STATUS, null, phone, null);
8130:      * Note: Switch from multi-sim to single-sim is only possible with MODIFY_PHONE_STATE
8131:      * permission, but the other way around is possible with either MODIFY_PHONE_STATE
8160:         Phone phone = getPhone(subId);
8161:         if (phone == null) {
8166:             UiccCard uiccCard = phone.getUiccCard();
8236:         Phone phone = getDefaultPhone();
8237:         if (phone == null) return -1;
8238:         HalVersion hv = phone.getHalVersion();
8268:         enforceReadPrivilegedPermission("Needs READ_PRIVILEGED_PHONE_STATE for "
8274:             Phone phone = getPhone(subId);
8275:             if (phone == null) return false;
8277:             boolean isMetered = ApnSettingUtils.isMeteredApnType(apnType, phone);
8278:             return !isMetered || phone.getDataEnabledSettings().isDataEnabled(apnType);
8291:             Phone phone = getPhone(subId);
8292:             if (phone == null) return true; // By default return true.
8294:             return ApnSettingUtils.isMeteredApnType(apnType, phone);
8306:             Phone phone = getPhone(subscriptionId);
8307:             if (phone == null) {
8327:             sendRequestAsync(CMD_SET_SYSTEM_SELECTION_CHANNELS, argument, phone, null);
8408:             Phone phone = getPhone(subId);
8409:             if (phone == null) return false;
8411:             return phone.getDataEnabledSettings().setAllowDataDuringVoiceCall(allow);
8424:             Phone phone = getPhone(subId);
8425:             if (phone == null) return false;
8427:             return phone.getDataEnabledSettings().isDataAllowedInVoiceCall();
8440:             Phone phone = getPhone(subId);
8441:             if (phone == null) return false;
8443:             return phone.getDataEnabledSettings().setAlwaysAllowMmsData(alwaysAllow);
8461:             for (Phone phone : PhoneFactory.getPhones()) {
8462:                 Phone defaultPhone = phone.getImsPhone();
8463:                 if (defaultPhone != null && defaultPhone.getPhoneType() == PHONE_TYPE_IMS) {
8508:             Phone phone = getPhone(subId);
8509:             if (phone != null && phone.getIccCard() != null) {
8510:                 return phone.getIccCard().getIccLockEnabled();
8534:         Phone phone = getPhone(subId);
8535:         if (phone == null) {
8542:                     new Pair<Boolean, String>(enabled, password), phone, null);
8566:         Phone phone = getPhone(subId);
8567:         if (phone == null) {
8574:                     new Pair<String, String>(oldPassword, newPassword), phone, null);
8633:             throw new SecurityException("Requires READ_PHONE_STATE permission.");
8636:         Phone phone = getPhone(subId);
8637:         if (phone == null) {
8638:             throw new RuntimeException("phone is not available");
8643:             return phone.getEquivalentHomePlmns();
22: import static com.android.internal.telephony.PhoneConstants.SUBSCRIPTION_KEY;
63: import android.telecom.PhoneAccount;
64: import android.telecom.PhoneAccountHandle;
83: import android.telephony.PhoneCapability;
84: import android.telephony.PhoneNumberRange;
141: import com.android.internal.telephony.PhoneConfigurationManager;
142: import com.android.internal.telephony.PhoneConstantConversions;
143: import com.android.internal.telephony.PhoneConstants;
144: import com.android.internal.telephony.PhoneFactory;
158: import com.android.internal.telephony.imsphone.ImsPhone;
159: 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);
298:     private static PhoneInterfaceManager sInstance;
300:     private PhoneGlobals mApp;
697:                     defaultPhone.nvReadItem((Integer) request.argument, onCompleted,
724:                     defaultPhone.nvWriteItem(idValue.first, idValue.second, onCompleted,
735:                     defaultPhone.nvWriteCdmaPrl((byte[]) request.argument, onCompleted);
745:                     defaultPhone.resetModemConfig(onCompleted);
793:                     defaultPhone.invokeOemRilRequestRaw((byte[]) request.argument, onCompleted);
1031:                     if (defaultPhone != null) {
1032:                         defaultPhone.getModemActivityInfo(onCompleted, request.workSource);
1095:                     defaultPhone.setAllowedCarriers(argument, onCompleted, request.workSource);
1123:                     defaultPhone.getAllowedCarriers(onCompleted, request.workSource);
1329:                     defaultPhone.rebootModem(onCompleted);
1339:                     PhoneConfigurationManager.getInstance()
1349:                         mPhoneConfigurationManager.addToPhoneStatusCache(phoneId, msg.arg1 == 1);
1360:                     PhoneConfigurationManager.getInstance()
1448:                     defaultPhone.eraseModemConfig(onCompleted);
1494:                     getDefaultPhone().getContext().sendBroadcastAsUser(
1640:      * Initialize the singleton PhoneInterfaceManager instance.
1641:      * This is only done once, at startup, from PhoneApp.onCreate().
1643:     /* package */ static PhoneInterfaceManager init(PhoneGlobals app) {
1644:         synchronized (PhoneInterfaceManager.class) {
1646:                 sInstance = new PhoneInterfaceManager(app);
1657:         mCM = PhoneGlobals.getInstance().mCM;
1658:         mImsResolver = PhoneGlobals.getInstance().getImsResolver();
1666:         mPhoneConfigurationManager = PhoneConfigurationManager.getInstance();
1674:         return (thePhone != null) ? thePhone : PhoneFactory.getDefaultPhone();
1696:                 ? getDefaultPhone() : getPhone(subId);
1707:         return PhoneFactory.getPhone(mSubscriptionController.getPhoneId(subId));
1725:         PackageManager pm = getDefaultPhone().getContext().getPackageManager();
1752:             PhoneConstants.State state = mCM.getState(subId);
1753:             if (state != PhoneConstants.State.OFFHOOK && state != PhoneConstants.State.RINGING) {
1812:         return (resultArray[0] == PhoneConstants.PIN_RESULT_SUCCESS) ? true : false;
1817:         return (resultArray[0] == PhoneConstants.PIN_RESULT_SUCCESS) ? true : false;
1825:             final UnlockSim checkSimPin = new UnlockSim(getPhone(subId).getIccCard());
1838:             final UnlockSim checkSimPuk = new UnlockSim(getPhone(subId).getIccCard());
1855:         private int mResult = PhoneConstants.PIN_GENERAL_FAILURE;
1885:                                             mResult = PhoneConstants.PIN_PASSWORD_INCORRECT;
1890:                                             mResult = PhoneConstants.PIN_OPERATION_ABORTED;
1892:                                             mResult = PhoneConstants.PIN_GENERAL_FAILURE;
1895:                                         mResult = PhoneConstants.PIN_RESULT_SUCCESS;
2103:             logv(TelephonyManager.getDefault().getPhoneCount() + " Phones are shutdown.");
2138:             if (defaultPhone != null) {
2139:                 defaultPhone.setRadioPower(turnOn);
2283:                 return PhoneConstantConversions.convertDataState(
2284:                         PhoneConstants.DataState.DISCONNECTED);
2356:             final int subId = mSubscriptionController.getSubIdUsingPhoneId(phoneId);
2564:             getDefaultPhone().setCellInfoListRate(rateInMillis, workSource);
2768:         Log.d(LOG_TAG, "[PhoneIntfMgr] " + msg);
2772:         Log.v(LOG_TAG, "[PhoneIntfMgr] " + msg);
2776:         Log.e(LOG_TAG, "[PhoneIntfMgr] " + msg);
2938:     public void requestNumberVerification(PhoneNumberRange range, long timeoutMillis,
2967:             return getDefaultPhone().needsOtaServiceProvisioning();
3002:             PhoneAccountHandle phoneAccountHandle = PhoneAccountHandleConverter.fromSubId(subId);
3003:             if (phoneAccountHandle == null) {
3006:             return VisualVoicemailSettingsUtil.dump(mApp, phoneAccountHandle);
3091:         SmsController smsController = PhoneFactory.getSmsController();
3226:         TelecomManager tm = defaultPhone.getContext().getSystemService(TelecomManager.class);
3235:             defaultPhone.sendDialerSpecialCode(inputCode);
3290:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3314:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone.
3410:         // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3437:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone.
3453:         // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3532:         // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3550:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3570:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3585:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3604:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3620:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3639:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3655:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3671:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3691:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3707:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3722:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3738:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3754:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3773:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3792:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3810:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3855:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3885:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3918:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3977:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
4146:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
4171:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
4197:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
4223:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
4393:             return PhoneConstants.LTE_ON_CDMA_UNKNOWN;
4400:                 return PhoneConstants.LTE_ON_CDMA_UNKNOWN;
4403:                         .orElse(PhoneConstants.LTE_ON_CDMA_FALSE);
4464:         int phoneId = UiccController.getInstance().getPhoneIdFromSlotId(slotIndex);
4465:         if (phoneId == -1) {
4469:         return PhoneFactory.getPhone(phoneId);
4504:                 ComponentInfo bestComponent = EuiccConnector.findBestComponent(getDefaultPhone()
4646:                 ComponentInfo bestComponent = EuiccConnector.findBestComponent(getDefaultPhone()
4937:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp, defaultPhone.getSubId(),
4944:             return defaultPhone.getPcscfAddress(apnType);
5188:             getDefaultPhone().setImsRegistrationState(registered);
5424:                     request, messenger, binder, getPhone(subId),
5485:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp, defaultPhone.getSubId(),
5493:             return PhoneFactory.calculatePreferredNetworkType(defaultPhone.getContext(), 0);
5695:             int phoneId = mSubscriptionController.getPhoneId(subId);
5696:             if (DBG) log("setUserDataEnabled: subId=" + subId + " phoneId=" + phoneId);
5774:             int phoneId = mSubscriptionController.getPhoneId(subId);
5775:             if (DBG) log("isUserDataEnabled: subId=" + subId + " phoneId=" + phoneId);
5803:             int phoneId = mSubscriptionController.getPhoneId(subId);
5804:             if (DBG) log("isDataEnabled: subId=" + subId + " phoneId=" + phoneId);
5924:         int phoneId = SubscriptionManager.getPhoneId(subId);
5925:         UiccCard card = UiccController.getInstance().getUiccCard(phoneId);
5932:             getPhone(phoneId), pkgName);
5949:                 getPhone(i), pkgName);
5960:         if (!SubscriptionManager.isValidPhoneId(phoneId)) {
5961:             loge("phoneId " + phoneId + " is not valid.");
5964:         UiccCard card = UiccController.getInstance().getUiccCard(phoneId);
5966:             loge("getCarrierPackageNamesForIntentAndPhone: No UICC");
5973:     public List<String> getPackagesWithCarrierPrivileges(int phoneId) {
5977:         UiccCard card = UiccController.getInstance().getUiccCard(phoneId);
6340:     public int getRadioAccessFamily(int phoneId, String callingPackage) {
6351:             raf = ProxyController.getInstance().getRadioAccessFamily(phoneId);
6365:             ImsManager.getInstance(defaultPhone.getContext(),
6366:                     defaultPhone.getPhoneId()).setVtSetting(enable);
6375:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp, defaultPhone.getSubId(),
6387:                     ImsManager.getInstance(defaultPhone.getContext(), defaultPhone.getPhoneId());
6502:      * GSM and the MEID for CDMA phones. Return null if device ID is not available.
6546:             return PhoneUtils.getSubIdForPhoneAccount(phoneAccount);
6554:             PhoneAccountHandle phoneAccountHandle, String callingPackage, String callingFeatureId) {
6561:             return PhoneUtils.getSubIdForPhoneAccountHandle(phoneAccountHandle);
6657:             cleanUpSmsRawTable(getDefaultPhone().getContext());
6668:               sendEraseModemConfig(getDefaultPhone());
6849:      * @param accountHandle The handle for the {@link PhoneAccount} for which to retrieve the
6852:      * PhoneAccount.
6855:     public Uri getVoicemailRingtoneUri(PhoneAccountHandle accountHandle) {
6875:      * @param phoneAccountHandle The handle for the {@link PhoneAccount} for which to set the
6878:      * PhoneAccount.
6882:             PhoneAccountHandle phoneAccountHandle, Uri uri) {
6885:         TelecomManager tm = defaultPhone.getContext().getSystemService(TelecomManager.class);
6888:                     mApp, PhoneUtils.getSubIdForPhoneAccountHandle(phoneAccountHandle),
6907:      * @param accountHandle The handle for the {@link PhoneAccount} for which to retrieve the
6909:      * @return {@code true} if the vibration is set for this PhoneAccount, {@code false} otherwise.
6912:     public boolean isVoicemailVibrationEnabled(PhoneAccountHandle accountHandle) {
6932:      * @param phoneAccountHandle The handle for the {@link PhoneAccount} for which to set the
6935:      * specific PhoneAccount.
6939:             PhoneAccountHandle phoneAccountHandle, boolean enabled) {
6942:         TelecomManager tm = defaultPhone.getContext().getSystemService(TelecomManager.class);
6945:                     mApp, PhoneUtils.getSubIdForPhoneAccountHandle(phoneAccountHandle),
7286:         return new TelephonyShellCommand(this, getDefaultPhone().getContext()).exec(
7546:             if (checkCarrierPrivilegesForPackageAnyPhone(callingPackage)
7735:         int phoneId = mSubscriptionController.getPhoneId(subId);
7736:         if (phoneId >= 0 && phoneId < list.size() && list.get(phoneId) != null) {
7737:             return list.get(phoneId);
7871:                             mApp, defaultPhone.getSubId(), "isEmergencyNumber(Potential)");
8087:                 getDefaultPhone().getSubId(), callingPackage, callingFeatureId,
8110:         PhoneCapability staticCapability =
8216:             int phoneCount = TelephonyManager.getDefault().getPhoneCount();
8218:             int[] logicalSlotsMapping = new int[phoneCount];
8351:         SmsPermissions permissions = new SmsPermissions(getDefaultPhone(), mApp,
8377:             return SubscriptionManager.getResourcesForSubId(getDefaultPhone().getContext(), subId)
8394:             return SubscriptionManager.getResourcesForSubId(getDefaultPhone().getContext(), subId)
8464:                     ImsPhone imsPhone = (ImsPhone) defaultPhone;
8466:                             (ImsPhoneCallTracker) imsPhone.getCallTracker();
8468:                     Rlog.i(LOG_TAG, "setCepEnabled isCepEnabled=" + isCepEnabled + ", for imsPhone "
8469:                             + imsPhone.getMsisdn());
8603:         // *  Inherited from PhoneWindowManager  *
130: import com.android.internal.telephony.DefaultPhoneNotifier;
480:                             getPhoneFromRequest(request).handlePinMmi((String) request.argument)
755:                     getPhoneFromRequest(request).getPreferredNetworkType(onCompleted);
783:                     getPhoneFromRequest(request).setPreferredNetworkType(networkType, onCompleted);
807:                     getPhoneFromRequest(request).setVoiceMailNumber(tagNum.first, tagNum.second,
819:                     getPhoneFromRequest(request).setNetworkSelectionModeAutomatic(onCompleted);
829:                     getPhoneFromRequest(request).getAvailableNetworks(onCompleted);
836:                     getPhoneFromRequest(request).getCallForwardingOption(
893:                     getPhoneFromRequest(request).setCallForwardingOption(
915:                     getPhoneFromRequest(request).getCallWaiting(onCompleted);
959:                     getPhoneFromRequest(request).setCallWaiting(isEnable, onCompleted);
1011:                     getPhoneFromRequest(request).selectNetworkManually(selArg.operatorInfo,
1206:                     getPhoneFromRequest(request).getNetworkSelectionMode(onCompleted);
1227:                     getPhoneFromRequest(request).queryCdmaRoamingPreference(onCompleted);
1243:                     getPhoneFromRequest(request).setCdmaRoamingPreference(mode, onCompleted);
1255:                     getPhoneFromRequest(request).setCdmaSubscription(subscriptionMode, onCompleted);
1370:                         mPhoneConfigurationManager.addToPhoneStatusCache(id,
1458:                     getPhoneFromRequest(request).getIccCard().changeIccLockPassword(
1476:                     getPhoneFromRequest(request).getIccCard().setIccLockEnabled(
1690:             return getPhoneFromSubId(request.subId);
2024:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
2099:             for (int i = 0; i < TelephonyManager.getDefault().getPhoneCount(); i++) {
2116:             for (int i = 0; i < TelephonyManager.getDefault().getPhoneCount(); i++) {
2118:                 shutdownRadioUsingPhoneId(i);
2641:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
2781:         return getActivePhoneTypeForSlot(getSlotForDefaultSubscription());
2811:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
2844:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
2875:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
3016:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
3184:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
3244:                     .enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3281:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3307:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3364:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3404:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3429:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3529:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3566:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3600:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3635:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3687:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3769:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3851:         checkModifyPhoneStatePermission(subId, "setRcsProvisioningStatusForCapability");
3915:         checkModifyPhoneStatePermission(subId, "setImsProvisioningStatusForCapability");
4267:                 && !TelephonyPermissions.checkCallingOrSelfReadPhoneStateNoThrow(
4301:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
4326:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
4419:         return mSubscriptionController.getPhoneId(getDefaultSubscription());
4481:         return iccOpenLogicalChannelWithPermission(getPhoneFromSubId(subId), callingPackage, aid,
4494:         return iccOpenLogicalChannelWithPermission(getPhoneFromSlotIdOrThrowException(slotIndex),
4529:         return iccCloseLogicalChannelWithPermission(getPhoneFromSubId(subId), channel);
4536:         return iccCloseLogicalChannelWithPermission(getPhoneFromSlotIdOrThrowException(slotIndex),
4565:         return iccTransmitApduLogicalChannelWithPermission(getPhoneFromSubId(subId), channel, cla,
4579:                 getPhoneFromSlotIdOrThrowException(slotIndex), channel, cla, command, p1, p2, p3,
4618:         return iccTransmitApduBasicChannelWithPermission(getPhoneFromSubId(subId), callingPackage,
4634:                 getPhoneFromSlotIdOrThrowException(slotIndex), callingPackage, cla, command, p1,
4719:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
4757:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp, subId, callingPackage,
5131:                 .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
5259:                     .enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
5508:                 .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
5557:                 .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
5602:                 .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
5606:             return getPhoneFromSubId(subId).getAllowedNetworkTypes(reason);
5623:                 .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
5627:             return getPhoneFromSubId(subId).getEffectiveAllowedNetworkTypes();
5649:             getPhoneFromSubId(subId).setAllowedNetworkTypes(reason, allowedNetworkTypes);
5940:         for (int i = 0; i < TelephonyManager.getDefault().getPhoneCount(); i++) {
6004:         enforceReadPrivilegedPermission("getPackagesWithCarrierPrivilegesForAllPhones");
6010:             for (int i = 0; i < TelephonyManager.getDefault().getPhoneCount(); i++) {
6090:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneNumber(
6117:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
6140:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
6349:                     .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
6399:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
6418:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
6555:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp, getDefaultSubscription(),
6556:                 callingPackage, callingFeatureId, "getSubIdForPhoneAccountHandle")) {
6569:         enforceReadPrivilegedPermission("getPhoneAccountHandleForSubscriptionId, "
6793:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
7320:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
7472:             TelephonyPermissions.enforeceCallingOrSelfReadPhoneStatePermissionOrCarrierPrivilege(
7517:                 .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
7645:                         slot.getPhoneId(),
7786:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
7794:             return mPhoneConfigurationManager.getNumberOfModemsWithSimultaneousDataConnections();
7803:                 .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
7843:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
7870:                     .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
8051:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
8086:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp,
8111:                 mPhoneConfigurationManager.getStaticPhoneCapability();
8151:             mPhoneConfigurationManager.switchMultiSimConfig(numOfSims);
8191:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
8198:             return mPhoneConfigurationManager.isRebootRequiredForModemConfigChange();
8207:         metrics.updateEnabledModemBitmap((1 << TelephonyManager.from(mApp).getPhoneCount()) - 1);
8221:                 if (SubscriptionManager.isValidPhoneId(slotInfos[i].getLogicalSlotIdx())) {
8337:                 SubscriptionManager.getPhoneId(subId), UiccController.APP_FAM_3GPP);
8465:                     ImsPhoneCallTracker imsPhoneCallTracker =
8467:                     imsPhoneCallTracker.setConferenceEventPackageEnabled(isCepEnabled);
8631:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
android.googlesource.com/platform/frameworks/opt/telephony:src/java/com/android/internal/telephony/Phone.java: [ master, ]
121: public abstract class Phone extends Handler implements PhoneInternalInterface {
508:     protected Phone(String name, PhoneNotifier notifier, Context context, CommandsInterface ci,
525:     protected Phone(String name, PhoneNotifier notifier, Context context, CommandsInterface ci,
334:     protected Phone mImsPhone = null;
604:     public void createImsPhone() {
3660:     public Phone getImsPhone() {
4311:     public Phone getDefaultPhone() {
198:     protected static final int EVENT_UPDATE_PHONE_OBJECT            = 42;
300:     protected boolean mIsPhoneInEcmState = false;
331:     protected int mPhoneId;
448:     public String getPhoneName() {
452:     protected void setPhoneName(String name) {
1814:     public void updatePhoneObject(int voiceRadioTech) {
2782:     public abstract int getPhoneType();
3783:     public int getPhoneId() {
3791:     public int getVoicePhoneServiceState() {
111:  * A base implementation for the com.android.internal.telephony.Phone interface.
113:  * Note that implementations of Phone.java are expected to be used
122:     private static final String LOG_TAG = "Phone";
248:      * This method is invoked when the Phone exits Emergency Callback Mode.
298:     // Keep track of whether or not the phone is in Emergency Callback Mode for Phone and
443:      * Returns a string identifier for this phone interface for parties
444:      *  outside the phone app process.
499:      * Constructs a Phone in normal (non-unit test) mode.
510:         this(name, notifier, context, ci, unitTestMode, SubscriptionManager.DEFAULT_PHONE_INDEX,
515:      * Constructs a Phone in normal (non-unit test) mode.
523:      * @param phoneId the phone-id of this phone.
551:         * (i.e. voice) phone calls over the telephony network, and is allowed
578:         if (getPhoneType() == PhoneConstants.PHONE_TYPE_IMS) {
593:         if (getPhoneType() != PhoneConstants.PHONE_TYPE_SIP) {
605:         if (getPhoneType() == PhoneConstants.PHONE_TYPE_SIP) {
609:         synchronized(Phone.lockForRadioTechnologyChange) {
672:         // messages to be handled whether or not the phone is being destroyed
674:         // resources of the phone being destroyed
794:         Phone imsPhone = mImsPhone;
833:      * Gets the context for the phone, as set at initialization time.
889:      * Subclasses of Phone probably want to replace this with a
915:      * Subclasses of Phone probably want to replace this with a
939:      * Subclasses of Phone probably want to replace this with a
951:      * Notify the phone that an SMS has been sent. This will be used determine if the SMS was sent
965:      * Determine if the Phone has recently sent an emergency SMS and is still in the interval of
1006:     protected void migrateFrom(Phone from) {
1019:         // The emergency state of IMS phone will be cleared in ImsPhone#notifySrvccState after
1082:      *   Connection.getCall() == Phone.getRingingCall()
1102:      * Notifies when phone's video capabilities changes <p>
1107:      *  AsyncResult.result = true if phone supports video calling <p>
1246:      * Example: If Phone.dial is called with "*#31#", then the app will
1569:      * For unit tests; don't send notifications to "Phone"
1586:      * Subclasses of Phone probably want to replace this with a
1691:         // no need for regular phone
1695:      * Subclasses of Phone probably want to replace this with a
1706:      * If this is a simulated phone interface, returns a SimulatedRadioControl.
1720:      * the thread that originally obtained this Phone instance.
1725:                     "com.android.internal.telephony.Phone must be used from within one thread");
1774:      * If the phone has an active call and call waiting occurs,
1775:      * then the phone state is RINGING not OFFHOOK
1784:      * Retrieves the IccFileHandler of the Phone instance
1803:      * Retrieves the Handler of the Phone instance
1810:      * Update the phone object if the voice radio technology has changed
1818:     * Retrieves the ServiceStateTracker of the phone instance.
1826:      * Retrieves the EmergencyNumberTracker of the phone instance.
1848:      * Retrieves the DeviceStateMonitor of the phone instance.
1855:      * Retrieves the DisplayInfoController of the phone instance.
1903:      * Returns the ICC card interface for this phone, or null
1909:         //throw new Exception("getIccCard Shouldn't be called from Phone");
2106:         if (getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA) {
2386:      * - {@link com.android.internal.telephony.Phone#TTY_MODE_OFF}
2387:      * - {@link com.android.internal.telephony.Phone#TTY_MODE_FULL}
2388:      * - {@link com.android.internal.telephony.Phone#TTY_MODE_HCO}
2389:      * - {@link com.android.internal.telephony.Phone#TTY_MODE_VCO}
2400:      * - {@link com.android.internal.telephony.Phone#TTY_MODE_OFF}
2401:      * - {@link com.android.internal.telephony.Phone#TTY_MODE_FULL}
2402:      * - {@link com.android.internal.telephony.Phone#TTY_MODE_HCO}
2403:      * - {@link com.android.internal.telephony.Phone#TTY_MODE_VCO}
2687:     // This property is used to handle phone process crashes, and is the same for CDMA and IMS
2694:      * @return {@code true} if we are in emergency call back mode. This is a period where the phone
2714:      * @return true if this Phone is in an emergency call that caused emergency callback mode to be
2722:      * Set whether or not this Phone has an active emergency call that was placed during emergency
2778:      * Return a numerical identifier for the phone radio interface.
2779:      * @return PHONE_TYPE_XXX as defined above.
2792:     /** sets the voice mail count of the phone and notifies listeners. */
3481:      * Subclasses of Phone probably want to replace this with a
3499:      * Notify registrants if phone is video capable.
3613:         Rlog.e(LOG_TAG, "Error! This function should never be executed, inactive Phone.");
3626:      * Gets the Uicc card corresponding to this phone.
3627:      * @return the UiccCard object corresponding to the phone ID.
3657:      * Return an instance of a IMS phone
3780:      * Returns the phone id.
3792:         Phone imsPhone = mImsPhone;
3866:         Phone imsPhone = mImsPhone;
3885:         Phone imsPhone = mImsPhone;
3899:         Phone imsPhone = mImsPhone;
3914:         Phone imsPhone = mImsPhone;
3924:      * @return the IMS MmTel Registration technology for this Phone, defined in
3928:         Phone imsPhone = mImsPhone;
3938:      * Get the IMS MmTel Registration technology for this Phone, defined in
3942:         Phone imsPhone = mImsPhone;
3951:      * Asynchronously get the IMS MmTel Registration state for this Phone.
3954:         Phone imsPhone = mImsPhone;
4012:      *  Set phone radio capability
4014:      *  @param rc the phone radio capability defined in
4023:      *  Get phone radio access family
4043:      *  Get phone radio capability
4057:      *  @param rc the phone radio capability currently in effect for this phone.
4090:      * Registers the handler when phone radio  capability is changed.
4101:      * Unregister for notifications when phone radio type and access technology is changed.
4136:      * Determines if video calling is enabled for the phone.
4142:         Phone imsPhone = mImsPhone;
4266:     public static void checkWfcWifiOnlyModeBeforeDial(Phone imsPhone, int phoneId, Context context)
4306:      * This function returns the parent phone of the current phone. It is applicable
4307:      * only for IMS phone (function is overridden by ImsPhone). For others the phone
4345:      * none of the phone is in service, and one of them has the capability to make the emergency
4352:         for (Phone phone : PhoneFactory.getPhones()) {
4353:             if (phone != null) {
4354:                 ServiceState ss = phone.getServiceStateTracker().getServiceState();
4355:                 // One of the phone is in service, hence the device is not emergency call only.
4417:     /** Returns the {@link VoiceCallSessionStats} for this phone ID. */
4422:     /** Sets the {@link VoiceCallSessionStats} mock for this phone ID during unit testing. */
4448:         pw.println("Phone: subId=" + getSubId());
4623:         pw.println("Phone Local Log: ");
52: import android.telephony.PhoneStateListener;
81: import com.android.internal.telephony.imsphone.ImsPhoneCall;
115:  * originally called PhoneFactory to obtain the interface.
423:      * PhoneNotifier is an abstraction for all system-wide
428:     protected PhoneNotifier mNotifier;
457:      * Retrieves Nai for phones. Returns null if Nai is not set.
526:                     boolean unitTestMode, int phoneId,
528:         mPhoneId = phoneId;
567:          * By default old phones won't have the property set but do generate
601:      * Start setup of ImsPhone, which will start trying to connect to the ImsResolver. Will not be
610:             if (mImsPhone == null) {
611:                 mImsPhone = PhoneFactory.makeImsPhone(mNotifier, this);
612:                 CallManager.getInstance().registerPhone(mImsPhone);
613:                 mImsPhone.registerForSilentRedial(
688:                     PhoneConstants.State state = getState();
690:                             && ((state == PhoneConstants.State.RINGING) ||
691:                                     (state == PhoneConstants.State.IDLE))) {
702:                 if (getState() == PhoneConstants.State.RINGING) {
720:                         if (mImsPhone != null) {
722:                             mImsPhone.notifyRedialConnectionChanged(cn);
726:                         if (mImsPhone != null) {
727:                             mImsPhone.notifyRedialConnectionChanged(null);
801:                     if (imsPhone != null) {
802:                         conn = imsPhone.getHandoverConnection();
803:                         migrateFrom(imsPhone);
805:                         Rlog.d(LOG_TAG, "HANDOVER_STARTED: mImsPhone null");
810:                     if (imsPhone != null) {
811:                         imsPhone.notifySrvccState(srvccState);
813:                         Rlog.d(LOG_TAG, "HANDOVER_COMPLETED: mImsPhone null");
866:      * {@link PhoneConstants.State} which can be obtained using the {@link PhoneStateListener}
1036:             // Since CallManager has already registered with both CS and IMS phones,
1781:     public abstract PhoneConstants.State getState();
1979:      * Sets the minimum time in milli-seconds between {@link PhoneStateListener#onCellInfoChanged
1980:      * PhoneStateListener.onCellInfoChanged} will be invoked.
1995:      * available on this interface. Use PhoneStateNotifier or similar instead.
2101:      * available on this interface. Use PhoneStateNotifier or similar instead.
2152:      * interface. Use <code>PhoneStateNotifier</code> or an equivalent.
2617:     public PhoneConstants.DataState getDataConnectionState(String apnType) {
2618:         return PhoneConstants.DataState.DISCONNECTED;
2688:     // phones
2768:         if (mImsPhone != null) {
2769:             isPresent = isVideoCallOrConference(mImsPhone.getForegroundCall()) ||
2770:                     isVideoCallOrConference(mImsPhone.getBackgroundCall()) ||
2771:                     isVideoCallOrConference(mImsPhone.getRingingCall());
2913:      * Retrieves the MIN for CDMA phones.
2929:      *  Retrieves PRL Version for CDMA phones
3575:      * Retrieves the MSISDN from the UICC. For GSM/UMTS phones, this is equivalent to
3576:      * {@link #getLine1Number()}. For CDMA phones, {@link #getLine1Number()} returns
3577:      * the MDN, so this method is provided to return the MSISDN on CDMA/LTE phones.
3585:      * Retrieves the EF_PNN from the UICC For GSM/UMTS phones.
3594:      * {@link android.telephony.PhoneStateListener} instead.
3597:     public PhoneConstants.DataState getDataConnectionState() {
3598:         return getDataConnectionState(PhoneConstants.APN_TYPE_DEFAULT);
3612:         // This function should be overridden by class GsmCdmaPhone.
3661:         return mImsPhone;
3727:      * Return if UT capability of ImsPhone is enabled or not
3731:         if (mImsPhone != null) {
3732:             return mImsPhone.isUtEnabled();
3751:         // dialInternal shall be overriden by GsmCdmaPhone
3756:      * This function is for CSFB SS. GsmCdmaPhone overrides this function.
3788:      * Return the service state of mImsPhone if it is STATE_IN_SERVICE
3793:         if (imsPhone != null
3794:                 && imsPhone.getServiceState().getState() == ServiceState.STATE_IN_SERVICE) {
3868:         if (imsPhone != null) {
3869:             isImsRegistered = imsPhone.isImsRegistered();
3887:         if (imsPhone != null) {
3888:             isWifiCallingEnabled = imsPhone.isWifiCallingEnabled();
3901:         if (imsPhone != null) {
3902:             isAvailable = imsPhone.isImsCapabilityAvailable(capability, regTech);
3916:         if (imsPhone != null) {
3917:             isVolteEnabled = imsPhone.isVolteEnabled();
3930:         if (imsPhone != null) {
3931:             regTech = imsPhone.getImsRegistrationTech();
3943:         if (imsPhone != null) {
3944:             imsPhone.getImsRegistrationTech(callback);
3955:         if (imsPhone != null) {
3956:             imsPhone.getImsRegistrationState(callback);
4073:         int type = PhoneFactory.calculatePreferredNetworkType(mContext, getSubId());
4084:             int type = PhoneFactory.calculatePreferredNetworkType(mContext, getSubId());
4128:         if (mImsPhone == null) {
4132:         return mImsPhone.isImsAvailable();
4143:         if (imsPhone != null) {
4144:             return imsPhone.isVideoEnabled();
4268:         if (imsPhone == null || !imsPhone.isWifiCallingEnabled()) {
4269:             ImsManager imsManager = ImsManager.getInstance(context, phoneId);
4487:         if (mImsPhone != null) {
4489:                 mImsPhone.dump(fd, pw, args);
424:      * state change notification. DefaultPhoneNotifier is
501:      * @param notifier An instance of DefaultPhoneNotifier,
517:      * @param notifier An instance of DefaultPhoneNotifier,
2582:         // This function is added to send the notification to DefaultPhoneNotifier.
2699:         return mIsPhoneInEcmState;
2710:         mIsPhoneInEcmState = isInEcm;
2754:         if (call instanceof ImsPhoneCall) {
2755:             ImsPhoneCall imsPhoneCall = (ImsPhoneCall) call;
2756:             ImsCall imsCall = imsPhoneCall.getImsCall();
2810:                 mPhoneId, UiccController.APP_FAM_3GPP);
3551:      * A fucntion of type getPhoneProp(propType) where propType is an
3631:         return mUiccController.getUiccCard(mPhoneId);
3776:         return SubscriptionController.getInstance().getSubIdUsingPhoneId(mPhoneId);
3784:         return mPhoneId;
4115:         ImsManager imsManager = ImsManager.getInstance(mContext, mPhoneId);
4449:         pw.println(" mPhoneId=" + mPhoneId);
4476:         pw.println(" getPhoneName()=" + getPhoneName());
4477:         pw.println(" getPhoneType()=" + getPhoneType());
android.googlesource.com/platform/external/guice:examples/src/example/xml/Phone.java: [ master, ]
3: public class Phone {
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/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;
android.googlesource.com/platform/frameworks/proto_logging:stats/atoms.proto: [ master, ]
6708:         PHONE = 9;
139:         PhoneSignalStrengthChanged phone_signal_strength_changed =
200:         PhoneServiceStateChanged phone_service_state_changed = 94 [(module) = "framework"];
201:         PhoneStateChanged phone_state_changed = 95 [(module) = "framework"];
2818:         HARDWARE_FAILED_MICROPHONE = 1;
2988: message PhoneSignalStrengthChanged {
3000: message PhoneServiceStateChanged {
3012: message PhoneStateChanged {
1569:  *   frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1574:         // The keyguard is hidden when the phone is unlocked.
1576:         // The keyguard is shown when the phone is locked (screen turns off).
1590:  *   frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
2983:  * Logs phone signal strength changes.
2995:  * Logs when the phone state, sim state or signal strength changes
3007:  * Logs when the phone becomes on or off.
3070:                 statusbar/phone/NavigationBarView.java
3668:  *      frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
1737:     // For multi-sim phones, this distinguishes between the sim cards.
1759:     // For multi-sim phones, this distinguishes between the sim cards.
6493:  * time_in_state files not being present on some phones, have not been addressed. These should be
7927:  * Track how we arbitrate between microphone/input requests.
7942:  * Track how we arbitrate between microphone requests.
7957:  * Track how we arbitrate between microphone/input requests.
7972:  * Track how we arbitrate between microphone/input requests.
android.googlesource.com/platform/frameworks/base:cmds/statsd/src/atoms.proto: [ master, ] Duplicate result
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.