Found 22271 results in 3705 files, showing top 50 files (show more).
android.googlesource.com/platform/packages/services/Telephony:src/com/android/phone/PhoneInterfaceManager.java: [ master, ]
446:         public Phone phone;
17: package com.android.phone;
232: public class PhoneInterfaceManager extends ITelephony.Stub {
2165:     private PhoneInterfaceManager(PhoneGlobals app) {
2184:     private Phone getDefaultPhone() {
2218:     private Phone getPhone(int subId) {
2898:     public String getNetworkCountryIsoForPhone(int phoneId) {
6767:     public int checkCarrierPrivilegesForPackageAnyPhone(String pkgName) {
6791:     public List<String> getCarrierPackageNamesForIntentAndPhone(Intent intent, int phoneId) {
7385:     public boolean isWorldPhone(int subId, String callingPackage, String callingFeatureId) {
364:     private PhoneConfigurationManager mPhoneConfigurationManager;
2198:     private Phone getPhoneFromRequest(MainThreadRequest request) {
2206:     private Phone getPhoneFromSubId(int subId) {
2363:         private final int mPhoneId;
2642:     private void shutdownRadioUsingPhoneId(int phoneId) {
3348:     public int getActivePhoneType() {
3353:     public int getActivePhoneTypeForSlot(int slotIndex) {
4452:     private void checkModifyPhoneStatePermission(int subId, String message) {
5122:     private Phone getPhoneFromSlotIdOrThrowException(int slotIndex) {
6839:     public List<String> getPackagesWithCarrierPrivilegesForAllPhones() {
7511:     public int getSubIdForPhoneAccount(PhoneAccount phoneAccount) {
7521:     public int getSubIdForPhoneAccountHandle(
7536:     public @Nullable PhoneAccountHandle getPhoneAccountHandleForSubscriptionId(int subscriptionId) {
9861:     private boolean isAnyPhoneInEmergencyState() {
10730:     public PhoneCapability getPhoneCapability() {
21: import static com.android.internal.telephony.PhoneConstants.PHONE_TYPE_CDMA;
22: import static com.android.internal.telephony.PhoneConstants.PHONE_TYPE_GSM;
23: import static com.android.internal.telephony.PhoneConstants.PHONE_TYPE_IMS;
162: import com.android.internal.telephony.Phone;
198: import com.android.phone.callcomposer.CallComposerPictureManager;
199: import com.android.phone.callcomposer.CallComposerPictureTransfer;
200: import com.android.phone.callcomposer.ImageData;
201: import com.android.phone.settings.PickSmsSubscriptionActivity;
202: import com.android.phone.vvm.PhoneAccountHandleConverter;
203: import com.android.phone.vvm.RemoteVvmTaskManager;
204: import com.android.phone.vvm.VisualVoicemailSettingsUtil;
205: import com.android.phone.vvm.VisualVoicemailSmsFilterConfig;
445:         // In cases where subId is unavailable, the caller needs to specify the phone.
454:         MainThreadRequest(Object argument, Phone phone, WorkSource workSource) {
456:             if (phone != null) {
457:                 this.phone = phone;
485:      * A handler that processes messages on the main thread in the phone process. Since many
486:      * of the Phone calls are not thread safe this is needed to shuttle the requests from the
487:      * inbound binder threads to the main thread in the phone process.  The Binder thread
504:             final Phone defaultPhone = getDefaultPhone();
509:                     final Phone phone = getPhoneFromRequest(request);
528:                         request.result = phone != null
529:                                 ? phone.handleUssdRequest(ussdRequest, wrappedCallback) : false;
540:                     final Phone phone = getPhoneFromRequest(request);
541:                     request.result = phone != null ?
818:                     Phone phone = getPhoneFromRequest(request);
819:                     if (phone != null) {
820:                         phone.isNrDualConnectivityEnabled(onCompleted, request.workSource);
822:                         loge("isNRDualConnectivityEnabled: No phone object");
857:                     Phone phone = getPhoneFromRequest(request);
858:                     if (phone != null) {
859:                         phone.setNrDualConnectivityState((int) request.argument, onCompleted,
862:                         loge("enableNrDualConnectivity: No phone object");
995:                     request.phone.getCallForwardingOption(callForwardingReason, onCompleted);
1057:                     request.phone.setCallForwardingOption(
1494:                     request.phone.requestCellInfoUpdate(request.workSource, onCompleted);
1508:                     request.phone.requestCellInfoUpdate(request.workSource,
1536:                     Phone phone = getPhoneFromRequest(request);
1537:                     phone.getCellIdentity(ws, obtainMessage(EVENT_GET_CELL_LOCATION_DONE, request));
1546:                         Phone phone = getPhoneFromRequest(request);
1547:                         request.result = (phone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA)
1570:                             .enablePhone(request.phone, enable, onCompleted);
1576:                     int phoneId = request.phone.getPhoneId();
1592:                             .getPhoneStatusFromModem(request.phone, onCompleted);
1597:                     int id = request.phone.getPhoneId();
1620:                     request.phone.setSystemSelectionChannels(args.first, onCompleted);
1635:                     Phone phone = getPhoneFromRequest(request);
1636:                     if (phone != null) {
1637:                         phone.getSystemSelectionChannels(onCompleted);
1639:                         loge("getSystemSelectionChannels: No phone object");
1786:                     Phone phone = getPhoneFromRequest(request);
1787:                     if (phone != null) {
1788:                         phone.setDataThrottling(onCompleted,
1792:                         loge("setDataThrottling: No phone object");
1836:                     request.phone.setSimPowerState(stateToSet, onCompleted, request.workSource);
1880:                     final Phone phone = getPhoneFromRequest(request);
1881:                     if (phone == null || phone.getServiceStateTracker() == null) {
1882:                         request.result = new IllegalStateException("Phone or SST is null");
1891:                     phone.getSignalStrengthController().setSignalStrengthUpdateRequest(
1908:                     Phone phone = getPhoneFromRequest(request);
1909:                     if (phone == null || phone.getServiceStateTracker() == null) {
1910:                         request.result = new IllegalStateException("Phone or SST is null");
1919:                     phone.getSignalStrengthController().clearSignalStrengthUpdateRequest(
1935:                     request.phone.getSlicingConfig(onCompleted);
2058:     private Object sendRequest(int command, Object argument, Phone phone, WorkSource workSource) {
2059:         return sendRequest(command, argument, SubscriptionManager.INVALID_SUBSCRIPTION_ID, phone,
2069:     private @Nullable Object sendRequest(int command, Object argument, Integer subId, Phone phone,
2076:         if (subId != SubscriptionManager.INVALID_SUBSCRIPTION_ID && phone != null) {
2077:             throw new IllegalArgumentException("subId and phone cannot both be specified!");
2078:         } else if (phone != null) {
2079:             request = new MainThreadRequest(argument, phone, workSource);
2139:      * Same as {@link #sendRequestAsync(int,Object)} except it takes a Phone and WorkSource.
2143:             int command, Object argument, Phone phone, WorkSource workSource) {
2144:         MainThreadRequest request = new MainThreadRequest(argument, phone, workSource);
2185:         Phone thePhone = getPhone(getDefaultSubscription());
2199:         if (request.phone != null) {
2200:             return request.phone;
2212:         Phone phone = getPhoneFromRequest(request);
2213:         return phone == null ? null :
2214:                 UiccController.getInstance().getUiccCard(phone.getPhoneId());
2217:     // returns phone associated with the subId.
2222:     private void sendEraseModemConfig(@NonNull Phone phone) {
2227:     private void sendEraseDataInSharedPreferences(@NonNull Phone phone) {
2259:             // PENDING: should we just silently fail if phone is offhook or ringing?
2280:         // from the context of the phone app.
2283:         if (mAppOps.noteOp(AppOpsManager.OPSTR_CALL_PHONE, Binder.getCallingUid(), callingPackage)
2333:             Phone phone = getPhone(subId);
2334:             final UnlockSim checkSimPin = new UnlockSim(phone.getPhoneId(), phone.getIccCard());
2347:             Phone phone = getPhone(subId);
2348:             final UnlockSim checkSimPuk = new UnlockSim(phone.getPhoneId(), phone.getIccCard());
2510:             final Phone phone = getPhone(getDefaultSubscription());
2511:             if (phone != null) {
2512:                 phone.updateServiceLocation(workSource);
2557:             final Phone phone = getPhone(subId);
2558:             if (phone != null) {
2559:                 return phone.getServiceState().getState() != ServiceState.STATE_POWER_OFF;
2577:             final Phone phone = getPhone(subId);
2578:             if (phone != null) {
2579:                 phone.setRadioPower(!isRadioOnForSubscriber(subId));
2595:             final Phone phone = getPhone(subId);
2596:             if (phone == null) {
2599:             if ((phone.getServiceState().getState() != ServiceState.STATE_POWER_OFF) != turnOn) {
2617:                 Phone phone = PhoneFactory.getPhone(i);
2618:                 if (phone != null && phone.isRadioAvailable()) return true;
2634:                 logv("Shutting down Phone " + i);
2643:         Phone phone = PhoneFactory.getPhone(phoneId);
2644:         if (phone != null && phone.isRadioAvailable()) {
2645:             phone.shutdownRadio();
2654:             final Phone defaultPhone = PhoneFactory.getDefaultPhone();
2659:                 loge("There's no default phone.");
2672:             final Phone phone = getPhone(subId);
2673:             if (phone != null) {
2674:                 phone.setRadioPower(turnOn);
2692:             final Phone phone = getPhone(subId);
2693:             if (phone != null) {
2694:                 phone.getDataEnabledSettings().setDataEnabled(
2713:             final Phone phone = getPhone(subId);
2714:             if (phone != null) {
2715:                 phone.getDataEnabledSettings().setDataEnabled(
2730:             final Phone phone = getPhone(subId);
2731:             if (phone != null) {
2732:                 return phone.isDataAllowed(ApnSetting.TYPE_DEFAULT);
2791:             Phone phone = getPhone(getDefaultSubscription());
2792:             return phone == null ? TelephonyManager.CALL_STATE_IDLE :
2793:                     PhoneConstantConversions.convertCallState(phone.getState());
2804:             // Check READ_PHONE_STATE for API version 31+
2807:                 throw new SecurityException("getCallState requires READ_PHONE_STATE for apps "
2813:             Phone phone = getPhone(subId);
2814:             return phone == null ? TelephonyManager.CALL_STATE_IDLE :
2815:                     PhoneConstantConversions.convertCallState(phone.getState());
2830:             final Phone phone = getPhone(subId);
2831:             if (phone != null) {
2832:                 return PhoneConstantConversions.convertDataState(phone.getDataConnectionState());
2851:             final Phone phone = getPhone(subId);
2852:             if (phone != null) {
2853:                 return DefaultPhoneNotifier.convertDataActivityState(phone.getDataActivityState());
2882:                 return (getDefaultPhone().getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA)
2903:             if (phoneId == SubscriptionManager.INVALID_PHONE_INDEX) {
2904:                 // Get default phone in this case.
2905:                 phoneId = SubscriptionManager.DEFAULT_PHONE_INDEX;
2908:             Phone phone = PhoneFactory.getPhone(phoneId);
2909:             if (phone == null) return "";
2910:             ServiceStateTracker sst = phone.getServiceStateTracker();
2979:         for (Phone phone : PhoneFactory.getPhones()) {
2980:             List<CellInfo> info = phone.getAllCellInfo();
3019:             for (Phone phone : PhoneFactory.getPhones()) {
3021:                         CMD_GET_ALL_CELL_INFO, null, phone, workSource);
3083:         final Phone phone = getPhoneFromSubId(subId);
3084:         if (phone == null) throw new IllegalArgumentException("Invalid Subscription Id: " + subId);
3086:         sendRequestAsync(CMD_REQUEST_CELL_INFO_UPDATE, cb, phone, workSource);
3104:         Phone phone = PhoneFactory.getPhone(slotIndex);
3105:         if (phone == null) {
3108:         int subId = phone.getSubId();
3117:             return phone.getImei();
3125:         Phone phone = PhoneFactory.getPhone(slotIndex);
3127:         if (phone != null) {
3128:             String imei = phone.getImei();
3141:         Phone phone = PhoneFactory.getPhone(slotIndex);
3142:         if (phone == null) {
3146:         int subId = phone.getSubId();
3154:             return phone.getMeid();
3162:         Phone phone = PhoneFactory.getPhone(slotIndex);
3164:         if (phone != null) {
3165:             String meid = phone.getMeid();
3180:         Phone phone = PhoneFactory.getPhone(slotIndex);
3181:         if (phone == null) {
3184:         int subId = phone.getSubId();
3193:             return phone.getDeviceSvn();
3203:             final Phone phone = getPhone(subId);
3204:             return phone == null ? TelephonyManager.UNKNOWN_CARRIER_ID : phone.getCarrierId();
3214:             final Phone phone = getPhone(subId);
3215:             return phone == null ? null : phone.getCarrierName();
3225:             final Phone phone = getPhone(subId);
3226:             return phone == null ? TelephonyManager.UNKNOWN_CARRIER_ID
3227:                     : phone.getSpecificCarrierId();
3237:             final Phone phone = getPhone(subId);
3238:             return phone == null ? null : phone.getSpecificCarrierName();
3249:         final Phone phone = PhoneFactory.getPhone(slotIndex);
3250:         if (phone == null) {
3255:             return CarrierResolver.getCarrierIdFromMccMnc(phone.getContext(), mccmnc);
3286:      * Make sure the caller has the MODIFY_PHONE_STATE permission.
3291:         mApp.enforceCallingOrSelfPermission(android.Manifest.permission.MODIFY_PHONE_STATE, null);
3311:      * Make sure the caller has the CALL_PHONE permission.
3316:         mApp.enforceCallingOrSelfPermission(android.Manifest.permission.CALL_PHONE, null);
3356:             final Phone phone = PhoneFactory.getPhone(slotIndex);
3357:             if (phone == null) {
3358:                 return PhoneConstants.PHONE_TYPE_NONE;
3360:                 return phone.getPhoneType();
3387:             final Phone phone = getPhone(subId);
3388:             if (phone != null) {
3389:                 return phone.getCdmaEriIconIndex();
3420:             final Phone phone = getPhone(subId);
3421:             if (phone != null) {
3422:                 return phone.getCdmaEriIconMode();
3451:             final Phone phone = getPhone(subId);
3452:             if (phone != null) {
3453:                 return phone.getCdmaEriText();
3472:             final Phone phone = getPhone(subId);
3473:             if (phone != null && phone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA) {
3474:                 return phone.getLine1Number();
3476:                 loge("getCdmaMdn: no phone found. Invalid subId: " + subId);
3494:             final Phone phone = getPhone(subId);
3495:             if (phone != null && phone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA) {
3496:                 return phone.getCdmaMin();
3508:         if (mApp.checkCallingOrSelfPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
3510:             throw new SecurityException("Caller must hold the MODIFY_PHONE_STATE permission");
3676:             final Phone phone = getPhone(subId);
3677:             if (phone != null) {
3678:                 phone.setVoiceActivationState(activationState);
3697:             final Phone phone = getPhone(subId);
3698:             if (phone != null) {
3699:                 phone.setDataActivationState(activationState);
3715:         final Phone phone = getPhone(subId);
3718:             if (phone != null) {
3719:                 return phone.getVoiceActivationState();
3735:         final Phone phone = getPhone(subId);
3738:             if (phone != null) {
3739:                 return phone.getDataActivationState();
3761:             final Phone phone = getPhone(subId);
3762:             if (phone != null) {
3763:                 return phone.getVoiceMessageCount();
3780:             final Phone phone = getPhone(subId);
3781:             return (phone == null ? false : phone.isConcurrentVoiceAndDataAllowed());
3794:         final Phone defaultPhone = getDefaultPhone();
3832:             for (Phone phone : PhoneFactory.getPhones()) {
3833:                 if (phone.isInEmergencySmsMode()) {
3844:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3871:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3908:             Phone phone = getPhone(subId);
3909:             if (phone == null) {
3914:             phone.getImsRegistrationState(regState -> {
3941:             Phone phone = getPhone(subId);
3942:             if (phone == null) {
3947:             phone.getImsRegistrationTech(regTech -> {
3966:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3992:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
4042:             Phone phone = getPhone(subId);
4043:             if (phone == null) return false;
4044:             return phone.isImsCapabilityAvailable(capability, regTech);
4095:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
4133:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
4170:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
4208:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
4229:      * Requires MODIFY_PHONE_STATE permission.
4252:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
4306:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
4392:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
4459:         Phone phone = getPhone(subId);
4460:         if (phone == null) {
4461:             loge("phone instance null for subid " + subId);
4465:             if (!doesImsCapabilityRequireProvisioning(phone.getContext(), subId, capability)) {
4469:             if (!doesRcsCapabilityRequireProvisioning(phone.getContext(), subId, capability)) {
4934:             final Phone phone = getPhone(subId);
4935:             if (phone != null) {
4936:                 return phone.getServiceState().getDataNetworkType();
4968:             final Phone phone = getPhone(subId);
4969:             if (phone != null) {
4970:                 return phone.getServiceState().getDataNetworkType();
4993:             final Phone phone = getPhone(subId);
4994:             if (phone != null) {
4995:                 return phone.getServiceState().getVoiceNetworkType();
5020:             final Phone phone = PhoneFactory.getPhone(slotIndex);
5021:             if (phone != null) {
5022:                 return phone.getIccCard().hasIccCard();
5037:      * @return {@link Phone#LTE_ON_CDMA_UNKNOWN}, {@link Phone#LTE_ON_CDMA_FALSE}
5038:      * or {@link Phone#LTE_ON_CDMA_TRUE}
5057:             final Phone phone = getPhone(subId);
5058:             if (phone == null) {
5126:                     + " does not correspond to an active phone");
5157:     private IccOpenLogicalChannelResponse iccOpenLogicalChannelWithPermission(Phone phone,
5174:                     CMD_OPEN_CHANNEL, new Pair<String, Integer>(aid, p2), phone,
5199:     private boolean iccCloseLogicalChannelWithPermission(Phone phone, int channel) {
5205:             Boolean success = (Boolean) sendRequest(CMD_CLOSE_CHANNEL, channel, phone,
5242:     private String iccTransmitApduLogicalChannelWithPermission(Phone phone, int channel, int cla,
5251:                     new IccAPDUArgument(channel, cla, command, p1, p2, p3, data), phone,
5298:     private String iccTransmitApduBasicChannelWithPermission(Phone phone, String callingPackage,
5316:                     new IccAPDUArgument(0, cla, command, p1, p2, p3, data), phone,
5550:         Phone phone = PhoneFactory.getPhone(slotIndex);
5551:         if (phone != null) {
5553:                     mApp, phone.getSubId(), "resetModemConfig");
5576:         Phone phone = PhoneFactory.getPhone(slotIndex);
5577:         if (phone != null) {
5579:                     mApp, phone.getSubId(), "rebootModem");
5595:         final Phone defaultPhone = getDefaultPhone();
5876:      * Sets the ims registration state on all valid {@link Phone}s.
5883:             // NOTE: Before S, this method only set the default phone.
5884:             for (final Phone phone : PhoneFactory.getPhones()) {
5885:                 if (SubscriptionManager.isValidSubscriptionId(phone.getSubId())) {
5886:                     phone.setImsRegistrationState(registered);
5969:             final Phone phone = getPhone(subId);
5970:             if (phone == null) {
5973:             OperatorInfo networkSelection = phone.getSavedNetworkSelection();
5975:                 ? phone.getManualNetworkSelectionPlmn() : networkSelection.getOperatorNumeric();
6032:             Phone phone = getPhone(subId);
6033:             if (phone == null) {
6063:             sendRequestAsync(CMD_GET_CALL_FORWARDING, argument, phone, null);
6084:             Phone phone = getPhone(subId);
6085:             if (phone == null) {
6098:             sendRequestAsync(CMD_SET_CALL_FORWARDING, arguments, phone, null);
6112:             Phone phone = getPhone(subId);
6113:             if (phone == null) {
6121:             CarrierConfigManager configManager = new CarrierConfigManager(phone.getContext());
6128:                 CarrierXmlParser carrierXmlParser = new CarrierXmlParser(phone.getContext(),
6148:                 sendRequestAsync(CMD_GET_CALL_WAITING, argument, phone, null);
6165:             Phone phone = getPhone(subId);
6166:             if (phone == null) {
6175:             CarrierConfigManager configManager = new CarrierConfigManager(phone.getContext());
6182:                 CarrierXmlParser carrierXmlParser = new CarrierXmlParser(phone.getContext(),
6205:                 sendRequestAsync(CMD_SET_CALL_WAITING, arguments, phone, null);
6468:         final Phone phone = getPhone(subId);
6470:             if (phone != null) {
6471:                 return phone.hasMatchedTetherApnSetting();
6491:         final Phone phone = getPhone(subId);
6493:             if (phone != null) {
6498:                 phone.setAlwaysReportSignalStrength(isEnable);
6500:                 loge("setAlwaysReportSignalStrength: no phone found for subId="
6529:      * Accepts either ACCESS_NETWORK_STATE, MODIFY_PHONE_STATE or carrier privileges.
6547:             Phone phone = PhoneFactory.getPhone(phoneId);
6548:             if (phone != null) {
6549:                 boolean retVal = phone.isUserDataEnabled();
6553:                 if (DBG) loge("isUserDataEnabled: no phone subId=" + subId + " retVal=false");
6576:                 mApp.enforceCallingOrSelfPermission(android.Manifest.permission.READ_PHONE_STATE,
6587:             Phone phone = PhoneFactory.getPhone(phoneId);
6588:             if (phone != null) {
6589:                 boolean retVal = phone.getDataEnabledSettings().isDataEnabled();
6593:                 if (DBG) loge("isDataEnabled: no phone subId=" + subId + " retVal=false");
6614:             mApp.enforceCallingOrSelfPermission(android.Manifest.permission.READ_PHONE_STATE,
6626:             Phone phone = PhoneFactory.getPhone(phoneId);
6627:             if (phone != null) {
6630:                     retVal = phone.isUserDataEnabled();
6632:                     retVal = phone.getDataEnabledSettings().isDataEnabledForReason(reason);
6638:                     loge("isDataEnabledForReason: no phone subId="
6649:             Phone phone) {
6650:         if (uid == Process.PHONE_UID) {
6651:             // Skip the check if it's the phone UID (system UID removed in b/184713596)
6652:             // TODO (b/184954344): Check for system/phone UID at call site instead of here
6661:         PackageManager pkgMgr = phone.getContext().getPackageManager();
6666:             int subId = phone.getSubId();
6674:                     phone.getContext().getSystemService(Context.TELEPHONY_SUBSCRIPTION_SERVICE);
6686:     private int getCarrierPrivilegeStatusFromCarrierConfigRules(int privilegeFromSim, Phone phone,
6695:             int subId = phone.getSubId();
6703:                     phone.getContext().getSystemService(Context.TELEPHONY_SUBSCRIPTION_SERVICE);
6713:         final Phone phone = getPhone(subId);
6714:         if (phone == null) {
6718:         UiccCard card = UiccController.getInstance().getUiccCard(phone.getPhoneId());
6726:                 phone.getContext().getPackageManager()), Binder.getCallingUid(), phone);
6732:         final Phone phone = getPhone(subId);
6733:         if (phone == null) {
6738:                 UiccController.getInstance().getUiccProfileForPhone(phone.getPhoneId());
6745:                         phone.getContext().getPackageManager(), uid), uid, phone);
6856:         final Phone phone = getPhone(subId);
6857:         UiccCard card = phone == null ? null : phone.getUiccCard();
6874:             Phone phone = getPhone(subId);
6875:             if (phone != null) {
6876:                 Phone defaultPhone = phone.getImsPhone();
6877:                 if (defaultPhone != null && defaultPhone.getPhoneType() == PHONE_TYPE_IMS) {
6897:             Phone phone = getPhone(subId);
6898:             if (phone != null) {
6899:                 Phone defaultPhone = phone.getImsPhone();
6900:                 if (defaultPhone != null && defaultPhone.getPhoneType() == PHONE_TYPE_IMS) {
6920:             final Phone phone = getPhone(subId);
6921:             if (phone == null) {
6924:             final String subscriberId = phone.getSubscriberId();
7147:             final Phone phone = getPhone(subId);
7148:             return phone == null ? false : phone.setOperatorBrandOverride(brand);
7163:             final Phone phone = getPhone(subId);
7164:             if (phone == null) {
7167:             return phone.setRoamingOverride(gsmRoamingList, gsmNonRoamingList, cdmaRoamingList,
7209:         Phone phone = PhoneFactory.getPhone(phoneId);
7213:                             mApp, phone.getSubId(), "getRadioAccessFamily");
7219:         if (phone == null) {
7226:                             mApp, phone.getSubId(), "getRadioAccessFamily");
7328:         final Phone defaultPhone = getDefaultPhone();
7342:         final Phone defaultPhone = getDefaultPhone();
7396:                     .getBoolean(CarrierConfigManager.KEY_WORLD_PHONE_BOOL);
7427:         final Phone phone = getPhone(subscriptionId);
7428:         if (phone == null) {
7429:             loge("isRttSupported: no Phone found. Invalid subId:" + subscriptionId);
7436:                     phone.getContext().getResources().getBoolean(R.bool.config_support_rtt);
7469:      * Returns the unique device ID of phone, for example, the IMEI for
7473:      *   {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
7477:         final Phone phone = PhoneFactory.getPhone(0);
7478:         if (phone == null) {
7481:         int subId = phone.getSubId();
7489:             return phone.getDeviceId();
7502:         Phone phone = getPhone(subId);
7503:         if (phone != null) {
7504:             return phone.isImsRegistered();
7525:             throw new SecurityException("Requires READ_PHONE_STATE permission.");
7544:             Phone phone = getPhone(subscriptionId);
7545:             if (phone == null) {
7548:             return PhoneUtils.makePstnPhoneAccountHandle(phone);
7560:             Phone phone = getPhone(subId);
7561:             if (phone != null) {
7562:                 return phone.isWifiCallingEnabled();
7577:             Phone phone = getPhone(subId);
7578:             if (phone != null) {
7579:                 return phone.isVideoEnabled();
7595:             Phone phone = getPhone(subId);
7596:             if (phone != null) {
7597:                 return phone.getImsRegistrationTech();
7612:         Phone defaultPhone = getDefaultPhone();
7625:                 Phone phone = getPhone(subId);
7626:                 cleanUpAllowedNetworkTypes(phone, subId);
7658:     void cleanUpAllowedNetworkTypes(Phone phone, int subId) {
7659:         if (phone == null || !SubscriptionManager.isUsableSubscriptionId(subId)) {
7667:         phone.loadAllowedNetworksFromSubscriptionDatabase();
7668:         phone.setAllowedNetworkTypes(TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_USER,
7681:         final Phone phone = getPhone(subId);
7682:         if (phone == null) {
7689:                     phone.getContext().getOpPackageName(), phone.getContext().getAttributionTag());
7698:             final Locale localeFromDefaultSim = phone.getLocaleFromSimAndCarrierPrefs();
7825:         final Phone phone = getPhone(subId);
7826:         if (phone == null) {
7832:         boolean isCallingPackageDataService = phone.getDataServicePackages()
7835:             // isActiveSubId requires READ_PHONE_STATE, which we already check for above
7842:             ServiceState ss = phone.getServiceState();
7855:      * Returns the URI for the per-account voicemail ringtone set in Phone settings.
7866:             Phone phone = PhoneUtils.getPhoneForPhoneAccountHandle(accountHandle);
7867:             if (phone == null) {
7868:                 phone = getDefaultPhone();
7871:             return VoicemailNotificationSettingsUtil.getRingtoneUri(phone.getContext());
7881:      * has permission {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}.
7891:         final Phone defaultPhone = getDefaultPhone();
7902:             Phone phone = PhoneUtils.getPhoneForPhoneAccountHandle(phoneAccountHandle);
7903:             if (phone == null) {
7904:                 phone = defaultPhone;
7906:             VoicemailNotificationSettingsUtil.setRingtoneUri(phone.getContext(), uri);
7913:      * Returns whether vibration is set for voicemail notification in Phone settings.
7923:             Phone phone = PhoneUtils.getPhoneForPhoneAccountHandle(accountHandle);
7924:             if (phone == null) {
7925:                 phone = getDefaultPhone();
7928:             return VoicemailNotificationSettingsUtil.isVibrationEnabled(phone.getContext());
7938:      * has permission {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}.
7948:         final Phone defaultPhone = getDefaultPhone();
7959:             Phone phone = PhoneUtils.getPhoneForPhoneAccountHandle(phoneAccountHandle);
7960:             if (phone == null) {
7961:                 phone = defaultPhone;
7963:             VoicemailNotificationSettingsUtil.setVibrationEnabled(phone.getContext(), enabled);
7970:      * Make sure either called from same process as self (phone) or IPC caller has read privilege.
7975:         mApp.enforceCallingOrSelfPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE,
7980:      * Make sure either called from same process as self (phone) or IPC caller has send SMS
8023:         Phone phone = getPhone(subId);
8027:             if (phone == null) {
8032:                 aid = UiccController.getInstance().getUiccCard(phone.getPhoneId())
8052:         Phone phone = getPhone(subId);
8056:             if (phone == null) {
8061:                 esn = phone.getEsn();
8080:         Phone phone = getPhone(subId);
8084:             if (phone == null) {
8089:                 cdmaPrlVersion = phone.getCdmaPrlVersion();
8183:         final Phone phone = getPhone(subId);
8186:         if (phone == null) {
8191:             phone.carrierActionSetRadioEnabled(enabled);
8211:         final Phone phone = getPhone(subId);
8214:         if (phone == null) {
8219:             phone.carrierActionReportDefaultNetworkStatus(report);
8235:         final Phone phone = getPhone(subId);
8236:         if (phone == null) {
8241:             phone.carrierActionResetAll();
8248:      * Called when "adb shell dumpsys phone" is invoked. Dump is also automatically invoked when a
8255:             writer.println("Permission Denial: can't dump Phone from pid="
8298:             Phone phone = getPhone(subId);
8299:             if (phone != null) {
8301:                     phone.carrierActionSetMeteredApnsEnabled(enabled);
8303:                     phone.getDataEnabledSettings().setDataEnabled(reason, enabled);
8323:         Phone phone = getPhone(subId);
8327:             if (phone != null) {
8328:                 return phone.getClientRequestStats();
8355:         Phone phone = PhoneFactory.getPhone(slotIndex);
8361:             if (phone != null) {
8362:                 phone.setSimPowerState(state, null, workSource);
8384:         Phone phone = PhoneFactory.getPhone(slotIndex);
8390:             if (phone != null) {
8392:                 sendRequestAsync(CMD_SET_SIM_POWER, arguments, phone, workSource);
8414:      * Check if phone is in emergency callback mode
8415:      * @return true if phone is in emergency callback mode
8421:         final Phone phone = getPhone(subId);
8425:             if (phone != null) {
8426:                 return phone.isInEcm();
8446:             Phone p = getPhone(subId);
8466:         Phone phone = PhoneFactory.getPhone(slotIndex);
8467:         if (phone != null) {
8468:             if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp, phone.getSubId(),
8475:                 return phone.getRadioPowerState();
8488:      * {@link android.Manifest.permission#READ_PHONE_STATE} or that the calling app has carrier
8508:             Phone phone = getPhone(subId);
8509:             isEnabled =  phone != null ? phone.getDataRoamingEnabled() : false;
8521:      * {@link android.Manifest.permission#MODIFY_PHONE_STATE} or that the calling app has carrier
8534:             Phone phone = getPhone(subId);
8535:             if (phone != null) {
8536:                 phone.setDataRoamingEnabled(isEnabled);
8552:             Phone phone = getPhone(subId);
8553:             if (phone != null) {
8554:                 isAllowed = phone.isCspPlmnEnabled();
8573:             // even without READ_PRIVILEGED_PHONE_STATE, we allow the call to continue if the caller
8710:      * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}.
8719:             Phone phone = getPhone(subId);
8720:             if (phone == null) {
8723:             UiccCard uiccCard = phone.getUiccCard();
8760:      * not set, return {@link Phone#PREFERRED_NT_MODE}.
8768:         return Phone.PREFERRED_NT_MODE;
8778:             final Phone phone = getPhone(subId);
8779:             if (phone == null) {
8783:             phone.setCarrierTestOverride(mccmnc, imsi, iccid, gid1, gid2, plmn, spn,
8801:             final Phone phone = getPhone(subId);
8802:             if (phone == null) {
8806:             return phone.getCarrierIdListVersion();
8889:             throw new SecurityException("Requires READ_PHONE_STATE permission.");
8894:             for (Phone phone: PhoneFactory.getPhones()) {
8895:                 if (phone.getEmergencyNumberTracker() != null
8896:                         && phone.getEmergencyNumberTracker().getEmergencyNumberList() != null) {
8898:                             phone.getSubId(),
8899:                             phone.getEmergencyNumberTracker().getEmergencyNumberList());
8910:         final Phone defaultPhone = getDefaultPhone();
8918:             for (Phone phone: PhoneFactory.getPhones()) {
8919:                 if (phone.getEmergencyNumberTracker() != null
8920:                         && phone.getEmergencyNumberTracker()
8941:             for (Phone phone : PhoneFactory.getPhones()) {
8942:                 Rlog.d(LOG_TAG, "startEmergencyCallbackMode phone type: " + phone.getPhoneType());
8943:                 if (phone != null && ((phone.getPhoneType() == PHONE_TYPE_GSM)
8944:                         || (phone.getPhoneType() == PHONE_TYPE_CDMA))) {
8945:                     GsmCdmaPhone gsmCdmaPhone = (GsmCdmaPhone) phone;
8966:             for (Phone phone: PhoneFactory.getPhones()) {
8967:                 EmergencyNumberTracker tracker = phone.getEmergencyNumberTracker();
8988:             for (Phone phone: PhoneFactory.getPhones()) {
8989:                 EmergencyNumberTracker tracker = phone.getEmergencyNumberTracker();
9008:             final Phone phone = getPhone(subId);
9009:             if (phone == null) {
9013:             return phone.getEmergencyNumberDbVersion();
9025:             for (Phone phone: PhoneFactory.getPhones()) {
9026:                 EmergencyNumberTracker tracker = phone.getEmergencyNumberTracker();
9042:             for (Phone phone: PhoneFactory.getPhones()) {
9043:                 EmergencyNumberTracker tracker = phone.getEmergencyNumberTracker();
9059:             for (Phone phone: PhoneFactory.getPhones()) {
9060:                 EmergencyNumberTracker tracker = phone.getEmergencyNumberTracker();
9073:         Phone phone = getPhone(subId);
9074:         if (phone == null) {
9080:                     .getUiccProfileForPhone(phone.getPhoneId());
9099:             Phone phone = PhoneFactory.getPhone(slotIndex);
9100:             if (phone == null) {
9103:                 return (Boolean) sendRequest(CMD_REQUEST_ENABLE_MODEM, enable, phone, null);
9116:         Phone phone = PhoneFactory.getPhone(slotIndex);
9117:         if (phone == null) return false;
9120:                 mApp, phone.getSubId(), callingPackage, callingFeatureId,
9122:             throw new SecurityException("Requires READ_PHONE_STATE permission.");
9128:                 return mPhoneConfigurationManager.getPhoneStatusFromCache(phone.getPhoneId());
9130:                 return (Boolean) sendRequest(CMD_GET_MODEM_STATUS, null, phone, null);
9198:      * Note: Switch from multi-sim to single-sim is only possible with MODIFY_PHONE_STATE
9199:      * permission, but the other way around is possible with either MODIFY_PHONE_STATE
9228:         Phone phone = getPhone(subId);
9229:         if (phone == null) {
9234:             UiccCard uiccCard = phone.getUiccCard();
9304:         Phone phone = getDefaultPhone();
9305:         if (phone == null) return -1;
9306:         HalVersion hv = phone.getHalVersion();
9336:         enforceReadPrivilegedPermission("Needs READ_PRIVILEGED_PHONE_STATE for "
9342:             Phone phone = getPhone(subId);
9343:             if (phone == null) return false;
9345:             boolean isMetered = ApnSettingUtils.isMeteredApnType(apnType, phone);
9346:             return !isMetered || phone.getDataEnabledSettings().isDataEnabled(apnType);
9359:             Phone phone = getPhone(subId);
9360:             if (phone == null) return true; // By default return true.
9362:             return ApnSettingUtils.isMeteredApnType(apnType, phone);
9374:             Phone phone = getPhone(subscriptionId);
9375:             if (phone == null) {
9395:             sendRequestAsync(CMD_SET_SYSTEM_SELECTION_CHANNELS, argument, phone, null);
9495:             Phone phone = getPhone(subscriptionId);
9496:             if (phone == null) return false;
9500:                     return phone.getDataEnabledSettings().isDataAllowedInVoiceCall();
9502:                     return phone.getDataEnabledSettings().isMmsAlwaysAllowed();
9518:             Phone phone = getPhone(subscriptionId);
9519:             if (phone == null) return;
9523:                     phone.getDataEnabledSettings().setAllowDataDuringVoiceCall(enabled);
9526:                     phone.getDataEnabledSettings().setAlwaysAllowMmsData(enabled);
9548:             for (Phone phone : PhoneFactory.getPhones()) {
9549:                 Phone defaultPhone = phone.getImsPhone();
9550:                 if (defaultPhone != null && defaultPhone.getPhoneType() == PHONE_TYPE_IMS) {
9599:             Phone phone = getPhone(subId);
9600:             if (phone != null && phone.getIccCard() != null) {
9601:                 return phone.getIccCard().getIccLockEnabled();
9625:         Phone phone = getPhone(subId);
9626:         if (phone == null) {
9633:                     new Pair<Boolean, String>(enabled, password), phone, null);
9657:         Phone phone = getPhone(subId);
9658:         if (phone == null) {
9665:                     new Pair<String, String>(oldPassword, newPassword), phone, null);
9724:             throw new SecurityException("Requires READ_PHONE_STATE permission.");
9727:         Phone phone = getPhone(subId);
9728:         if (phone == null) {
9729:             throw new RuntimeException("phone is not available");
9734:             return phone.getEquivalentHomePlmns();
9758:                 Manifest.permission.MODIFY_PHONE_STATE);
9798:      * @return {@code true} if phone setRadioPowerForReason was called. Otherwise, returns {@code
9804:             Phone phone = PhoneFactory.getPhone(i);
9805:             if (phone != null) {
9806:                 phone.setRadioPowerForReason(enable, Phone.RADIO_POWER_REASON_THERMAL);
9811:         // return true if successfully informed the phone object about the thermal radio power
9825:         // Ensure that radio is on. If not able to power on due to phone being unavailable, return
9864:             Log.e(LOG_TAG , "Phone state is not valid. One of the phones is in an emergency call");
9867:         for (Phone phone : PhoneFactory.getPhones()) {
9868:             if (phone.isInEmergencySmsMode() || phone.isInEcm()) {
9869:                 Log.e(LOG_TAG, "Phone state is not valid. isInEmergencySmsMode = "
9870:                     + phone.isInEmergencySmsMode() + " isInEmergencyCallbackMode = "
9871:                     + phone.isInEcm());
9941:                     // Ensure that radio is on. If not able to power on due to phone being
9961:                         Phone phone = getPhone(subId);
9962:                         if (phone == null) {
9986:                     // Turn radio off. If not able to power off due to phone being unavailable,
10110:                 permission.READ_PRIVILEGED_PHONE_STATE);
10141:                 permission.READ_PRIVILEGED_PHONE_STATE);
10172:                 permission.READ_PRIVILEGED_PHONE_STATE);
10346:                         Phone thePhone = p.getImsPhone();
10685:         if (callingUid == Process.PHONE_UID || callingUid == Process.SYSTEM_UID) {
10686:             // phone/system process do not have further restriction on request
10722:      * Gets the current phone capability.
10724:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
10726:      * It's used to evaluate possible phone config change, for example from single
10761:      * Requires carrier privileges or READ_PRIVILEGED_PHONE_STATE permission.
10769:             Phone phone = getDefaultPhone();
10770:             sendRequestAsync(CMD_GET_SLICING_CONFIG, callback, phone, null);
24: import static com.android.internal.telephony.PhoneConstants.SUBSCRIPTION_KEY;
68: import android.telecom.PhoneAccount;
69: import android.telecom.PhoneAccountHandle;
91: import android.telephony.PhoneCapability;
92: import android.telephony.PhoneNumberRange;
151: import com.android.internal.telephony.GsmCdmaPhone;
163: import com.android.internal.telephony.PhoneConfigurationManager;
164: import com.android.internal.telephony.PhoneConstantConversions;
165: import com.android.internal.telephony.PhoneConstants;
166: import com.android.internal.telephony.PhoneFactory;
181: import com.android.internal.telephony.imsphone.ImsPhone;
182: import com.android.internal.telephony.imsphone.ImsPhoneCallTracker;
233:     private static final String LOG_TAG = "PhoneInterfaceManager";
234:     private static final boolean DBG = (PhoneGlobals.DBG_LEVEL >= 2);
352:     private static PhoneInterfaceManager sInstance;
355:     private PhoneGlobals mApp;
759:                     defaultPhone.nvReadItem((Integer) request.argument, onCompleted,
786:                     defaultPhone.nvWriteItem(idValue.first, idValue.second, onCompleted,
797:                     defaultPhone.nvWriteCdmaPrl((byte[]) request.argument, onCompleted);
807:                     defaultPhone.resetModemConfig(onCompleted);
949:                     defaultPhone.invokeOemRilRequestRaw((byte[]) request.argument, onCompleted);
1230:                     if (defaultPhone != null) {
1231:                         defaultPhone.getModemActivityInfo(onCompleted, request.workSource);
1307:                     defaultPhone.setAllowedCarriers(argument, onCompleted, request.workSource);
1335:                     defaultPhone.getAllowedCarriers(onCompleted, request.workSource);
1559:                     defaultPhone.rebootModem(onCompleted);
1569:                     PhoneConfigurationManager.getInstance()
1579:                         mPhoneConfigurationManager.addToPhoneStatusCache(phoneId, msg.arg1 == 1);
1591:                     PhoneConfigurationManager.getInstance()
1708:                     defaultPhone.eraseModemConfig(onCompleted);
1716:                     request.result = defaultPhone.eraseDataInSharedPreferences();
1734:                         int phoneId = getPhoneFromRequest(request).getPhoneId();
1736:                                 .storePin(passwords.second, phoneId);
1758:                         int phoneId = getPhoneFromRequest(request).getPhoneId();
1761:                                     .storePin(enabled.second, phoneId);
1763:                             UiccController.getInstance().getPinStorage().clearPin(phoneId);
1777:                     getDefaultPhone().getContext().sendBroadcastAsUser(
2150:      * Initialize the singleton PhoneInterfaceManager instance.
2151:      * This is only done once, at startup, from PhoneApp.onCreate().
2153:     /* package */ static PhoneInterfaceManager init(PhoneGlobals app) {
2154:         synchronized (PhoneInterfaceManager.class) {
2156:                 sInstance = new PhoneInterfaceManager(app);
2167:         mCM = PhoneGlobals.getInstance().mCM;
2177:         mPhoneConfigurationManager = PhoneConfigurationManager.getInstance();
2186:         return (thePhone != null) ? thePhone : PhoneFactory.getDefaultPhone();
2208:                 ? getDefaultPhone() : getPhone(subId);
2219:         return PhoneFactory.getPhone(mSubscriptionController.getPhoneId(subId));
2233:         PackageManager pm = getDefaultPhone().getContext().getPackageManager();
2260:             PhoneConstants.State state = mCM.getState(subId);
2261:             if (state != PhoneConstants.State.OFFHOOK && state != PhoneConstants.State.RINGING) {
2320:         return (resultArray[0] == PhoneConstants.PIN_RESULT_SUCCESS) ? true : false;
2325:         return (resultArray[0] == PhoneConstants.PIN_RESULT_SUCCESS) ? true : false;
2366:         private int mResult = PhoneConstants.PIN_GENERAL_FAILURE;
2375:         UnlockSim(int phoneId, IccCard simCard) {
2376:             mPhoneId = phoneId;
2397:                                             mResult = PhoneConstants.PIN_PASSWORD_INCORRECT;
2402:                                             mResult = PhoneConstants.PIN_OPERATION_ABORTED;
2404:                                             mResult = PhoneConstants.PIN_GENERAL_FAILURE;
2407:                                         mResult = PhoneConstants.PIN_RESULT_SUCCESS;
2459:             if (mResult == PhoneConstants.PIN_RESULT_SUCCESS && pin.length() > 0) {
2620:             logv(TelephonyManager.getDefault().getPhoneCount() + " Phones are shutdown.");
2655:             if (defaultPhone != null) {
2656:                 defaultPhone.setRadioPower(turnOn);
2834:                 return PhoneConstantConversions.convertDataState(
2835:                         PhoneConstants.DataState.DISCONNECTED);
2907:             final int subId = mSubscriptionController.getSubIdUsingPhoneId(phoneId);
3096:             getDefaultPhone().setCellInfoListRate(rateInMillis, workSource);
3336:         Log.d(LOG_TAG, "[PhoneIntfMgr] " + msg);
3340:         Log.v(LOG_TAG, "[PhoneIntfMgr] " + msg);
3344:         Log.e(LOG_TAG, "[PhoneIntfMgr] " + msg);
3506:     public void requestNumberVerification(PhoneNumberRange range, long timeoutMillis,
3537:             return getDefaultPhone().needsOtaServiceProvisioning();
3572:             PhoneAccountHandle phoneAccountHandle = PhoneAccountHandleConverter.fromSubId(subId);
3573:             if (phoneAccountHandle == null) {
3576:             return VisualVoicemailSettingsUtil.dump(mApp, phoneAccountHandle);
3661:         SmsController smsController = PhoneFactory.getSmsController();
3796:         TelecomManager tm = defaultPhone.getContext().getSystemService(TelecomManager.class);
3805:             defaultPhone.sendDialerSpecialCode(inputCode);
4483:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
4513:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
4548:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
4615:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
4791:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
4816:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
4842:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
4868:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
5052:             return PhoneConstants.LTE_ON_CDMA_UNKNOWN;
5059:                 return PhoneConstants.LTE_ON_CDMA_UNKNOWN;
5062:                         .orElse(PhoneConstants.LTE_ON_CDMA_FALSE);
5123:         int phoneId = UiccController.getInstance().getPhoneIdFromSlotId(slotIndex);
5124:         if (phoneId == -1) {
5128:         return PhoneFactory.getPhone(phoneId);
5163:                 ComponentInfo bestComponent = EuiccConnector.findBestComponent(getDefaultPhone()
5305:                 ComponentInfo bestComponent = EuiccConnector.findBestComponent(getDefaultPhone()
5596:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp, defaultPhone.getSubId(),
5603:             return defaultPhone.getPcscfAddress(apnType);
6255:                     request, messenger, binder, getPhone(subId),
6545:             int phoneId = mSubscriptionController.getPhoneId(subId);
6546:             if (DBG) log("isUserDataEnabled: subId=" + subId + " phoneId=" + phoneId);
6585:             int phoneId = mSubscriptionController.getPhoneId(subId);
6586:             if (DBG) log("isDataEnabled: subId=" + subId + " phoneId=" + phoneId);
6621:             int phoneId = mSubscriptionController.getPhoneId(subId);
6623:                 log("isDataEnabledForReason: subId=" + subId + " phoneId=" + phoneId
6755:         int phoneId = SubscriptionManager.getPhoneId(subId);
6756:         UiccCard card = UiccController.getInstance().getUiccCard(phoneId);
6763:             getPhone(phoneId), pkgName);
6781:                 getPhone(i), pkgName);
6792:         enforceReadPrivilegedPermission("getCarrierPackageNamesForIntentAndPhone");
6793:         if (!SubscriptionManager.isValidPhoneId(phoneId)) {
6794:             loge("phoneId " + phoneId + " is not valid.");
6797:         UiccCard card = UiccController.getInstance().getUiccCard(phoneId);
6799:             loge("getCarrierPackageNamesForIntentAndPhone: No UICC");
6806:     public List<String> getPackagesWithCarrierPrivileges(int phoneId) {
6811:         UiccCard card = UiccController.getInstance().getUiccCard(phoneId);
6828:                                     getPhone(phoneId), pkgInfo.packageName)
6878:                     ImsPhone imsPhone = (ImsPhone) defaultPhone;
6879:                     imsPhone.setCallComposerStatus(status);
6901:                     ImsPhone imsPhone = (ImsPhone) defaultPhone;
6902:                     return imsPhone.getCallComposerStatus();
7208:     public int getRadioAccessFamily(int phoneId, String callingPackage) {
7227:             raf = ProxyController.getInstance().getRadioAccessFamily(phoneId);
7333:             ImsManager.getInstance(defaultPhone.getContext(),
7334:                     defaultPhone.getPhoneId()).setVtSetting(enable);
7343:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp, defaultPhone.getSubId(),
7355:                     ImsManager.getInstance(defaultPhone.getContext(), defaultPhone.getPhoneId());
7470:      * GSM and the MEID for CDMA phones. Return null if device ID is not available.
7514:             return PhoneUtils.getSubIdForPhoneAccount(phoneAccount);
7522:             PhoneAccountHandle phoneAccountHandle, String callingPackage, String callingFeatureId) {
7529:             return PhoneUtils.getSubIdForPhoneAccountHandle(phoneAccountHandle);
7613:         if (defaultPhone != null) {
7615:                     mApp, getDefaultPhone().getSubId(), "factoryReset");
7628:                 getPhone(subId).resetCarrierKeysForImsiEncryption();
7634:             cleanUpSmsRawTable(getDefaultPhone().getContext());
7641:             if (defaultPhone == null) {
7648:                 sendEraseModemConfig(defaultPhone);
7651:             sendEraseDataInSharedPreferences(defaultPhone);
7857:      * @param accountHandle The handle for the {@link PhoneAccount} for which to retrieve the
7860:      * PhoneAccount.
7863:     public Uri getVoicemailRingtoneUri(PhoneAccountHandle accountHandle) {
7883:      * @param phoneAccountHandle The handle for the {@link PhoneAccount} for which to set the
7886:      * PhoneAccount.
7890:             PhoneAccountHandle phoneAccountHandle, Uri uri) {
7893:         TelecomManager tm = defaultPhone.getContext().getSystemService(TelecomManager.class);
7896:                     mApp, PhoneUtils.getSubIdForPhoneAccountHandle(phoneAccountHandle),
7915:      * @param accountHandle The handle for the {@link PhoneAccount} for which to retrieve the
7917:      * @return {@code true} if the vibration is set for this PhoneAccount, {@code false} otherwise.
7920:     public boolean isVoicemailVibrationEnabled(PhoneAccountHandle accountHandle) {
7940:      * @param phoneAccountHandle The handle for the {@link PhoneAccount} for which to set the
7943:      * specific PhoneAccount.
7947:             PhoneAccountHandle phoneAccountHandle, boolean enabled) {
7950:         TelecomManager tm = defaultPhone.getContext().getSystemService(TelecomManager.class);
7953:                     mApp, PhoneUtils.getSubIdForPhoneAccountHandle(phoneAccountHandle),
8269:         return new TelephonyShellCommand(this, getDefaultPhone().getContext()).exec(
8575:             if (checkCarrierPrivilegesForPackageAnyPhone(callingPackage)
8764:         int phoneId = mSubscriptionController.getPhoneId(subId);
8765:         if (phoneId >= 0 && phoneId < list.size() && list.get(phoneId) != null) {
8766:             return list.get(phoneId);
8914:                             mApp, defaultPhone.getSubId(), "isEmergencyNumber(Potential)");
8932:      * Start emergency callback mode for GsmCdmaPhone for testing.
8946:                     gsmCdmaPhone.obtainMessage(
8947:                             GsmCdmaPhone.EVENT_EMERGENCY_CALLBACK_MODE_ENTER).sendToTarget();
9155:                 getDefaultPhone().getSubId(), callingPackage, callingFeatureId,
9178:         PhoneCapability staticCapability =
9284:             int phoneCount = TelephonyManager.getDefault().getPhoneCount();
9286:             int[] logicalSlotsMapping = new int[phoneCount];
9439:         SmsPermissions permissions = new SmsPermissions(getDefaultPhone(), mApp,
9465:             return SubscriptionManager.getResourcesForSubId(getDefaultPhone().getContext(), subId)
9482:             return SubscriptionManager.getResourcesForSubId(getDefaultPhone().getContext(), subId)
9551:                     ImsPhone imsPhone = (ImsPhone) defaultPhone;
9553:                             (ImsPhoneCallTracker) imsPhone.getCallTracker();
9555:                     Rlog.i(LOG_TAG, "setCepEnabled isCepEnabled=" + isCepEnabled + ", for imsPhone "
9556:                             + imsPhone.getMsisdn());
9694:         // *  Inherited from PhoneWindowManager  *
9792:      * Attempts to set the radio power state for all phones for thermal reason.
9795:      * PhoneInternalInterface#setRadioPowerForReason} for more details.
9917:         if (!getThermalMitigationAllowlist(getDefaultPhone().getContext())
10344:             Arrays.stream(PhoneFactory.getPhones()).forEach(
10347:                         if (thePhone != null && thePhone instanceof ImsPhone) {
10348:                             ImsPhone imsPhone = (ImsPhone) thePhone;
10349:                             CallTracker tracker = imsPhone.getCallTracker();
10429:             return getDefaultPhone().getMobileProvisioningUrl();
10444:             return EabUtil.getContactFromEab(getDefaultPhone().getContext(), contact);
10459:             return EabUtil.getCapabilityFromEab(getDefaultPhone().getContext(), contact);
10474:             return EabUtil.removeContactFromEab(subId, contacts, getDefaultPhone().getContext());
10725:      * @return the PhoneCapability which describes the data connection capability of modem.
149: import com.android.internal.telephony.DefaultPhoneNotifier;
542:                             getPhoneFromRequest(request).handlePinMmi((String) request.argument)
906:                     getPhoneFromRequest(request).getAllowedNetworkTypesBitmask(onCompleted);
936:                     getPhoneFromRequest(request).setAllowedNetworkTypes(
963:                     getPhoneFromRequest(request).setVoiceMailNumber(tagNum.first, tagNum.second,
975:                     getPhoneFromRequest(request).setNetworkSelectionModeAutomatic(onCompleted);
985:                     getPhoneFromRequest(request).getAvailableNetworks(onCompleted);
1098:                     getPhoneFromRequest(request).getCallWaiting(onCompleted);
1144:                     getPhoneFromRequest(request).setCallWaiting(enable, onCompleted);
1210:                     getPhoneFromRequest(request).selectNetworkManually(selArg.operatorInfo,
1418:                     getPhoneFromRequest(request).getNetworkSelectionMode(onCompleted);
1439:                     getPhoneFromRequest(request).queryCdmaRoamingPreference(onCompleted);
1455:                     getPhoneFromRequest(request).setCdmaRoamingPreference(mode, onCompleted);
1466:                     getPhoneFromRequest(request).queryCdmaSubscriptionMode(onCompleted);
1482:                     getPhoneFromRequest(request).setCdmaSubscriptionMode(
1601:                         mPhoneConfigurationManager.addToPhoneStatusCache(id,
1724:                     getPhoneFromRequest(request).getIccCard().changeIccLockPassword(
1747:                     getPhoneFromRequest(request).getIccCard().setIccLockEnabled(
2202:             return getPhoneFromSubId(request.subId);
2460:                 UiccController.getInstance().getPinStorage().storePin(pin, mPhoneId);
2541:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
2616:             for (int i = 0; i < TelephonyManager.getDefault().getPhoneCount(); i++) {
2633:             for (int i = 0; i < TelephonyManager.getDefault().getPhoneCount(); i++) {
2635:                 shutdownRadioUsingPhoneId(i);
2805:             if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp, subId, callingPackage,
3185:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
3349:         return getActivePhoneTypeForSlot(getSlotForDefaultSubscription());
3379:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
3412:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
3443:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
3586:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
3754:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
3814:                     .enforceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3851:         TelephonyPermissions.enforceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3877:         TelephonyPermissions.enforceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3933:         TelephonyPermissions.enforceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3973:         TelephonyPermissions.enforceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3998:         TelephonyPermissions.enforceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
4100:         TelephonyPermissions.enforceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
4138:         TelephonyPermissions.enforceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
4175:         TelephonyPermissions.enforceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
4213:         TelephonyPermissions.enforceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
4258:         TelephonyPermissions.enforceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
4311:         TelephonyPermissions.enforceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
4397:         TelephonyPermissions.enforceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
4479:         checkModifyPhoneStatePermission(subId, "setRcsProvisioningStatusForCapability");
4545:         checkModifyPhoneStatePermission(subId, "setImsProvisioningStatusForCapability");
4926:                 && !TelephonyPermissions.checkCallingOrSelfReadPhoneStateNoThrow(
4960:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
4985:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
5078:         return mSubscriptionController.getPhoneId(getDefaultSubscription());
5140:         return iccOpenLogicalChannelWithPermission(getPhoneFromSubId(subId), callingPackage, aid,
5153:         return iccOpenLogicalChannelWithPermission(getPhoneFromSlotIdOrThrowException(slotIndex),
5188:         return iccCloseLogicalChannelWithPermission(getPhoneFromSubId(subId), channel);
5195:         return iccCloseLogicalChannelWithPermission(getPhoneFromSlotIdOrThrowException(slotIndex),
5224:         return iccTransmitApduLogicalChannelWithPermission(getPhoneFromSubId(subId), channel, cla,
5238:                 getPhoneFromSlotIdOrThrowException(slotIndex), channel, cla, command, p1, p2, p3,
5277:         return iccTransmitApduBasicChannelWithPermission(getPhoneFromSubId(subId), callingPackage,
5293:                 getPhoneFromSlotIdOrThrowException(slotIndex), callingPackage, cla, command, p1,
5378:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
5416:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp, subId, callingPackage,
5820:                 .enforceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
5960:                     .enforceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
6315:                 .enforceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
6340:         TelephonyPermissions.enforceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
6344:             return getPhoneFromSubId(subId).getAllowedNetworkTypes(reason);
6393:                 .enforceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
6439:         if (allowedNetworkTypes == getPhoneFromSubId(subId).getAllowedNetworkTypes(reason)) {
6772:         for (int i = 0; i < TelephonyManager.getDefault().getPhoneCount(); i++) {
6840:         enforceReadPrivilegedPermission("getPackagesWithCarrierPrivilegesForAllPhones");
6846:             for (int i = 0; i < TelephonyManager.getDefault().getPhoneCount(); i++) {
6967:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneNumber(
6994:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
7017:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
7212:                     .enforceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
7225:                     .enforceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
7367:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
7386:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
7523:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp, getDefaultSubscription(),
7524:                 callingPackage, callingFeatureId, "getSubIdForPhoneAccountHandle")) {
7538:                 .enforceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
7541:                 "getPhoneAccountHandleForSubscriptionId, " + "subscriptionId: " + subscriptionId);
7787:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
8319:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
8501:             TelephonyPermissions.enforceCallingOrSelfReadPhoneStatePermissionOrCarrierPrivilege(
8546:                 .enforceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
8674:                         slot.getPhoneId(),
8815:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
8823:             return mPhoneConfigurationManager.getNumberOfModemsWithSimultaneousDataConnections();
8832:                 .enforceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
8859:                 .enforceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
8886:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
8913:                     .enforceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
9119:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
9154:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp,
9179:                 mPhoneConfigurationManager.getStaticPhoneCapability();
9219:             mPhoneConfigurationManager.switchMultiSimConfig(numOfSims);
9259:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
9266:             return mPhoneConfigurationManager.isRebootRequiredForModemConfigChange();
9275:         metrics.updateEnabledModemBitmap((1 << TelephonyManager.from(mApp).getPhoneCount()) - 1);
9289:                 if (SubscriptionManager.isValidPhoneId(slotInfos[i].getLogicalSlotIdx())) {
9404:                 .enforceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
9425:                 SubscriptionManager.getPhoneId(subId), UiccController.APP_FAM_3GPP);
9552:                     ImsPhoneCallTracker imsPhoneCallTracker =
9554:                     imsPhoneCallTracker.setConferenceEventPackageEnabled(isCepEnabled);
9722:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
9802:         boolean isPhoneAvailable = false;
9807:                 isPhoneAvailable = true;
9813:         return isPhoneAvailable;
9975:                         } else if (isAnyPhoneInEmergencyState()) {
10350:                             if (tracker != null && tracker instanceof ImsPhoneCallTracker) {
10351:                                 ImsPhoneCallTracker imsPhoneCallTracker =
10352:                                         (ImsPhoneCallTracker) tracker;
10353:                                 imsPhoneCallTracker.setDeviceToDeviceForceEnabled(isForceEnabled);
10731:         enforceReadPrivilegedPermission("getPhoneCapability");
10734:             return mPhoneConfigurationManager.getCurrentPhoneCapability();
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, ]
135: public abstract class Phone extends Handler implements PhoneInternalInterface {
535:     protected Phone(String name, PhoneNotifier notifier, Context context, CommandsInterface ci,
552:     protected Phone(String name, PhoneNotifier notifier, Context context, CommandsInterface ci,
352:     protected Phone mImsPhone = null;
632:     public void createImsPhone() {
3959:     public Phone getImsPhone() {
4631:     public Phone getDefaultPhone() {
214:     protected static final int EVENT_UPDATE_PHONE_OBJECT            = 42;
317:     protected boolean mIsPhoneInEcmState = false;
349:     protected int mPhoneId;
475:     public String getPhoneName() {
479:     protected void setPhoneName(String name) {
1845:     public void updatePhoneObject(int voiceRadioTech) {
2989:     public abstract int getPhoneType();
4091:     public int getPhoneId() {
4099:     public int getVoicePhoneServiceState() {
125:  * A base implementation for the com.android.internal.telephony.Phone interface.
127:  * Note that implementations of Phone.java are expected to be used
136:     private static final String LOG_TAG = "Phone";
265:      * This method is invoked when the Phone exits Emergency Callback Mode.
315:     // Keep track of whether or not the phone is in Emergency Callback Mode for Phone and
470:      * Returns a string identifier for this phone interface for parties
471:      *  outside the phone app process.
526:      * Constructs a Phone in normal (non-unit test) mode.
537:         this(name, notifier, context, ci, unitTestMode, SubscriptionManager.DEFAULT_PHONE_INDEX,
542:      * Constructs a Phone in normal (non-unit test) mode.
550:      * @param phoneId the phone-id of this phone.
578:         * (i.e. voice) phone calls over the telephony network, and is allowed
606:         if (getPhoneType() == PhoneConstants.PHONE_TYPE_IMS) {
621:         if (getPhoneType() != PhoneConstants.PHONE_TYPE_SIP) {
633:         if (getPhoneType() == PhoneConstants.PHONE_TYPE_SIP) {
637:         synchronized(Phone.lockForRadioTechnologyChange) {
700:         // messages to be handled whether or not the phone is being destroyed
702:         // resources of the phone being destroyed
754:                         // redial happened over that Phone so that it can be replaced with the
831:         Phone imsPhone = mImsPhone;
870:      * Gets the context for the phone, as set at initialization time.
926:      * Subclasses of Phone probably want to replace this with a
952:      * Subclasses of Phone probably want to replace this with a
976:      * Subclasses of Phone probably want to replace this with a
988:      * Notify the phone that an SMS has been sent. This will be used determine if the SMS was sent
1002:      * Determine if the Phone has recently sent an emergency SMS and is still in the interval of
1043:     protected void migrateFrom(Phone from) {
1056:         // The emergency state of IMS phone will be cleared in ImsPhone#notifySrvccState after
1119:      *   Connection.getCall() == Phone.getRingingCall()
1139:      * Notifies when phone's video capabilities changes <p>
1144:      *  AsyncResult.result = true if phone supports video calling <p>
1283:      * Example: If Phone.dial is called with "*#31#", then the app will
1606:      * For unit tests; don't send notifications to "Phone"
1623:      * Subclasses of Phone probably want to replace this with a
1728:         // no need for regular phone
1732:      * Subclasses of Phone probably want to replace this with a
1744:      * we send out a final ServiceState update when a phone's subId becomes invalid.
1754:      * If this is a simulated phone interface, returns a SimulatedRadioControl.
1768:      * the thread that originally obtained this Phone instance.
1773:                     "com.android.internal.telephony.Phone must be used from within one thread");
1805:      * If the phone has an active call and call waiting occurs,
1806:      * then the phone state is RINGING not OFFHOOK
1815:      * Retrieves the IccFileHandler of the Phone instance
1834:      * Retrieves the Handler of the Phone instance
1841:      * Update the phone object if the voice radio technology has changed
1849:     * Retrieves the ServiceStateTracker of the phone instance.
1864:                 .contains(Phone.RADIO_POWER_REASON_THERMAL);
1868:      * Retrieves the EmergencyNumberTracker of the phone instance.
1890:      * Retrieves the DeviceStateMonitor of the phone instance.
1897:      * Retrieves the DisplayInfoController of the phone instance.
1904:      * Retrieves the SignalStrengthController of the phone instance.
1953:      * Returns the ICC card interface for this phone, or null
1959:         //throw new Exception("getIccCard Shouldn't be called from Phone");
2146:         if (getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA) {
2559:      * - {@link com.android.internal.telephony.Phone#TTY_MODE_OFF}
2560:      * - {@link com.android.internal.telephony.Phone#TTY_MODE_FULL}
2561:      * - {@link com.android.internal.telephony.Phone#TTY_MODE_HCO}
2562:      * - {@link com.android.internal.telephony.Phone#TTY_MODE_VCO}
2573:      * - {@link com.android.internal.telephony.Phone#TTY_MODE_OFF}
2574:      * - {@link com.android.internal.telephony.Phone#TTY_MODE_FULL}
2575:      * - {@link com.android.internal.telephony.Phone#TTY_MODE_HCO}
2576:      * - {@link com.android.internal.telephony.Phone#TTY_MODE_VCO}
2894:     // This property is used to handle phone process crashes, and is the same for CDMA and IMS
2901:      * @return {@code true} if we are in emergency call back mode. This is a period where the phone
2921:      * @return true if this Phone is in an emergency call that caused emergency callback mode to be
2929:      * Set whether or not this Phone has an active emergency call that was placed during emergency
2985:      * Return a numerical identifier for the phone radio interface.
2986:      * @return PHONE_TYPE_XXX as defined above.
2999:     /** sets the voice mail count of the phone and notifies listeners. */
3650:         // Populate the iccid, imei and phone number in the provisioning url.
3659:                     phoneNumber /* Phone number */);
3780:      * Subclasses of Phone probably want to replace this with a
3798:      * Notify registrants if phone is video capable.
3912:         Rlog.e(LOG_TAG, "Error! This function should never be executed, inactive Phone.");
3925:      * Gets the Uicc card corresponding to this phone.
3926:      * @return the UiccCard object corresponding to the phone ID.
3956:      * Return an instance of a IMS phone
4088:      * Returns the phone id.
4100:         Phone imsPhone = mImsPhone;
4174:         Phone imsPhone = mImsPhone;
4193:         Phone imsPhone = mImsPhone;
4207:         Phone imsPhone = mImsPhone;
4231:         Phone imsPhone = mImsPhone;
4241:      * @return the IMS MmTel Registration technology for this Phone, defined in
4245:         Phone imsPhone = mImsPhone;
4255:      * Get the IMS MmTel Registration technology for this Phone, defined in
4259:         Phone imsPhone = mImsPhone;
4268:      * Asynchronously get the IMS MmTel Registration state for this Phone.
4271:         Phone imsPhone = mImsPhone;
4330:      *  Set phone radio capability
4332:      *  @param rc the phone radio capability defined in
4341:      *  Get phone radio access family
4361:      *  Get phone radio capability
4375:      *  @param rc the phone radio capability currently in effect for this phone.
4390:         // When radio capability switch is done, query IMEI value and update it in Phone objects
4409:      * Registers the handler when phone radio  capability is changed.
4420:      * Unregister for notifications when phone radio type and access technology is changed.
4441:      * Determines if video calling is enabled for the phone.
4447:         Phone imsPhone = mImsPhone;
4586:     public static void checkWfcWifiOnlyModeBeforeDial(Phone imsPhone, int phoneId, Context context)
4626:      * This function returns the parent phone of the current phone. It is applicable
4627:      * only for IMS phone (function is overridden by ImsPhone). For others the phone
4665:      * none of the phone is in service, and one of them has the capability to make the emergency
4672:         for (Phone phone : PhoneFactory.getPhones()) {
4673:             if (phone != null) {
4674:                 ServiceStateTracker sst = phone.getServiceStateTracker();
4737:     /** Returns the {@link VoiceCallSessionStats} for this phone ID. */
4742:     /** Sets the {@link VoiceCallSessionStats} mock for this phone ID during unit testing. */
4748:     /** Returns the {@link SmsStats} for this phone ID. */
4753:     /** Sets the {@link SmsStats} mock for this phone ID during unit testing. */
4832:      * Returns the InboundSmsHandler object for this phone
4839:         pw.println("Phone: subId=" + getSubId());
5026:         pw.println("Phone Local Log: ");
53: import android.telephony.PhoneStateListener;
85: import com.android.internal.telephony.imsphone.ImsPhoneCall;
129:  * originally called PhoneFactory to obtain the interface.
441:      * PhoneNotifier is an abstraction for all system-wide
446:     protected PhoneNotifier mNotifier;
484:      * Retrieves Nai for phones. Returns null if Nai is not set.
553:                     boolean unitTestMode, int phoneId,
555:         mPhoneId = phoneId;
592:          * By default old phones won't have the property set but do generate
629:      * Start setup of ImsPhone, which will start trying to connect to the ImsResolver. Will not be
638:             if (mImsPhone == null) {
639:                 mImsPhone = PhoneFactory.makeImsPhone(mNotifier, this);
640:                 CallManager.getInstance().registerPhone(mImsPhone);
641:                 mImsPhone.registerForSilentRedial(
716:                     PhoneConstants.State state = getState();
718:                             && ((state == PhoneConstants.State.RINGING) ||
719:                                     (state == PhoneConstants.State.IDLE))) {
730:                 if (getState() == PhoneConstants.State.RINGING) {
740:                 // This is an ImsPhone -> GsmCdmaPhone redial
741:                 // See ImsPhone#initiateSilentRedial
752:                         // The ImsPhoneConnection that is owned by the ImsPhone is currently the
757:                         if (mImsPhone != null) {
759:                             mImsPhone.notifyRedialConnectionChanged(cn);
763:                         if (mImsPhone != null) {
764:                             mImsPhone.notifyRedialConnectionChanged(null);
838:                     if (imsPhone != null) {
839:                         conn = imsPhone.getHandoverConnection();
840:                         migrateFrom(imsPhone);
842:                         Rlog.d(LOG_TAG, "HANDOVER_STARTED: mImsPhone null");
847:                     if (imsPhone != null) {
848:                         imsPhone.notifySrvccState(srvccState);
850:                         Rlog.d(LOG_TAG, "HANDOVER_COMPLETED: mImsPhone null");
903:      * {@link PhoneConstants.State} which can be obtained using the {@link PhoneStateListener}
1073:             // Since CallManager has already registered with both CS and IMS phones,
1812:     public abstract PhoneConstants.State getState();
2029:      * Sets the minimum time in milli-seconds between {@link PhoneStateListener#onCellInfoChanged
2030:      * PhoneStateListener.onCellInfoChanged} will be invoked.
2045:      * available on this interface. Use PhoneStateNotifier or similar instead.
2141:      * available on this interface. Use PhoneStateNotifier or similar instead.
2192:      * interface. Use <code>PhoneStateNotifier</code> or an equivalent.
2811:     public PhoneConstants.DataState getDataConnectionState(String apnType) {
2812:         return PhoneConstants.DataState.DISCONNECTED;
2895:     // phones
2975:         if (mImsPhone != null) {
2976:             isPresent = isVideoCallOrConference(mImsPhone.getForegroundCall()) ||
2977:                     isVideoCallOrConference(mImsPhone.getBackgroundCall()) ||
2978:                     isVideoCallOrConference(mImsPhone.getRingingCall());
3120:      * Retrieves the MIN for CDMA phones.
3136:      *  Retrieves PRL Version for CDMA phones
3652:             String phoneNumber = getLine1Number();
3653:             if (TextUtils.isEmpty(phoneNumber)) {
3654:                 phoneNumber = "0000000000";
3874:      * Retrieves the MSISDN from the UICC. For GSM/UMTS phones, this is equivalent to
3875:      * {@link #getLine1Number()}. For CDMA phones, {@link #getLine1Number()} returns
3876:      * the MDN, so this method is provided to return the MSISDN on CDMA/LTE phones.
3884:      * Retrieves the EF_PNN from the UICC For GSM/UMTS phones.
3893:      * {@link android.telephony.PhoneStateListener} instead.
3896:     public PhoneConstants.DataState getDataConnectionState() {
3911:         // This function should be overridden by class GsmCdmaPhone.
3960:         return mImsPhone;
4035:      * Return if UT capability of ImsPhone is enabled or not
4039:         if (mImsPhone != null) {
4040:             return mImsPhone.isUtEnabled();
4059:         // dialInternal shall be overriden by GsmCdmaPhone
4064:      * This function is for CSFB SS. GsmCdmaPhone overrides this function.
4096:      * Return the service state of mImsPhone if it is STATE_IN_SERVICE
4101:         if (imsPhone != null
4102:                 && imsPhone.getServiceState().getState() == ServiceState.STATE_IN_SERVICE) {
4176:         if (imsPhone != null) {
4177:             isImsRegistered = imsPhone.isImsRegistered();
4195:         if (imsPhone != null) {
4196:             isWifiCallingEnabled = imsPhone.isWifiCallingEnabled();
4209:         if (imsPhone != null) {
4210:             isAvailable = imsPhone.isImsCapabilityAvailable(capability, regTech);
4233:         if (imsPhone != null) {
4234:             isVolteEnabled = imsPhone.isVoiceOverCellularImsEnabled();
4247:         if (imsPhone != null) {
4248:             regTech = imsPhone.getImsRegistrationTech();
4260:         if (imsPhone != null) {
4261:             imsPhone.getImsRegistrationTech(callback);
4272:         if (imsPhone != null) {
4273:             imsPhone.getImsRegistrationState(callback);
4433:         if (mImsPhone == null) {
4437:         return mImsPhone.isImsAvailable();
4448:         if (imsPhone != null) {
4449:             return imsPhone.isVideoEnabled();
4588:         if (imsPhone == null || !imsPhone.isWifiCallingEnabled()) {
4589:             ImsManager imsManager = ImsManager.getInstance(context, phoneId);
4878:         if (mImsPhone != null) {
4880:                 mImsPhone.dump(fd, pw, args);
442:      * state change notification. DefaultPhoneNotifier is
528:      * @param notifier An instance of DefaultPhoneNotifier,
544:      * @param notifier An instance of DefaultPhoneNotifier,
2776:         // This function is added to send the notification to DefaultPhoneNotifier.
2906:         return mIsPhoneInEcmState;
2917:         mIsPhoneInEcmState = isInEcm;
2961:         if (call instanceof ImsPhoneCall) {
2962:             ImsPhoneCall imsPhoneCall = (ImsPhoneCall) call;
2963:             ImsCall imsCall = imsPhoneCall.getImsCall();
3017:                 mPhoneId, UiccController.APP_FAM_3GPP);
3850:      * A fucntion of type getPhoneProp(propType) where propType is an
3930:         return mUiccController.getUiccCard(mPhoneId);
4084:         return SubscriptionController.getInstance().getSubIdUsingPhoneId(mPhoneId);
4092:         return mPhoneId;
4840:         pw.println(" mPhoneId=" + mPhoneId);
4867:         pw.println(" getPhoneName()=" + getPhoneName());
4868:         pw.println(" getPhoneType()=" + getPhoneType());
5039:         Rlog.d(LOG_TAG, "[" + mPhoneId + "] " + s);
5043:         Rlog.i(LOG_TAG, "[" + mPhoneId + "] " + s);
5047:         Rlog.e(LOG_TAG, "[" + mPhoneId + "] " + s);
android.googlesource.com/platform/external/guice:examples/src/example/xml/Phone.java: [ master, ]
3: public class Phone {
android.googlesource.com/platform/frameworks/proto_logging:stats/atoms.proto: [ master, ]
7834:         PHONE = 9;
144:         PhoneSignalStrengthChanged phone_signal_strength_changed =
205:         PhoneServiceStateChanged phone_service_state_changed = 94 [(module) = "framework"];
206:         PhoneStateChanged phone_state_changed = 95 [(module) = "framework"];
3266:         HARDWARE_FAILED_MICROPHONE = 1;
3436: message PhoneSignalStrengthChanged {
3448: message PhoneServiceStateChanged {
3460: message PhoneStateChanged {
16622:         MICROPHONE = 1;
3595:         HEADPHONE_RESUME_MEDIA = 8;
3596:         HEADPHONE_MEDIA_RECOMMENDATIONS = 9;
16582:         MICROPHONE_ACCESS_TIMELINE_VIEWED = 4;
1930:  *   frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1935:         // The keyguard is hidden when the phone is unlocked.
1937:         // The keyguard is shown when the phone is locked (screen turns off).
1951:  *   frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
3431:  * Logs phone signal strength changes.
3443:  * Logs when the phone state, sim state or signal strength changes
3455:  * Logs when the phone becomes on or off.
3521:                 statusbar/phone/NavigationBarView.java
4434:  *      frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
13327:         // The phone was flipped before the screen turns off.
14848:     // The orientation of the phone after rotation before going through the recommendation service.
2098:     // For multi-sim phones, this distinguishes between the sim cards.
2120:     // For multi-sim phones, this distinguishes between the sim cards.
7619:  * time_in_state files not being present on some phones, have not been addressed. These should be
9318:  * Track how we arbitrate between microphone/input requests.
9333:  * Track how we arbitrate between microphone requests.
9353:  * Track how we arbitrate between microphone/input requests.
9368:  * Track how we arbitrate between microphone/input requests.
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/external/valgrind:include/vki/vki-linux.h: [ master, ]
1643:   char phone[VKI_ISDN_MSNLEN];
1645: } vki_isdn_net_ioctl_phone;
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";