Found 23264 results in 3790 files, showing top 50 files (show more).
android.googlesource.com/platform/packages/services/Telephony:src/com/android/phone/PhoneInterfaceManager.java: [ master, ]
384:         public Phone phone;
17: package com.android.phone;
200: 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) {
5947:     public int checkCarrierPrivilegesForPackageAnyPhone(String pkgName) {
5970:     public List<String> getCarrierPackageNamesForIntentAndPhone(Intent intent, int phoneId) {
6428:     public boolean isWorldPhone(int subId, String callingPackage, String callingFeatureId) {
310:     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) {
6014:     public List<String> getPackagesWithCarrierPrivilegesForAllPhones() {
6554:     public int getSubIdForPhoneAccount(PhoneAccount phoneAccount) {
6564:     public int getSubIdForPhoneAccountHandle(
6579:     public @Nullable PhoneAccountHandle getPhoneAccountHandleForSubscriptionId(int subscriptionId) {
21: import static com.android.internal.telephony.PhoneConstants.PHONE_TYPE_IMS;
142: import com.android.internal.telephony.Phone;
176: import com.android.phone.settings.PickSmsSubscriptionActivity;
177: import com.android.phone.vvm.PhoneAccountHandleConverter;
178: import com.android.phone.vvm.RemoteVvmTaskManager;
179: import com.android.phone.vvm.VisualVoicemailSettingsUtil;
180: 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();
5291:             final Phone phone = getPhone(subId);
5292:             if (phone == null) {
5295:             OperatorInfo networkSelection = phone.getSavedNetworkSelection();
5297:                 ? phone.getManualNetworkSelectionPlmn() : networkSelection.getOperatorNumeric();
5507:         final Phone defaultPhone = getDefaultPhone();
5693:         final Phone phone = getPhone(subId);
5695:             if (phone != null) {
5696:                 return phone.hasMatchedTetherApnSetting();
5720:             Phone phone = PhoneFactory.getPhone(phoneId);
5721:             if (phone != null) {
5723:                 phone.getDataEnabledSettings().setUserDataEnabled(enable);
5725:                 loge("setUserDataEnabled: no phone found. Invalid subId=" + subId);
5743:         final Phone phone = getPhone(subId);
5745:             if (phone != null) {
5750:                 phone.setAlwaysReportSignalStrength(isEnable);
5752:                 loge("setAlwaysReportSignalStrength: no phone found for subId="
5781:      * Accepts either ACCESS_NETWORK_STATE, MODIFY_PHONE_STATE or carrier privileges.
5799:             Phone phone = PhoneFactory.getPhone(phoneId);
5800:             if (phone != null) {
5801:                 boolean retVal = phone.isUserDataEnabled();
5805:                 if (DBG) loge("isUserDataEnabled: no phone subId=" + subId + " retVal=false");
5828:             Phone phone = PhoneFactory.getPhone(phoneId);
5829:             if (phone != null) {
5830:                 boolean retVal = phone.getDataEnabledSettings().isDataEnabled();
5834:                 if (DBG) loge("isDataEnabled: no phone subId=" + subId + " retVal=false");
5843:             Phone phone) {
5844:         if (uid == Process.SYSTEM_UID || uid == Process.PHONE_UID) {
5854:         PackageManager pkgMgr = phone.getContext().getPackageManager();
5859:             SubscriptionInfo subInfo = subController.getSubscriptionInfo(phone.getSubId());
5861:                     phone.getContext().getSystemService(Context.TELEPHONY_SUBSCRIPTION_SERVICE);
5873:     private int getCarrierPrivilegeStatusFromCarrierConfigRules(int privilegeFromSim, Phone phone,
5882:             SubscriptionInfo subInfo = subController.getSubscriptionInfo(phone.getSubId());
5884:                     phone.getContext().getSystemService(Context.TELEPHONY_SUBSCRIPTION_SERVICE);
5894:         final Phone phone = getPhone(subId);
5895:         if (phone == null) {
5899:         UiccCard card = UiccController.getInstance().getUiccCard(phone.getPhoneId());
5907:                 phone.getContext().getPackageManager()), Binder.getCallingUid(), phone);
5913:         final Phone phone = getPhone(subId);
5914:         if (phone == null) {
5919:                 UiccController.getInstance().getUiccProfileForPhone(phone.getPhoneId());
5926:                         phone.getContext().getPackageManager(), uid), uid, phone);
6031:         final Phone phone = getPhone(subId);
6032:         UiccCard card = phone == null ? null : phone.getUiccCard();
6054:             final Phone phone = getPhone(subId);
6055:             if (phone == null) {
6058:             final String subscriberId = phone.getSubscriberId();
6281:             final Phone phone = getPhone(subId);
6282:             return phone == null ? false : phone.setOperatorBrandOverride(brand);
6297:             final Phone phone = getPhone(subId);
6298:             if (phone == null) {
6301:             return phone.setRoamingOverride(gsmRoamingList, gsmNonRoamingList, cdmaRoamingList,
6352:         Phone phone = PhoneFactory.getPhone(phoneId);
6354:         if (phone == null) {
6361:                             mApp, phone.getSubId(), "getRadioAccessFamily");
6371:         final Phone defaultPhone = getDefaultPhone();
6385:         final Phone defaultPhone = getDefaultPhone();
6439:                     .getBoolean(CarrierConfigManager.KEY_WORLD_PHONE_BOOL);
6470:         final Phone phone = getPhone(subscriptionId);
6471:         if (phone == null) {
6472:             loge("isRttSupported: no Phone found. Invalid subId:" + subscriptionId);
6479:                     phone.getContext().getResources().getBoolean(R.bool.config_support_rtt);
6512:      * Returns the unique device ID of phone, for example, the IMEI for
6516:      *   {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
6520:         final Phone phone = PhoneFactory.getPhone(0);
6521:         if (phone == null) {
6524:         int subId = phone.getSubId();
6532:             return phone.getDeviceId();
6545:         Phone phone = getPhone(subId);
6546:         if (phone != null) {
6547:             return phone.isImsRegistered();
6568:             throw new SecurityException("Requires READ_PHONE_STATE permission.");
6584:             Phone phone = getPhone(subscriptionId);
6585:             if (phone == null) {
6588:             return PhoneUtils.makePstnPhoneAccountHandle(phone);
6600:             Phone phone = getPhone(subId);
6601:             if (phone != null) {
6602:                 return phone.isWifiCallingEnabled();
6617:             Phone phone = getPhone(subId);
6618:             if (phone != null) {
6619:                 return phone.isVideoEnabled();
6635:             Phone phone = getPhone(subId);
6636:             if (phone != null) {
6637:                 return phone.getImsRegistrationTech();
6695:         final Phone phone = getPhone(subId);
6696:         if (phone == null) {
6703:                     phone.getContext().getOpPackageName(), phone.getContext().getAttributionTag());
6712:             final Locale localeFromDefaultSim = phone.getLocaleFromSimAndCarrierPrefs();
6840:             final Phone phone = getPhone(subId);
6841:             if (phone == null) {
6845:             ServiceState ss = phone.getServiceState();
6858:      * Returns the URI for the per-account voicemail ringtone set in Phone settings.
6869:             Phone phone = PhoneUtils.getPhoneForPhoneAccountHandle(accountHandle);
6870:             if (phone == null) {
6871:                 phone = getDefaultPhone();
6874:             return VoicemailNotificationSettingsUtil.getRingtoneUri(phone.getContext());
6884:      * has permission {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}.
6894:         final Phone defaultPhone = getDefaultPhone();
6905:             Phone phone = PhoneUtils.getPhoneForPhoneAccountHandle(phoneAccountHandle);
6906:             if (phone == null) {
6907:                 phone = defaultPhone;
6909:             VoicemailNotificationSettingsUtil.setRingtoneUri(phone.getContext(), uri);
6916:      * Returns whether vibration is set for voicemail notification in Phone settings.
6926:             Phone phone = PhoneUtils.getPhoneForPhoneAccountHandle(accountHandle);
6927:             if (phone == null) {
6928:                 phone = getDefaultPhone();
6931:             return VoicemailNotificationSettingsUtil.isVibrationEnabled(phone.getContext());
6941:      * has permission {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}.
6951:         final Phone defaultPhone = getDefaultPhone();
6962:             Phone phone = PhoneUtils.getPhoneForPhoneAccountHandle(phoneAccountHandle);
6963:             if (phone == null) {
6964:                 phone = defaultPhone;
6966:             VoicemailNotificationSettingsUtil.setVibrationEnabled(phone.getContext(), enabled);
6973:      * Make sure either called from same process as self (phone) or IPC caller has read privilege.
6978:         mApp.enforceCallingOrSelfPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE,
6983:      * Make sure either called from same process as self (phone) or IPC caller has send SMS
7026:         Phone phone = getPhone(subId);
7030:             if (phone == null) {
7035:                 aid = UiccController.getInstance().getUiccCard(phone.getPhoneId())
7055:         Phone phone = getPhone(subId);
7059:             if (phone == null) {
7064:                 esn = phone.getEsn();
7083:         Phone phone = getPhone(subId);
7087:             if (phone == null) {
7092:                 cdmaPrlVersion = phone.getCdmaPrlVersion();
7186:         final Phone phone = getPhone(subId);
7189:         if (phone == null) {
7194:             phone.carrierActionSetMeteredApnsEnabled(enabled);
7211:         final Phone phone = getPhone(subId);
7214:         if (phone == null) {
7219:             phone.carrierActionSetRadioEnabled(enabled);
7239:         final Phone phone = getPhone(subId);
7242:         if (phone == null) {
7247:             phone.carrierActionReportDefaultNetworkStatus(report);
7263:         final Phone phone = getPhone(subId);
7264:         if (phone == null) {
7269:             phone.carrierActionResetAll();
7276:      * Called when "adb shell dumpsys phone" is invoked. Dump is also automatically invoked when a
7283:             writer.println("Permission Denial: can't dump Phone from pid="
7314:             Phone phone = getPhone(subId);
7315:             if (phone != null) {
7316:                 phone.getDataEnabledSettings().setPolicyDataEnabled(enabled);
7335:         Phone phone = getPhone(subId);
7339:             if (phone != null) {
7340:                 return phone.getClientRequestStats();
7367:         Phone phone = PhoneFactory.getPhone(slotIndex);
7373:             if (phone != null) {
7374:                 phone.setSimPowerState(state, workSource);
7396:      * Check if phone is in emergency callback mode
7397:      * @return true if phone is in emergency callback mode
7403:         final Phone phone = getPhone(subId);
7407:             if (phone != null) {
7408:                 return phone.isInEcm();
7428:             Phone p = getPhone(subId);
7448:         Phone phone = PhoneFactory.getPhone(slotIndex);
7449:         if (phone != null) {
7450:             if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp, phone.getSubId(),
7457:                 return phone.getRadioPowerState();
7470:      * {@link android.Manifest.permission#READ_PHONE_STATE} or that the calling app has carrier
7490:             Phone phone = getPhone(subId);
7491:             isEnabled =  phone != null ? phone.getDataRoamingEnabled() : false;
7503:      * {@link android.Manifest.permission#MODIFY_PHONE_STATE} or that the calling app has carrier
7516:             Phone phone = getPhone(subId);
7517:             if (phone != null) {
7518:                 phone.setDataRoamingEnabled(isEnabled);
7534:             Phone phone = getPhone(subId);
7535:             if (phone != null) {
7536:                 isAllowed = phone.isCspPlmnEnabled();
7555:             // even without READ_PRIVILEGED_PHONE_STATE, we allow the call to continue if the caller
7692:      * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}.
7701:             Phone phone = getPhone(subId);
7702:             if (phone == null) {
7705:             UiccCard uiccCard = phone.getUiccCard();
7742:      * not set, return {@link Phone#PREFERRED_NT_MODE}.
7750:         return Phone.PREFERRED_NT_MODE;
7760:             final Phone phone = getPhone(subId);
7761:             if (phone == null) {
7765:             phone.setCarrierTestOverride(mccmnc, imsi, iccid, gid1, gid2, plmn, spn,
7778:             final Phone phone = getPhone(subId);
7779:             if (phone == null) {
7783:             return phone.getCarrierIdListVersion();
7852:             throw new SecurityException("Requires READ_PHONE_STATE permission.");
7857:             for (Phone phone: PhoneFactory.getPhones()) {
7858:                 if (phone.getEmergencyNumberTracker() != null
7859:                         && phone.getEmergencyNumberTracker().getEmergencyNumberList() != null) {
7861:                             phone.getSubId(),
7862:                             phone.getEmergencyNumberTracker().getEmergencyNumberList());
7873:         final Phone defaultPhone = getDefaultPhone();
7881:             for (Phone phone: PhoneFactory.getPhones()) {
7882:                 if (phone.getEmergencyNumberTracker() != null
7883:                         && phone.getEmergencyNumberTracker() != null) {
7884:                     if (phone.getEmergencyNumberTracker().isEmergencyNumber(
7906:             for (Phone phone: PhoneFactory.getPhones()) {
7907:                 EmergencyNumberTracker tracker = phone.getEmergencyNumberTracker();
7928:             for (Phone phone: PhoneFactory.getPhones()) {
7929:                 EmergencyNumberTracker tracker = phone.getEmergencyNumberTracker();
7948:             final Phone phone = getPhone(subId);
7949:             if (phone == null) {
7953:             return phone.getEmergencyNumberDbVersion();
7965:             for (Phone phone: PhoneFactory.getPhones()) {
7966:                 EmergencyNumberTracker tracker = phone.getEmergencyNumberTracker();
7982:             for (Phone phone: PhoneFactory.getPhones()) {
7983:                 EmergencyNumberTracker tracker = phone.getEmergencyNumberTracker();
7999:             for (Phone phone: PhoneFactory.getPhones()) {
8000:                 EmergencyNumberTracker tracker = phone.getEmergencyNumberTracker();
8013:         Phone phone = getPhone(subId);
8014:         if (phone == null) {
8020:                     .getUiccProfileForPhone(phone.getPhoneId());
8039:             Phone phone = PhoneFactory.getPhone(slotIndex);
8040:             if (phone == null) {
8043:                 return (Boolean) sendRequest(CMD_REQUEST_ENABLE_MODEM, enable, phone, null);
8056:         Phone phone = PhoneFactory.getPhone(slotIndex);
8057:         if (phone == null) return false;
8060:                 mApp, phone.getSubId(), callingPackage, callingFeatureId,
8062:             throw new SecurityException("Requires READ_PHONE_STATE permission.");
8068:                 return mPhoneConfigurationManager.getPhoneStatusFromCache(phone.getPhoneId());
8070:                 return (Boolean) sendRequest(CMD_GET_MODEM_STATUS, null, phone, null);
8138:      * Note: Switch from multi-sim to single-sim is only possible with MODIFY_PHONE_STATE
8139:      * permission, but the other way around is possible with either MODIFY_PHONE_STATE
8168:         Phone phone = getPhone(subId);
8169:         if (phone == null) {
8174:             UiccCard uiccCard = phone.getUiccCard();
8244:         Phone phone = getDefaultPhone();
8245:         if (phone == null) return -1;
8246:         HalVersion hv = phone.getHalVersion();
8276:         enforceReadPrivilegedPermission("Needs READ_PRIVILEGED_PHONE_STATE for "
8282:             Phone phone = getPhone(subId);
8283:             if (phone == null) return false;
8285:             boolean isMetered = ApnSettingUtils.isMeteredApnType(apnType, phone);
8286:             return !isMetered || phone.getDataEnabledSettings().isDataEnabled(apnType);
8299:             Phone phone = getPhone(subId);
8300:             if (phone == null) return true; // By default return true.
8302:             return ApnSettingUtils.isMeteredApnType(apnType, phone);
8314:             Phone phone = getPhone(subscriptionId);
8315:             if (phone == null) {
8335:             sendRequestAsync(CMD_SET_SYSTEM_SELECTION_CHANNELS, argument, phone, null);
8416:             Phone phone = getPhone(subId);
8417:             if (phone == null) return false;
8419:             return phone.getDataEnabledSettings().setAllowDataDuringVoiceCall(allow);
8432:             Phone phone = getPhone(subId);
8433:             if (phone == null) return false;
8435:             return phone.getDataEnabledSettings().isDataAllowedInVoiceCall();
8448:             Phone phone = getPhone(subId);
8449:             if (phone == null) return false;
8451:             return phone.getDataEnabledSettings().setAlwaysAllowMmsData(alwaysAllow);
8469:             for (Phone phone : PhoneFactory.getPhones()) {
8470:                 Phone defaultPhone = phone.getImsPhone();
8471:                 if (defaultPhone != null && defaultPhone.getPhoneType() == PHONE_TYPE_IMS) {
8516:             Phone phone = getPhone(subId);
8517:             if (phone != null && phone.getIccCard() != null) {
8518:                 return phone.getIccCard().getIccLockEnabled();
8542:         Phone phone = getPhone(subId);
8543:         if (phone == null) {
8550:                     new Pair<Boolean, String>(enabled, password), phone, null);
8574:         Phone phone = getPhone(subId);
8575:         if (phone == null) {
8582:                     new Pair<String, String>(oldPassword, newPassword), phone, null);
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;
143: import com.android.internal.telephony.PhoneConfigurationManager;
144: import com.android.internal.telephony.PhoneConstantConversions;
145: import com.android.internal.telephony.PhoneConstants;
146: import com.android.internal.telephony.PhoneFactory;
160: import com.android.internal.telephony.imsphone.ImsPhone;
161: import com.android.internal.telephony.imsphone.ImsPhoneCallTracker;
201:     private static final String LOG_TAG = "PhoneInterfaceManager";
202:     private static final boolean DBG = (PhoneGlobals.DBG_LEVEL >= 2);
300:     private static PhoneInterfaceManager sInstance;
302:     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);
5211:             getDefaultPhone().setImsRegistrationState(registered);
5447:                     request, messenger, binder, getPhone(subId),
5508:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp, defaultPhone.getSubId(),
5516:             return PhoneFactory.calculatePreferredNetworkType(defaultPhone.getContext(), 0);
5718:             int phoneId = mSubscriptionController.getPhoneId(subId);
5719:             if (DBG) log("setUserDataEnabled: subId=" + subId + " phoneId=" + phoneId);
5797:             int phoneId = mSubscriptionController.getPhoneId(subId);
5798:             if (DBG) log("isUserDataEnabled: subId=" + subId + " phoneId=" + phoneId);
5826:             int phoneId = mSubscriptionController.getPhoneId(subId);
5827:             if (DBG) log("isDataEnabled: subId=" + subId + " phoneId=" + phoneId);
5935:         int phoneId = SubscriptionManager.getPhoneId(subId);
5936:         UiccCard card = UiccController.getInstance().getUiccCard(phoneId);
5943:             getPhone(phoneId), pkgName);
5960:                 getPhone(i), pkgName);
5971:         if (!SubscriptionManager.isValidPhoneId(phoneId)) {
5972:             loge("phoneId " + phoneId + " is not valid.");
5975:         UiccCard card = UiccController.getInstance().getUiccCard(phoneId);
5977:             loge("getCarrierPackageNamesForIntentAndPhone: No UICC");
5984:     public List<String> getPackagesWithCarrierPrivileges(int phoneId) {
5988:         UiccCard card = UiccController.getInstance().getUiccCard(phoneId);
6351:     public int getRadioAccessFamily(int phoneId, String callingPackage) {
6362:             raf = ProxyController.getInstance().getRadioAccessFamily(phoneId);
6376:             ImsManager.getInstance(defaultPhone.getContext(),
6377:                     defaultPhone.getPhoneId()).setVtSetting(enable);
6386:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp, defaultPhone.getSubId(),
6398:                     ImsManager.getInstance(defaultPhone.getContext(), defaultPhone.getPhoneId());
6513:      * GSM and the MEID for CDMA phones. Return null if device ID is not available.
6557:             return PhoneUtils.getSubIdForPhoneAccount(phoneAccount);
6565:             PhoneAccountHandle phoneAccountHandle, String callingPackage, String callingFeatureId) {
6572:             return PhoneUtils.getSubIdForPhoneAccountHandle(phoneAccountHandle);
6668:             cleanUpSmsRawTable(getDefaultPhone().getContext());
6679:               sendEraseModemConfig(getDefaultPhone());
6860:      * @param accountHandle The handle for the {@link PhoneAccount} for which to retrieve the
6863:      * PhoneAccount.
6866:     public Uri getVoicemailRingtoneUri(PhoneAccountHandle accountHandle) {
6886:      * @param phoneAccountHandle The handle for the {@link PhoneAccount} for which to set the
6889:      * PhoneAccount.
6893:             PhoneAccountHandle phoneAccountHandle, Uri uri) {
6896:         TelecomManager tm = defaultPhone.getContext().getSystemService(TelecomManager.class);
6899:                     mApp, PhoneUtils.getSubIdForPhoneAccountHandle(phoneAccountHandle),
6918:      * @param accountHandle The handle for the {@link PhoneAccount} for which to retrieve the
6920:      * @return {@code true} if the vibration is set for this PhoneAccount, {@code false} otherwise.
6923:     public boolean isVoicemailVibrationEnabled(PhoneAccountHandle accountHandle) {
6943:      * @param phoneAccountHandle The handle for the {@link PhoneAccount} for which to set the
6946:      * specific PhoneAccount.
6950:             PhoneAccountHandle phoneAccountHandle, boolean enabled) {
6953:         TelecomManager tm = defaultPhone.getContext().getSystemService(TelecomManager.class);
6956:                     mApp, PhoneUtils.getSubIdForPhoneAccountHandle(phoneAccountHandle),
7297:         return new TelephonyShellCommand(this, getDefaultPhone().getContext()).exec(
7557:             if (checkCarrierPrivilegesForPackageAnyPhone(callingPackage)
7746:         int phoneId = mSubscriptionController.getPhoneId(subId);
7747:         if (phoneId >= 0 && phoneId < list.size() && list.get(phoneId) != null) {
7748:             return list.get(phoneId);
7877:                             mApp, defaultPhone.getSubId(), "isEmergencyNumber(Potential)");
8095:                 getDefaultPhone().getSubId(), callingPackage, callingFeatureId,
8118:         PhoneCapability staticCapability =
8224:             int phoneCount = TelephonyManager.getDefault().getPhoneCount();
8226:             int[] logicalSlotsMapping = new int[phoneCount];
8359:         SmsPermissions permissions = new SmsPermissions(getDefaultPhone(), mApp,
8385:             return SubscriptionManager.getResourcesForSubId(getDefaultPhone().getContext(), subId)
8402:             return SubscriptionManager.getResourcesForSubId(getDefaultPhone().getContext(), subId)
8472:                     ImsPhone imsPhone = (ImsPhone) defaultPhone;
8474:                             (ImsPhoneCallTracker) imsPhone.getCallTracker();
8476:                     Rlog.i(LOG_TAG, "setCepEnabled isCepEnabled=" + isCepEnabled + ", for imsPhone "
8477:                             + imsPhone.getMsisdn());
8611:         // *  Inherited from PhoneWindowManager  *
132: 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,
5154:                 .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
5282:                     .enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
5531:                 .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
5580:                 .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
5625:                 .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
5629:             return getPhoneFromSubId(subId).getAllowedNetworkTypes(reason);
5646:                 .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
5650:             return getPhoneFromSubId(subId).getEffectiveAllowedNetworkTypes();
5672:             getPhoneFromSubId(subId).setAllowedNetworkTypes(reason, allowedNetworkTypes);
5951:         for (int i = 0; i < TelephonyManager.getDefault().getPhoneCount(); i++) {
6015:         enforceReadPrivilegedPermission("getPackagesWithCarrierPrivilegesForAllPhones");
6021:             for (int i = 0; i < TelephonyManager.getDefault().getPhoneCount(); i++) {
6101:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneNumber(
6128:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
6151:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
6360:                     .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
6410:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
6429:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
6566:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp, getDefaultSubscription(),
6567:                 callingPackage, callingFeatureId, "getSubIdForPhoneAccountHandle")) {
6580:         enforceReadPrivilegedPermission("getPhoneAccountHandleForSubscriptionId, "
6804:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
7331:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
7483:             TelephonyPermissions.enforeceCallingOrSelfReadPhoneStatePermissionOrCarrierPrivilege(
7528:                 .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
7656:                         slot.getPhoneId(),
7792:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
7800:             return mPhoneConfigurationManager.getNumberOfModemsWithSimultaneousDataConnections();
7809:                 .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
7849:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
7876:                     .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
8059:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
8094:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp,
8119:                 mPhoneConfigurationManager.getStaticPhoneCapability();
8159:             mPhoneConfigurationManager.switchMultiSimConfig(numOfSims);
8199:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
8206:             return mPhoneConfigurationManager.isRebootRequiredForModemConfigChange();
8215:         metrics.updateEnabledModemBitmap((1 << TelephonyManager.from(mApp).getPhoneCount()) - 1);
8229:                 if (SubscriptionManager.isValidPhoneId(slotInfos[i].getLogicalSlotIdx())) {
8345:                 SubscriptionManager.getPhoneId(subId), UiccController.APP_FAM_3GPP);
8473:                     ImsPhoneCallTracker imsPhoneCallTracker =
8475:                     imsPhoneCallTracker.setConferenceEventPackageEnabled(isCepEnabled);
android.googlesource.com/platform/superproject:packages/services/Telephony/src/com/android/phone/PhoneInterfaceManager.java: [ master, ]
378:         public Phone phone;
17: package com.android.phone;
199: public class PhoneInterfaceManager extends ITelephony.Stub {
1641:     /* package */ PhoneInterfaceManager(PhoneGlobals app) {
1657:     private Phone getDefaultPhone() {
1688:     private Phone getPhone(int subId) {
2296:     public String getNetworkCountryIsoForPhone(int phoneId) {
5783:     public int checkCarrierPrivilegesForPackageAnyPhone(String pkgName) {
5806:     public List<String> getCarrierPackageNamesForIntentAndPhone(Intent intent, int phoneId) {
6264:     public boolean isWorldPhone(int subId, String callingPackage, String callingFeatureId) {
308:     private PhoneConfigurationManager mPhoneConfigurationManager;
1668:     private Phone getPhoneFromRequest(MainThreadRequest request) {
1676:     private Phone getPhoneFromSubId(int subId) {
2074:     private void shutdownRadioUsingPhoneId(int phoneId) {
2736:     public int getActivePhoneType() {
2741:     public int getActivePhoneTypeForSlot(int slotIndex) {
3780:     private void checkModifyPhoneStatePermission(int subId, String message) {
4418:     private Phone getPhoneFromSlotIdOrThrowException(int slotIndex) {
5850:     public List<String> getPackagesWithCarrierPrivilegesForAllPhones() {
6390:     public int getSubIdForPhoneAccount(PhoneAccount phoneAccount) {
6400:     public int getSubIdForPhoneAccountHandle(
6415:     public @Nullable PhoneAccountHandle getPhoneAccountHandleForSubscriptionId(int subscriptionId) {
21: import static com.android.internal.telephony.PhoneConstants.PHONE_TYPE_IMS;
143: import com.android.internal.telephony.Phone;
176: import com.android.phone.settings.PickSmsSubscriptionActivity;
177: import com.android.phone.vvm.PhoneAccountHandleConverter;
178: import com.android.phone.vvm.RemoteVvmTaskManager;
179: import com.android.phone.vvm.VisualVoicemailSettingsUtil;
180: import com.android.phone.vvm.VisualVoicemailSmsFilterConfig;
377:         // In cases where subId is unavailable, the caller needs to specify the phone.
386:         MainThreadRequest(Object argument, Phone phone, WorkSource workSource) {
388:             if (phone != null) {
389:                 this.phone = phone;
417:      * A handler that processes messages on the main thread in the phone process. Since many
418:      * of the Phone calls are not thread safe this is needed to shuttle the requests from the
419:      * inbound binder threads to the main thread in the phone process.  The Binder thread
436:             final Phone defaultPhone = getDefaultPhone();
441:                     final Phone phone = getPhoneFromRequest(request);
460:                         request.result = phone != null
461:                                 ? phone.handleUssdRequest(ussdRequest, wrappedCallback) : false;
472:                     final Phone phone = getPhoneFromRequest(request);
473:                     request.result = phone != null ?
1258:                     request.phone.requestCellInfoUpdate(request.workSource, onCompleted);
1272:                     request.phone.requestCellInfoUpdate(request.workSource,
1300:                     Phone phone = getPhoneFromRequest(request);
1301:                     phone.getCellIdentity(ws, obtainMessage(EVENT_GET_CELL_LOCATION_DONE, request));
1309:                         phone = getPhoneFromRequest(request);
1310:                         request.result = (phone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA)
1332:                             .enablePhone(request.phone, enable, onCompleted);
1338:                     int phoneId = request.phone.getPhoneId();
1353:                             .getPhoneStatusFromModem(request.phone, onCompleted);
1358:                     int id = request.phone.getPhoneId();
1381:                     request.phone.setSystemSelectionChannels(args.first, onCompleted);
1554:     private Object sendRequest(int command, Object argument, Phone phone, WorkSource workSource) {
1556:                 command, argument, SubscriptionManager.INVALID_SUBSCRIPTION_ID, phone, workSource);
1565:             int command, Object argument, Integer subId, Phone phone, WorkSource workSource) {
1571:         if (subId != SubscriptionManager.INVALID_SUBSCRIPTION_ID && phone != null) {
1572:             throw new IllegalArgumentException("subId and phone cannot both be specified!");
1573:         } else if (phone != null) {
1574:             request = new MainThreadRequest(argument, phone, workSource);
1614:      * Same as {@link #sendRequestAsync(int,Object)} except it takes a Phone and WorkSource.
1618:             int command, Object argument, Phone phone, WorkSource workSource) {
1619:         MainThreadRequest request = new MainThreadRequest(argument, phone, workSource);
1658:         Phone thePhone = getPhone(getDefaultSubscription());
1665:         ServiceManager.addService("phone", this);
1669:         if (request.phone != null) {
1670:             return request.phone;
1682:         Phone phone = getPhoneFromRequest(request);
1683:         return phone == null ? null :
1684:                 UiccController.getInstance().getUiccCard(phone.getPhoneId());
1687:     // returns phone associated with the subId.
1692:     private void sendEraseModemConfig(Phone phone) {
1693:         if (phone != null) {
1695:                   mApp, phone.getSubId(), "eraseModemConfig");
1733:             // PENDING: should we just silently fail if phone is offhook or ringing?
1754:         // from the context of the phone app.
1757:         if (mAppOps.noteOp(AppOpsManager.OPSTR_CALL_PHONE, Binder.getCallingUid(), callingPackage)
1943:             final Phone phone = getPhone(subId);
1944:             if (phone != null) {
1945:                 phone.updateServiceLocation();
1989:             final Phone phone = getPhone(subId);
1990:             if (phone != null) {
1991:                 return phone.getServiceState().getState() != ServiceState.STATE_POWER_OFF;
2009:             final Phone phone = getPhone(subId);
2010:             if (phone != null) {
2011:                 phone.setRadioPower(!isRadioOnForSubscriber(subId));
2027:             final Phone phone = getPhone(subId);
2028:             if (phone == null) {
2031:             if ((phone.getServiceState().getState() != ServiceState.STATE_POWER_OFF) != turnOn) {
2049:                 Phone phone = PhoneFactory.getPhone(i);
2050:                 if (phone != null && phone.isRadioAvailable()) return true;
2066:                 logv("Shutting down Phone " + i);
2075:         Phone phone = PhoneFactory.getPhone(phoneId);
2076:         if (phone != null && phone.isRadioAvailable()) {
2077:             phone.shutdownRadio();
2086:             final Phone defaultPhone = PhoneFactory.getDefaultPhone();
2091:                 loge("There's no default phone.");
2104:             final Phone phone = getPhone(subId);
2105:             if (phone != null) {
2106:                 phone.setRadioPower(turnOn);
2124:             final Phone phone = getPhone(subId);
2125:             if (phone != null) {
2126:                 phone.getDataEnabledSettings().setUserDataEnabled(true);
2144:             final Phone phone = getPhone(subId);
2145:             if (phone != null) {
2146:                 phone.getDataEnabledSettings().setUserDataEnabled(false);
2160:             final Phone phone = getPhone(subId);
2161:             if (phone != null) {
2162:                 return phone.isDataAllowed(ApnSetting.TYPE_DEFAULT);
2211:             Phone phone = PhoneFactory.getPhone(slotIndex);
2212:             return phone == null ? TelephonyManager.CALL_STATE_IDLE :
2213:                     PhoneConstantConversions.convertCallState(phone.getState());
2228:             final Phone phone = getPhone(subId);
2229:             if (phone != null) {
2230:                 return PhoneConstantConversions.convertDataState(phone.getDataConnectionState());
2249:             final Phone phone = getPhone(subId);
2250:             if (phone != null) {
2251:                 return DefaultPhoneNotifier.convertDataActivityState(phone.getDataActivityState());
2280:                 return (getDefaultPhone().getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA)
2301:             if (phoneId == SubscriptionManager.INVALID_PHONE_INDEX) {
2302:                 // Get default phone in this case.
2303:                 phoneId = SubscriptionManager.DEFAULT_PHONE_INDEX;
2306:             Phone phone = PhoneFactory.getPhone(phoneId);
2307:             if (phone == null) return "";
2308:             ServiceStateTracker sst = phone.getServiceStateTracker();
2313:             EmergencyNumberTracker ent = phone.getEmergencyNumberTracker();
2332:             final Phone phone = getPhone(subId);
2333:             if (phone != null) {
2334:                 phone.enableLocationUpdates();
2353:             final Phone phone = getPhone(subId);
2354:             if (phone != null) {
2355:                 phone.disableLocationUpdates();
2414:         for (Phone phone : PhoneFactory.getPhones()) {
2415:             List<CellInfo> info = phone.getAllCellInfo();
2454:             for (Phone phone : PhoneFactory.getPhones()) {
2456:                         CMD_GET_ALL_CELL_INFO, null, phone, workSource);
2507:         final Phone phone = getPhoneFromSubId(subId);
2508:         if (phone == null) throw new IllegalArgumentException("Invalid Subscription Id: " + subId);
2510:         sendRequestAsync(CMD_REQUEST_CELL_INFO_UPDATE, cb, phone, workSource);
2528:         Phone phone = PhoneFactory.getPhone(slotIndex);
2529:         if (phone == null) {
2532:         int subId = phone.getSubId();
2540:             return phone.getImei();
2548:         Phone phone = PhoneFactory.getPhone(slotIndex);
2550:         if (phone != null) {
2551:             String imei = phone.getImei();
2559:         Phone phone = PhoneFactory.getPhone(slotIndex);
2560:         if (phone == null) {
2564:         int subId = phone.getSubId();
2572:             return phone.getMeid();
2580:         Phone phone = PhoneFactory.getPhone(slotIndex);
2582:         if (phone != null) {
2583:             String meid = phone.getMeid();
2592:         Phone phone = PhoneFactory.getPhone(slotIndex);
2593:         if (phone == null) {
2596:         int subId = phone.getSubId();
2605:             return phone.getDeviceSvn();
2615:             final Phone phone = getPhone(subId);
2616:             return phone == null ? TelephonyManager.UNKNOWN_CARRIER_ID : phone.getCarrierId();
2626:             final Phone phone = getPhone(subId);
2627:             return phone == null ? null : phone.getCarrierName();
2637:             final Phone phone = getPhone(subId);
2638:             return phone == null ? TelephonyManager.UNKNOWN_CARRIER_ID
2639:                     : phone.getSpecificCarrierId();
2649:             final Phone phone = getPhone(subId);
2650:             return phone == null ? null : phone.getSpecificCarrierName();
2661:         final Phone phone = PhoneFactory.getPhone(slotIndex);
2662:         if (phone == null) {
2667:             return CarrierResolver.getCarrierIdFromMccMnc(phone.getContext(), mccmnc);
2678:      * Make sure the caller has the MODIFY_PHONE_STATE permission.
2683:         mApp.enforceCallingOrSelfPermission(android.Manifest.permission.MODIFY_PHONE_STATE, null);
2703:      * Make sure the caller has the CALL_PHONE permission.
2708:         mApp.enforceCallingOrSelfPermission(android.Manifest.permission.CALL_PHONE, null);
2744:             final Phone phone = PhoneFactory.getPhone(slotIndex);
2745:             if (phone == null) {
2746:                 return PhoneConstants.PHONE_TYPE_NONE;
2748:                 return phone.getPhoneType();
2775:             final Phone phone = getPhone(subId);
2776:             if (phone != null) {
2777:                 return phone.getCdmaEriIconIndex();
2808:             final Phone phone = getPhone(subId);
2809:             if (phone != null) {
2810:                 return phone.getCdmaEriIconMode();
2839:             final Phone phone = getPhone(subId);
2840:             if (phone != null) {
2841:                 return phone.getCdmaEriText();
2860:             final Phone phone = getPhone(subId);
2861:             if (phone != null && phone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA) {
2862:                 return phone.getLine1Number();
2864:                 loge("getCdmaMdn: no phone found. Invalid subId: " + subId);
2882:             final Phone phone = getPhone(subId);
2883:             if (phone != null && phone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA) {
2884:                 return phone.getCdmaMin();
2896:         if (mApp.checkCallingOrSelfPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
2898:             throw new SecurityException("Caller must hold the MODIFY_PHONE_STATE permission");
3062:             final Phone phone = getPhone(subId);
3063:             if (phone != null) {
3064:                 phone.setVoiceActivationState(activationState);
3083:             final Phone phone = getPhone(subId);
3084:             if (phone != null) {
3085:                 phone.setDataActivationState(activationState);
3101:         final Phone phone = getPhone(subId);
3104:             if (phone != null) {
3105:                 return phone.getVoiceActivationState();
3121:         final Phone phone = getPhone(subId);
3124:             if (phone != null) {
3125:                 return phone.getDataActivationState();
3147:             final Phone phone = getPhone(subId);
3148:             if (phone != null) {
3149:                 return phone.getVoiceMessageCount();
3166:             final Phone phone = getPhone(subId);
3167:             return (phone == null ? false : phone.isConcurrentVoiceAndDataAllowed());
3180:         final Phone defaultPhone = getDefaultPhone();
3218:             for (Phone phone : PhoneFactory.getPhones()) {
3219:                 if (phone.isInEmergencySmsMode()) {
3230:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3257:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3295:             Phone phone = getPhone(subId);
3296:             if (phone == null) {
3301:             phone.getImsRegistrationState(regState -> {
3328:             Phone phone = getPhone(subId);
3329:             if (phone == null) {
3334:             phone.getImsRegistrationTech(regTech -> {
3353:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3379:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3430:             Phone phone = getPhone(subId);
3431:             if (phone == null) return false;
3432:             return phone.isImsCapabilityAvailable(capability, regTech);
3480:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3517:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3551:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3586:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3638:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3720:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3787:         Phone phone = getPhone(subId);
3788:         if (phone == null) {
3789:             loge("phone instance null for subid " + subId);
3793:             if (!doesImsCapabilityRequireProvisioning(phone.getContext(), subId, capability)) {
3797:             if (!doesRcsCapabilityRequireProvisioning(phone.getContext(), subId, capability)) {
4231:             final Phone phone = getPhone(subId);
4232:             if (phone != null) {
4233:                 return phone.getServiceState().getDataNetworkType();
4265:             final Phone phone = getPhone(subId);
4266:             if (phone != null) {
4267:                 return phone.getServiceState().getDataNetworkType();
4290:             final Phone phone = getPhone(subId);
4291:             if (phone != null) {
4292:                 return phone.getServiceState().getVoiceNetworkType();
4317:             final Phone phone = PhoneFactory.getPhone(slotIndex);
4318:             if (phone != null) {
4319:                 return phone.getIccCard().hasIccCard();
4334:      * @return {@link Phone#LTE_ON_CDMA_UNKNOWN}, {@link Phone#LTE_ON_CDMA_FALSE}
4335:      * or {@link Phone#LTE_ON_CDMA_TRUE}
4354:             final Phone phone = getPhone(subId);
4355:             if (phone == null) {
4358:                 return phone.getLteOnCdmaMode();
4422:                     + " does not correspond to an active phone");
4453:     private IccOpenLogicalChannelResponse iccOpenLogicalChannelWithPermission(Phone phone,
4470:                     CMD_OPEN_CHANNEL, new Pair<String, Integer>(aid, p2), phone,
4495:     private boolean iccCloseLogicalChannelWithPermission(Phone phone, int channel) {
4501:             Boolean success = (Boolean) sendRequest(CMD_CLOSE_CHANNEL, channel, phone,
4538:     private String iccTransmitApduLogicalChannelWithPermission(Phone phone, int channel, int cla,
4547:                     new IccAPDUArgument(channel, cla, command, p1, p2, p3, data), phone,
4594:     private String iccTransmitApduBasicChannelWithPermission(Phone phone, String callingPackage,
4612:                     new IccAPDUArgument(0, cla, command, p1, p2, p3, data), phone,
4846:         Phone phone = PhoneFactory.getPhone(slotIndex);
4847:         if (phone != null) {
4849:                     mApp, phone.getSubId(), "resetModemConfig");
4872:         Phone phone = PhoneFactory.getPhone(slotIndex);
4873:         if (phone != null) {
4875:                     mApp, phone.getSubId(), "rebootModem");
4891:         final Phone defaultPhone = getDefaultPhone();
5416:         final Phone defaultPhone = getDefaultPhone();
5534:         final Phone phone = getPhone(subId);
5536:             if (phone != null) {
5537:                 return phone.hasMatchedTetherApnSetting();
5561:             Phone phone = PhoneFactory.getPhone(phoneId);
5562:             if (phone != null) {
5564:                 phone.getDataEnabledSettings().setUserDataEnabled(enable);
5566:                 loge("setUserDataEnabled: no phone found. Invalid subId=" + subId);
5584:         final Phone phone = getPhone(subId);
5586:             if (phone != null) {
5591:                 phone.setAlwaysReportSignalStrength(isEnable);
5593:                 loge("setAlwaysReportSignalStrength: no phone found for subId="
5622:      * Accepts either ACCESS_NETWORK_STATE, MODIFY_PHONE_STATE or carrier privileges.
5640:             Phone phone = PhoneFactory.getPhone(phoneId);
5641:             if (phone != null) {
5642:                 boolean retVal = phone.isUserDataEnabled();
5646:                 if (DBG) loge("isUserDataEnabled: no phone subId=" + subId + " retVal=false");
5669:             Phone phone = PhoneFactory.getPhone(phoneId);
5670:             if (phone != null) {
5671:                 boolean retVal = phone.getDataEnabledSettings().isDataEnabled();
5675:                 if (DBG) loge("isDataEnabled: no phone subId=" + subId + " retVal=false");
5684:             Phone phone) {
5690:         PackageManager pkgMgr = phone.getContext().getPackageManager();
5695:             SubscriptionInfo subInfo = subController.getSubscriptionInfo(phone.getSubId());
5697:                     phone.getContext().getSystemService(Context.TELEPHONY_SUBSCRIPTION_SERVICE);
5709:     private int getCarrierPrivilegeStatusFromCarrierConfigRules(int privilegeFromSim, Phone phone,
5718:             SubscriptionInfo subInfo = subController.getSubscriptionInfo(phone.getSubId());
5720:                     phone.getContext().getSystemService(Context.TELEPHONY_SUBSCRIPTION_SERVICE);
5730:         final Phone phone = getPhone(subId);
5731:         if (phone == null) {
5735:         UiccCard card = UiccController.getInstance().getUiccCard(phone.getPhoneId());
5743:                 phone.getContext().getPackageManager()), Binder.getCallingUid(), phone);
5749:         final Phone phone = getPhone(subId);
5750:         if (phone == null) {
5755:                 UiccController.getInstance().getUiccProfileForPhone(phone.getPhoneId());
5762:                         phone.getContext().getPackageManager(), uid), uid, phone);
5867:         final Phone phone = getPhone(subId);
5868:         UiccCard card = phone == null ? null : phone.getUiccCard();
5890:             final Phone phone = getPhone(subId);
5891:             if (phone == null) {
5894:             final String subscriberId = phone.getSubscriberId();
6117:             final Phone phone = getPhone(subId);
6118:             return phone == null ? false : phone.setOperatorBrandOverride(brand);
6133:             final Phone phone = getPhone(subId);
6134:             if (phone == null) {
6137:             return phone.setRoamingOverride(gsmRoamingList, gsmNonRoamingList, cdmaRoamingList,
6188:         Phone phone = PhoneFactory.getPhone(phoneId);
6190:         if (phone == null) {
6197:                             mApp, phone.getSubId(), "getRadioAccessFamily");
6207:         final Phone defaultPhone = getDefaultPhone();
6221:         final Phone defaultPhone = getDefaultPhone();
6275:                     .getBoolean(CarrierConfigManager.KEY_WORLD_PHONE_BOOL);
6306:         final Phone phone = getPhone(subscriptionId);
6307:         if (phone == null) {
6308:             loge("isRttSupported: no Phone found. Invalid subId:" + subscriptionId);
6315:                     phone.getContext().getResources().getBoolean(R.bool.config_support_rtt);
6348:      * Returns the unique device ID of phone, for example, the IMEI for
6352:      *   {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
6356:         final Phone phone = PhoneFactory.getPhone(0);
6357:         if (phone == null) {
6360:         int subId = phone.getSubId();
6368:             return phone.getDeviceId();
6381:         Phone phone = getPhone(subId);
6382:         if (phone != null) {
6383:             return phone.isImsRegistered();
6404:             throw new SecurityException("Requires READ_PHONE_STATE permission.");
6418:             Phone phone = getPhone(subscriptionId);
6419:             if (phone == null) {
6422:             return PhoneUtils.makePstnPhoneAccountHandle(phone);
6434:             Phone phone = getPhone(subId);
6435:             if (phone != null) {
6436:                 return phone.isWifiCallingEnabled();
6451:             Phone phone = getPhone(subId);
6452:             if (phone != null) {
6453:                 return phone.isVideoEnabled();
6469:             Phone phone = getPhone(subId);
6470:             if (phone != null) {
6471:                 return phone.getImsRegistrationTech();
6529:         final Phone phone = getPhone(subId);
6530:         if (phone == null) {
6537:                     phone.getContext().getOpPackageName(), null);
6546:             final Locale localeFromDefaultSim = phone.getLocaleFromSimAndCarrierPrefs();
6674:             final Phone phone = getPhone(subId);
6675:             if (phone == null) {
6679:             ServiceState ss = phone.getServiceState();
6692:      * Returns the URI for the per-account voicemail ringtone set in Phone settings.
6703:             Phone phone = PhoneUtils.getPhoneForPhoneAccountHandle(accountHandle);
6704:             if (phone == null) {
6705:                 phone = getDefaultPhone();
6708:             return VoicemailNotificationSettingsUtil.getRingtoneUri(phone.getContext());
6718:      * has permission {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}.
6728:         final Phone defaultPhone = getDefaultPhone();
6739:             Phone phone = PhoneUtils.getPhoneForPhoneAccountHandle(phoneAccountHandle);
6740:             if (phone == null) {
6741:                 phone = defaultPhone;
6743:             VoicemailNotificationSettingsUtil.setRingtoneUri(phone.getContext(), uri);
6750:      * Returns whether vibration is set for voicemail notification in Phone settings.
6760:             Phone phone = PhoneUtils.getPhoneForPhoneAccountHandle(accountHandle);
6761:             if (phone == null) {
6762:                 phone = getDefaultPhone();
6765:             return VoicemailNotificationSettingsUtil.isVibrationEnabled(phone.getContext());
6775:      * has permission {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}.
6785:         final Phone defaultPhone = getDefaultPhone();
6796:             Phone phone = PhoneUtils.getPhoneForPhoneAccountHandle(phoneAccountHandle);
6797:             if (phone == null) {
6798:                 phone = defaultPhone;
6800:             VoicemailNotificationSettingsUtil.setVibrationEnabled(phone.getContext(), enabled);
6807:      * Make sure either called from same process as self (phone) or IPC caller has read privilege.
6812:         mApp.enforceCallingOrSelfPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE,
6817:      * Make sure either called from same process as self (phone) or IPC caller has send SMS
6860:         Phone phone = getPhone(subId);
6864:             if (phone == null) {
6869:                 aid = UiccController.getInstance().getUiccCard(phone.getPhoneId())
6889:         Phone phone = getPhone(subId);
6893:             if (phone == null) {
6898:                 esn = phone.getEsn();
6917:         Phone phone = getPhone(subId);
6921:             if (phone == null) {
6926:                 cdmaPrlVersion = phone.getCdmaPrlVersion();
7020:         final Phone phone = getPhone(subId);
7023:         if (phone == null) {
7028:             phone.carrierActionSetMeteredApnsEnabled(enabled);
7045:         final Phone phone = getPhone(subId);
7048:         if (phone == null) {
7053:             phone.carrierActionSetRadioEnabled(enabled);
7073:         final Phone phone = getPhone(subId);
7076:         if (phone == null) {
7081:             phone.carrierActionReportDefaultNetworkStatus(report);
7097:         final Phone phone = getPhone(subId);
7098:         if (phone == null) {
7103:             phone.carrierActionResetAll();
7110:      * Called when "adb shell dumpsys phone" is invoked. Dump is also automatically invoked when a
7117:             writer.println("Permission Denial: can't dump Phone from pid="
7147:             Phone phone = getPhone(subId);
7148:             if (phone != null) {
7149:                 phone.getDataEnabledSettings().setPolicyDataEnabled(enabled);
7168:         Phone phone = getPhone(subId);
7172:             if (phone != null) {
7173:                 return phone.getClientRequestStats();
7200:         Phone phone = PhoneFactory.getPhone(slotIndex);
7206:             if (phone != null) {
7207:                 phone.setSimPowerState(state, workSource);
7229:      * Check if phone is in emergency callback mode
7230:      * @return true if phone is in emergency callback mode
7236:         final Phone phone = getPhone(subId);
7240:             if (phone != null) {
7241:                 return phone.isInEcm();
7261:             Phone p = getPhone(subId);
7281:         Phone phone = PhoneFactory.getPhone(slotIndex);
7282:         if (phone != null) {
7283:             if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp, phone.getSubId(),
7290:                 return phone.getRadioPowerState();
7303:      * {@link android.Manifest.permission#READ_PHONE_STATE} or that the calling app has carrier
7318:             Phone phone = getPhone(subId);
7319:             isEnabled =  phone != null ? phone.getDataRoamingEnabled() : false;
7334:      * {@link android.Manifest.permission#MODIFY_PHONE_STATE} or that the calling app has carrier
7347:             Phone phone = getPhone(subId);
7348:             if (phone != null) {
7349:                 phone.setDataRoamingEnabled(isEnabled);
7365:             Phone phone = getPhone(subId);
7366:             if (phone != null) {
7367:                 isAllowed = phone.isCspPlmnEnabled();
7391:             // even without READ_PRIVILEGED_PHONE_STATE, we allow the call to continue if the caller
7528:      * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}.
7537:             Phone phone = getPhone(subId);
7538:             if (phone == null) {
7541:             UiccCard uiccCard = phone.getUiccCard();
7578:      * not set, return {@link Phone#PREFERRED_NT_MODE}.
7586:         return Phone.PREFERRED_NT_MODE;
7596:             final Phone phone = getPhone(subId);
7597:             if (phone == null) {
7601:             phone.setCarrierTestOverride(mccmnc, imsi, iccid, gid1, gid2, plmn, spn,
7614:             final Phone phone = getPhone(subId);
7615:             if (phone == null) {
7619:             return phone.getCarrierIdListVersion();
7688:             throw new SecurityException("Requires READ_PHONE_STATE permission.");
7693:             for (Phone phone: PhoneFactory.getPhones()) {
7694:                 if (phone.getEmergencyNumberTracker() != null
7695:                         && phone.getEmergencyNumberTracker().getEmergencyNumberList() != null) {
7697:                             phone.getSubId(),
7698:                             phone.getEmergencyNumberTracker().getEmergencyNumberList());
7709:         final Phone defaultPhone = getDefaultPhone();
7717:             for (Phone phone: PhoneFactory.getPhones()) {
7718:                 if (phone.getEmergencyNumberTracker() != null
7719:                         && phone.getEmergencyNumberTracker() != null) {
7720:                     if (phone.getEmergencyNumberTracker().isEmergencyNumber(
7742:             for (Phone phone: PhoneFactory.getPhones()) {
7743:                 EmergencyNumberTracker tracker = phone.getEmergencyNumberTracker();
7764:             for (Phone phone: PhoneFactory.getPhones()) {
7765:                 EmergencyNumberTracker tracker = phone.getEmergencyNumberTracker();
7784:             final Phone phone = getPhone(subId);
7785:             if (phone == null) {
7789:             return phone.getEmergencyNumberDbVersion();
7801:             for (Phone phone: PhoneFactory.getPhones()) {
7802:                 EmergencyNumberTracker tracker = phone.getEmergencyNumberTracker();
7818:             for (Phone phone: PhoneFactory.getPhones()) {
7819:                 EmergencyNumberTracker tracker = phone.getEmergencyNumberTracker();
7835:             for (Phone phone: PhoneFactory.getPhones()) {
7836:                 EmergencyNumberTracker tracker = phone.getEmergencyNumberTracker();
7849:         Phone phone = getPhone(subId);
7850:         if (phone == null) {
7856:                     .getUiccProfileForPhone(phone.getPhoneId());
7875:             Phone phone = PhoneFactory.getPhone(slotIndex);
7876:             if (phone == null) {
7879:                 return (Boolean) sendRequest(CMD_REQUEST_ENABLE_MODEM, enable, phone, null);
7892:         Phone phone = PhoneFactory.getPhone(slotIndex);
7893:         if (phone == null) return false;
7896:                 mApp, phone.getSubId(), callingPackage, callingFeatureId,
7898:             throw new SecurityException("Requires READ_PHONE_STATE permission.");
7904:                 return mPhoneConfigurationManager.getPhoneStatusFromCache(phone.getPhoneId());
7906:                 return (Boolean) sendRequest(CMD_GET_MODEM_STATUS, null, phone, null);
7974:      * Note: Switch from multi-sim to single-sim is only possible with MODIFY_PHONE_STATE
7975:      * permission, but the other way around is possible with either MODIFY_PHONE_STATE
8004:         Phone phone = getPhone(subId);
8005:         if (phone == null) {
8010:             UiccCard uiccCard = phone.getUiccCard();
8080:         Phone phone = getDefaultPhone();
8081:         if (phone == null) return -1;
8082:         HalVersion hv = phone.getHalVersion();
8112:         enforceReadPrivilegedPermission("Needs READ_PRIVILEGED_PHONE_STATE for "
8118:             Phone phone = getPhone(subId);
8119:             if (phone == null) return false;
8121:             boolean isMetered = ApnSettingUtils.isMeteredApnType(apnType, phone);
8122:             return !isMetered || phone.getDataEnabledSettings().isDataEnabled(apnType);
8135:             Phone phone = getPhone(subId);
8136:             if (phone == null) return true; // By default return true.
8138:             return ApnSettingUtils.isMeteredApnType(apnType, phone);
8150:             Phone phone = getPhone(subscriptionId);
8151:             if (phone == null) {
8171:             sendRequestAsync(CMD_SET_SYSTEM_SELECTION_CHANNELS, argument, phone, null);
8241:             Phone phone = getPhone(subId);
8242:             if (phone == null) return false;
8244:             return phone.getDataEnabledSettings().setAllowDataDuringVoiceCall(allow);
8257:             Phone phone = getPhone(subId);
8258:             if (phone == null) return false;
8260:             return phone.getDataEnabledSettings().isDataAllowedInVoiceCall();
8273:             Phone phone = getPhone(subId);
8274:             if (phone == null) return false;
8276:             return phone.getDataEnabledSettings().setAlwaysAllowMmsData(alwaysAllow);
8294:             for (Phone phone : PhoneFactory.getPhones()) {
8295:                 Phone defaultPhone = phone.getImsPhone();
8296:                 if (defaultPhone != null && defaultPhone.getPhoneType() == PHONE_TYPE_IMS) {
8341:             Phone phone = getPhone(subId);
8342:             if (phone != null && phone.getIccCard() != null) {
8343:                 return phone.getIccCard().getIccLockEnabled();
8363:         Phone phone = getPhone(subId);
8364:         if (phone == null) {
8371:                     new Pair<Boolean, String>(enabled, password), phone, null);
8393:         Phone phone = getPhone(subId);
8394:         if (phone == null) {
8401:                     new Pair<String, String>(oldPassword, newPassword), phone, null);
22: import static com.android.internal.telephony.PhoneConstants.SUBSCRIPTION_KEY;
65: import android.telecom.PhoneAccount;
66: import android.telecom.PhoneAccountHandle;
85: import android.telephony.PhoneCapability;
86: import android.telephony.PhoneNumberRange;
144: import com.android.internal.telephony.PhoneConfigurationManager;
145: import com.android.internal.telephony.PhoneConstantConversions;
146: import com.android.internal.telephony.PhoneConstants;
147: import com.android.internal.telephony.PhoneFactory;
160: import com.android.internal.telephony.imsphone.ImsPhone;
161: import com.android.internal.telephony.imsphone.ImsPhoneCallTracker;
200:     private static final String LOG_TAG = "PhoneInterfaceManager";
201:     private static final boolean DBG = (PhoneGlobals.DBG_LEVEL >= 2);
298:     private static PhoneInterfaceManager sInstance;
300:     private PhoneGlobals mApp;
691:                     defaultPhone.nvReadItem((Integer) request.argument, onCompleted,
718:                     defaultPhone.nvWriteItem(idValue.first, idValue.second, onCompleted,
729:                     defaultPhone.nvWriteCdmaPrl((byte[]) request.argument, onCompleted);
739:                     defaultPhone.resetModemConfig(onCompleted);
785:                     defaultPhone.invokeOemRilRequestRaw((byte[]) request.argument, onCompleted);
1023:                     if (defaultPhone != null) {
1024:                         defaultPhone.getModemActivityInfo(onCompleted, request.workSource);
1087:                     defaultPhone.setAllowedCarriers(argument, onCompleted, request.workSource);
1115:                     defaultPhone.getAllowedCarriers(onCompleted, request.workSource);
1321:                     defaultPhone.rebootModem(onCompleted);
1331:                     PhoneConfigurationManager.getInstance()
1341:                         mPhoneConfigurationManager.addToPhoneStatusCache(phoneId, msg.arg1 == 1);
1352:                     PhoneConfigurationManager.getInstance()
1440:                     defaultPhone.eraseModemConfig(onCompleted);
1625:      * Initialize the singleton PhoneInterfaceManager instance.
1626:      * This is only done once, at startup, from PhoneApp.onCreate().
1628:     /* package */ static PhoneInterfaceManager init(PhoneGlobals app) {
1629:         synchronized (PhoneInterfaceManager.class) {
1631:                 sInstance = new PhoneInterfaceManager(app);
1643:         mCM = PhoneGlobals.getInstance().mCM;
1644:         mImsResolver = PhoneGlobals.getInstance().getImsResolver();
1652:         mPhoneConfigurationManager = PhoneConfigurationManager.getInstance();
1659:         return (thePhone != null) ? thePhone : PhoneFactory.getDefaultPhone();
1678:                 ? getDefaultPhone() : getPhone(subId);
1689:         return PhoneFactory.getPhone(mSubscriptionController.getPhoneId(subId));
1707:         PackageManager pm = getDefaultPhone().getContext().getPackageManager();
1734:             PhoneConstants.State state = mCM.getState(subId);
1735:             if (state != PhoneConstants.State.OFFHOOK && state != PhoneConstants.State.RINGING) {
1794:         return (resultArray[0] == PhoneConstants.PIN_RESULT_SUCCESS) ? true : false;
1799:         return (resultArray[0] == PhoneConstants.PIN_RESULT_SUCCESS) ? true : false;
1807:             final UnlockSim checkSimPin = new UnlockSim(getPhone(subId).getIccCard());
1820:             final UnlockSim checkSimPuk = new UnlockSim(getPhone(subId).getIccCard());
1837:         private int mResult = PhoneConstants.PIN_GENERAL_FAILURE;
1867:                                             mResult = PhoneConstants.PIN_PASSWORD_INCORRECT;
1872:                                             mResult = PhoneConstants.PIN_OPERATION_ABORTED;
1874:                                             mResult = PhoneConstants.PIN_GENERAL_FAILURE;
1877:                                         mResult = PhoneConstants.PIN_RESULT_SUCCESS;
2052:             logv(TelephonyManager.getDefault().getPhoneCount() + " Phones are shutdown.");
2087:             if (defaultPhone != null) {
2088:                 defaultPhone.setRadioPower(turnOn);
2232:                 return PhoneConstantConversions.convertDataState(
2233:                         PhoneConstants.DataState.DISCONNECTED);
2305:             final int subId = mSubscriptionController.getSubIdUsingPhoneId(phoneId);
2520:             getDefaultPhone().setCellInfoListRate(rateInMillis, workSource);
2724:         Log.d(LOG_TAG, "[PhoneIntfMgr] " + msg);
2728:         Log.v(LOG_TAG, "[PhoneIntfMgr] " + msg);
2732:         Log.e(LOG_TAG, "[PhoneIntfMgr] " + msg);
2894:     public void requestNumberVerification(PhoneNumberRange range, long timeoutMillis,
2923:             return getDefaultPhone().needsOtaServiceProvisioning();
2958:             PhoneAccountHandle phoneAccountHandle = PhoneAccountHandleConverter.fromSubId(subId);
2959:             if (phoneAccountHandle == null) {
2962:             return VisualVoicemailSettingsUtil.dump(mApp, phoneAccountHandle);
3047:         SmsController smsController = PhoneFactory.getSmsController();
3182:         TelecomManager tm = defaultPhone.getContext().getSystemService(TelecomManager.class);
3191:             defaultPhone.sendDialerSpecialCode(inputCode);
3246:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3270:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone.
3366:         // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3393:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone.
3409:         // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3488:         // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3506:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3526:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3541:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3560:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3576:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3595:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3611:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3627:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3647:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3663:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3678:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3694:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3710:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3729:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3748:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3766:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3811:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3841:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3874:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3933:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
4102:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
4127:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
4153:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
4179:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
4349:             return PhoneConstants.LTE_ON_CDMA_UNKNOWN;
4356:                 return PhoneConstants.LTE_ON_CDMA_UNKNOWN;
4419:         int phoneId = UiccController.getInstance().getPhoneIdFromSlotId(slotIndex);
4420:         if (phoneId == -1) {
4424:         return PhoneFactory.getPhone(phoneId);
4459:                 ComponentInfo bestComponent = EuiccConnector.findBestComponent(getDefaultPhone()
4601:                 ComponentInfo bestComponent = EuiccConnector.findBestComponent(getDefaultPhone()
4892:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp, defaultPhone.getSubId(),
4899:             return defaultPhone.getPcscfAddress(apnType);
5150:             getDefaultPhone().setImsRegistrationState(registered);
5356:                     request, messenger, binder, getPhone(subId),
5417:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp, defaultPhone.getSubId(),
5425:             return PhoneFactory.calculatePreferredNetworkType(defaultPhone.getContext(), 0);
5559:             int phoneId = mSubscriptionController.getPhoneId(subId);
5560:             if (DBG) log("setUserDataEnabled: subId=" + subId + " phoneId=" + phoneId);
5638:             int phoneId = mSubscriptionController.getPhoneId(subId);
5639:             if (DBG) log("isUserDataEnabled: subId=" + subId + " phoneId=" + phoneId);
5667:             int phoneId = mSubscriptionController.getPhoneId(subId);
5668:             if (DBG) log("isDataEnabled: subId=" + subId + " phoneId=" + phoneId);
5771:         int phoneId = SubscriptionManager.getPhoneId(subId);
5772:         UiccCard card = UiccController.getInstance().getUiccCard(phoneId);
5779:             getPhone(phoneId), pkgName);
5796:                 getPhone(i), pkgName);
5807:         if (!SubscriptionManager.isValidPhoneId(phoneId)) {
5808:             loge("phoneId " + phoneId + " is not valid.");
5811:         UiccCard card = UiccController.getInstance().getUiccCard(phoneId);
5813:             loge("getCarrierPackageNamesForIntentAndPhone: No UICC");
5820:     public List<String> getPackagesWithCarrierPrivileges(int phoneId) {
5824:         UiccCard card = UiccController.getInstance().getUiccCard(phoneId);
6187:     public int getRadioAccessFamily(int phoneId, String callingPackage) {
6198:             raf = ProxyController.getInstance().getRadioAccessFamily(phoneId);
6212:             ImsManager.getInstance(defaultPhone.getContext(),
6213:                     defaultPhone.getPhoneId()).setVtSetting(enable);
6222:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp, defaultPhone.getSubId(),
6234:                     ImsManager.getInstance(defaultPhone.getContext(), defaultPhone.getPhoneId());
6349:      * GSM and the MEID for CDMA phones. Return null if device ID is not available.
6393:             return PhoneUtils.getSubIdForPhoneAccount(phoneAccount);
6401:             PhoneAccountHandle phoneAccountHandle, String callingPackage, String callingFeatureId) {
6408:             return PhoneUtils.getSubIdForPhoneAccountHandle(phoneAccountHandle);
6502:             cleanUpSmsRawTable(getDefaultPhone().getContext());
6513:               sendEraseModemConfig(getDefaultPhone());
6694:      * @param accountHandle The handle for the {@link PhoneAccount} for which to retrieve the
6697:      * PhoneAccount.
6700:     public Uri getVoicemailRingtoneUri(PhoneAccountHandle accountHandle) {
6720:      * @param phoneAccountHandle The handle for the {@link PhoneAccount} for which to set the
6723:      * PhoneAccount.
6727:             PhoneAccountHandle phoneAccountHandle, Uri uri) {
6730:         TelecomManager tm = defaultPhone.getContext().getSystemService(TelecomManager.class);
6733:                     mApp, PhoneUtils.getSubIdForPhoneAccountHandle(phoneAccountHandle),
6752:      * @param accountHandle The handle for the {@link PhoneAccount} for which to retrieve the
6754:      * @return {@code true} if the vibration is set for this PhoneAccount, {@code false} otherwise.
6757:     public boolean isVoicemailVibrationEnabled(PhoneAccountHandle accountHandle) {
6777:      * @param phoneAccountHandle The handle for the {@link PhoneAccount} for which to set the
6780:      * specific PhoneAccount.
6784:             PhoneAccountHandle phoneAccountHandle, boolean enabled) {
6787:         TelecomManager tm = defaultPhone.getContext().getSystemService(TelecomManager.class);
6790:                     mApp, PhoneUtils.getSubIdForPhoneAccountHandle(phoneAccountHandle),
7131:         (new TelephonyShellCommand(this, getDefaultPhone().getContext()))
7393:             if (checkCarrierPrivilegesForPackageAnyPhone(callingPackage)
7582:         int phoneId = mSubscriptionController.getPhoneId(subId);
7583:         if (phoneId >= 0 && phoneId < list.size() && list.get(phoneId) != null) {
7584:             return list.get(phoneId);
7713:                             mApp, defaultPhone.getSubId(), "isEmergencyNumber(Potential)");
7931:                 getDefaultPhone().getSubId(), callingPackage, callingFeatureId,
7954:         PhoneCapability staticCapability =
8060:             int phoneCount = TelephonyManager.getDefault().getPhoneCount();
8062:             int[] logicalSlotsMapping = new int[phoneCount];
8194:         SmsPermissions permissions = new SmsPermissions(getDefaultPhone(), mApp,
8215:             return SubscriptionManager.getResourcesForSubId(getDefaultPhone().getContext(), subId)
8227:             return SubscriptionManager.getResourcesForSubId(getDefaultPhone().getContext(), subId)
8297:                     ImsPhone imsPhone = (ImsPhone) defaultPhone;
8299:                             (ImsPhoneCallTracker) imsPhone.getCallTracker();
8301:                     Rlog.i(LOG_TAG, "setCepEnabled isCepEnabled=" + isCepEnabled + ", for imsPhone "
8302:                             + imsPhone.getMsisdn());
133: import com.android.internal.telephony.DefaultPhoneNotifier;
474:                             getPhoneFromRequest(request).handlePinMmi((String) request.argument)
749:                     getPhoneFromRequest(request).getPreferredNetworkType(onCompleted);
775:                     getPhoneFromRequest(request).setPreferredNetworkType(networkType, onCompleted);
799:                     getPhoneFromRequest(request).setVoiceMailNumber(tagNum.first, tagNum.second,
811:                     getPhoneFromRequest(request).setNetworkSelectionModeAutomatic(onCompleted);
821:                     getPhoneFromRequest(request).getAvailableNetworks(onCompleted);
828:                     getPhoneFromRequest(request).getCallForwardingOption(
885:                     getPhoneFromRequest(request).setCallForwardingOption(
907:                     getPhoneFromRequest(request).getCallWaiting(onCompleted);
951:                     getPhoneFromRequest(request).setCallWaiting(isEnable, onCompleted);
1003:                     getPhoneFromRequest(request).selectNetworkManually(selArg.operatorInfo,
1198:                     getPhoneFromRequest(request).getNetworkSelectionMode(onCompleted);
1219:                     getPhoneFromRequest(request).queryCdmaRoamingPreference(onCompleted);
1235:                     getPhoneFromRequest(request).setCdmaRoamingPreference(mode, onCompleted);
1247:                     getPhoneFromRequest(request).setCdmaSubscription(subscriptionMode, onCompleted);
1362:                         mPhoneConfigurationManager.addToPhoneStatusCache(id,
1450:                     getPhoneFromRequest(request).getIccCard().changeIccLockPassword(
1468:                     getPhoneFromRequest(request).getIccCard().setIccLockEnabled(
1672:             return getPhoneFromSubId(request.subId);
1973:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
2048:             for (int i = 0; i < TelephonyManager.getDefault().getPhoneCount(); i++) {
2065:             for (int i = 0; i < TelephonyManager.getDefault().getPhoneCount(); i++) {
2067:                 shutdownRadioUsingPhoneId(i);
2597:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
2737:         return getActivePhoneTypeForSlot(getSlotForDefaultSubscription());
2767:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
2800:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
2831:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
2972:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
3140:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
3200:                     .enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3237:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3263:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3320:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3360:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3385:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3485:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3522:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3556:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3591:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3643:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3725:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3807:         checkModifyPhoneStatePermission(subId, "setRcsProvisioningStatusForCapability");
3871:         checkModifyPhoneStatePermission(subId, "setImsProvisioningStatusForCapability");
4223:                 && !TelephonyPermissions.checkCallingOrSelfReadPhoneStateNoThrow(
4257:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
4282:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
4374:         return mSubscriptionController.getPhoneId(getDefaultSubscription());
4436:         return iccOpenLogicalChannelWithPermission(getPhoneFromSubId(subId), callingPackage, aid,
4449:         return iccOpenLogicalChannelWithPermission(getPhoneFromSlotIdOrThrowException(slotIndex),
4484:         return iccCloseLogicalChannelWithPermission(getPhoneFromSubId(subId), channel);
4491:         return iccCloseLogicalChannelWithPermission(getPhoneFromSlotIdOrThrowException(slotIndex),
4520:         return iccTransmitApduLogicalChannelWithPermission(getPhoneFromSubId(subId), channel, cla,
4534:                 getPhoneFromSlotIdOrThrowException(slotIndex), channel, cla, command, p1, p2, p3,
4573:         return iccTransmitApduBasicChannelWithPermission(getPhoneFromSubId(subId), callingPackage,
4589:                 getPhoneFromSlotIdOrThrowException(slotIndex), callingPackage, cla, command, p1,
4674:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
4712:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp, subId, callingPackage,
5093:                 .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
5440:                 .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
5489:                 .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
5787:         for (int i = 0; i < TelephonyManager.getDefault().getPhoneCount(); i++) {
5851:         enforceReadPrivilegedPermission("getPackagesWithCarrierPrivilegesForAllPhones");
5857:             for (int i = 0; i < TelephonyManager.getDefault().getPhoneCount(); i++) {
5937:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneNumber(
5964:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
5987:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
6196:                     .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
6246:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
6265:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
6402:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp, getDefaultSubscription(),
6403:                 callingPackage, callingFeatureId, "getSubIdForPhoneAccountHandle")) {
6638:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
7164:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
7321:             TelephonyPermissions.enforeceCallingOrSelfReadPhoneStatePermissionOrCarrierPrivilege(
7359:                 .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
7492:                         slot.getPhoneId(),
7628:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
7636:             return mPhoneConfigurationManager.getNumberOfModemsWithSimultaneousDataConnections();
7645:                 .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
7685:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
7712:                     .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
7895:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
7930:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp,
7955:                 mPhoneConfigurationManager.getStaticPhoneCapability();
7995:             mPhoneConfigurationManager.switchMultiSimConfig(numOfSims);
8035:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
8042:             return mPhoneConfigurationManager.isRebootRequiredForModemConfigChange();
8051:         metrics.updateEnabledModemBitmap((1 << TelephonyManager.from(mApp).getPhoneCount()) - 1);
8065:                 if (SubscriptionManager.isValidPhoneId(slotInfos[i].getLogicalSlotIdx())) {
8180:                 SubscriptionManager.getPhoneId(subId), UiccController.APP_FAM_3GPP);
8298:                     ImsPhoneCallTracker imsPhoneCallTracker =
8300:                     imsPhoneCallTracker.setConferenceEventPackageEnabled(isCepEnabled);
android.googlesource.com/platform/frameworks/opt/telephony:src/java/com/android/internal/telephony/Phone.java: [ master, ]
118: public abstract class Phone extends Handler implements PhoneInternalInterface {
504:     protected Phone(String name, PhoneNotifier notifier, Context context, CommandsInterface ci,
521:     protected Phone(String name, PhoneNotifier notifier, Context context, CommandsInterface ci,
330:     protected Phone mImsPhone = null;
600:     public void createImsPhone() {
3620:     public Phone getImsPhone() {
4270:     public Phone getDefaultPhone() {
195:     protected static final int EVENT_UPDATE_PHONE_OBJECT            = 42;
296:     protected boolean mIsPhoneInEcmState = false;
327:     protected int mPhoneId;
444:     public String getPhoneName() {
448:     protected void setPhoneName(String name) {
1810:     public void updatePhoneObject(int voiceRadioTech) {
2742:     public abstract int getPhoneType();
3743:     public int getPhoneId() {
3751:     public int getVoicePhoneServiceState() {
108:  * A base implementation for the com.android.internal.telephony.Phone interface.
110:  * Note that implementations of Phone.java are expected to be used
119:     private static final String LOG_TAG = "Phone";
244:      * This method is invoked when the Phone exits Emergency Callback Mode.
294:     // Keep track of whether or not the phone is in Emergency Callback Mode for Phone and
439:      * Returns a string identifier for this phone interface for parties
440:      *  outside the phone app process.
495:      * Constructs a Phone in normal (non-unit test) mode.
506:         this(name, notifier, context, ci, unitTestMode, SubscriptionManager.DEFAULT_PHONE_INDEX,
511:      * Constructs a Phone in normal (non-unit test) mode.
519:      * @param phoneId the phone-id of this phone.
547:         * (i.e. voice) phone calls over the telephony network, and is allowed
574:         if (getPhoneType() == PhoneConstants.PHONE_TYPE_IMS) {
589:         if (getPhoneType() != PhoneConstants.PHONE_TYPE_SIP) {
601:         if (getPhoneType() == PhoneConstants.PHONE_TYPE_SIP) {
605:         synchronized(Phone.lockForRadioTechnologyChange) {
668:         // messages to be handled whether or not the phone is being destroyed
670:         // resources of the phone being destroyed
790:         Phone imsPhone = mImsPhone;
829:      * Gets the context for the phone, as set at initialization time.
885:      * Subclasses of Phone probably want to replace this with a
911:      * Subclasses of Phone probably want to replace this with a
935:      * Subclasses of Phone probably want to replace this with a
947:      * Notify the phone that an SMS has been sent. This will be used determine if the SMS was sent
961:      * Determine if the Phone has recently sent an emergency SMS and is still in the interval of
1002:     protected void migrateFrom(Phone from) {
1015:         // The emergency state of IMS phone will be cleared in ImsPhone#notifySrvccState after
1078:      *   Connection.getCall() == Phone.getRingingCall()
1098:      * Notifies when phone's video capabilities changes <p>
1103:      *  AsyncResult.result = true if phone supports video calling <p>
1242:      * Example: If Phone.dial is called with "*#31#", then the app will
1565:      * For unit tests; don't send notifications to "Phone"
1582:      * Subclasses of Phone probably want to replace this with a
1687:         // no need for regular phone
1691:      * Subclasses of Phone probably want to replace this with a
1702:      * If this is a simulated phone interface, returns a SimulatedRadioControl.
1716:      * the thread that originally obtained this Phone instance.
1721:                     "com.android.internal.telephony.Phone must be used from within one thread");
1770:      * If the phone has an active call and call waiting occurs,
1771:      * then the phone state is RINGING not OFFHOOK
1780:      * Retrieves the IccFileHandler of the Phone instance
1799:      * Retrieves the Handler of the Phone instance
1806:      * Update the phone object if the voice radio technology has changed
1814:     * Retrieves the ServiceStateTracker of the phone instance.
1822:      * Retrieves the EmergencyNumberTracker of the phone instance.
1844:      * Retrieves the DeviceStateMonitor of the phone instance.
1851:      * Retrieves the DisplayInfoController of the phone instance.
1899:      * Returns the ICC card interface for this phone, or null
1905:         //throw new Exception("getIccCard Shouldn't be called from Phone");
2102:         if (getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA) {
2341:      * - {@link com.android.internal.telephony.Phone#TTY_MODE_OFF}
2342:      * - {@link com.android.internal.telephony.Phone#TTY_MODE_FULL}
2343:      * - {@link com.android.internal.telephony.Phone#TTY_MODE_HCO}
2344:      * - {@link com.android.internal.telephony.Phone#TTY_MODE_VCO}
2355:      * - {@link com.android.internal.telephony.Phone#TTY_MODE_OFF}
2356:      * - {@link com.android.internal.telephony.Phone#TTY_MODE_FULL}
2357:      * - {@link com.android.internal.telephony.Phone#TTY_MODE_HCO}
2358:      * - {@link com.android.internal.telephony.Phone#TTY_MODE_VCO}
2647:     // This property is used to handle phone process crashes, and is the same for CDMA and IMS
2654:      * @return {@code true} if we are in emergency call back mode. This is a period where the phone
2674:      * @return true if this Phone is in an emergency call that caused emergency callback mode to be
2682:      * Set whether or not this Phone has an active emergency call that was placed during emergency
2738:      * Return a numerical identifier for the phone radio interface.
2739:      * @return PHONE_TYPE_XXX as defined above.
2752:     /** sets the voice mail count of the phone and notifies listeners. */
3441:      * Subclasses of Phone probably want to replace this with a
3459:      * Notify registrants if phone is video capable.
3573:         Rlog.e(LOG_TAG, "Error! This function should never be executed, inactive Phone.");
3586:      * Gets the Uicc card corresponding to this phone.
3587:      * @return the UiccCard object corresponding to the phone ID.
3617:      * Return an instance of a IMS phone
3740:      * Returns the phone id.
3752:         Phone imsPhone = mImsPhone;
3826:         Phone imsPhone = mImsPhone;
3845:         Phone imsPhone = mImsPhone;
3859:         Phone imsPhone = mImsPhone;
3873:         Phone imsPhone = mImsPhone;
3883:      * @return the IMS MmTel Registration technology for this Phone, defined in
3887:         Phone imsPhone = mImsPhone;
3897:      * Get the IMS MmTel Registration technology for this Phone, defined in
3901:         Phone imsPhone = mImsPhone;
3910:      * Asynchronously get the IMS MmTel Registration state for this Phone.
3913:         Phone imsPhone = mImsPhone;
3971:      *  Set phone radio capability
3973:      *  @param rc the phone radio capability defined in
3982:      *  Get phone radio access family
4002:      *  Get phone radio capability
4016:      *  @param rc the phone radio capability currently in effect for this phone.
4049:      * Registers the handler when phone radio  capability is changed.
4060:      * Unregister for notifications when phone radio type and access technology is changed.
4095:      * Determines if video calling is enabled for the phone.
4101:         Phone imsPhone = mImsPhone;
4225:     public static void checkWfcWifiOnlyModeBeforeDial(Phone imsPhone, int phoneId, Context context)
4265:      * This function returns the parent phone of the current phone. It is applicable
4266:      * only for IMS phone (function is overridden by ImsPhone). For others the phone
4304:      * none of the phone is in service, and one of them has the capability to make the emergency
4311:         for (Phone phone : PhoneFactory.getPhones()) {
4312:             if (phone != null) {
4313:                 ServiceState ss = phone.getServiceStateTracker().getServiceState();
4314:                 // One of the phone is in service, hence the device is not emergency call only.
4376:     /** Returns the {@link VoiceCallSessionStats} for this phone ID. */
4381:     /** Sets the {@link VoiceCallSessionStats} mock for this phone ID during unit testing. */
4397:         pw.println("Phone: subId=" + getSubId());
4572:         pw.println("Phone Local Log: ");
50: import android.telephony.PhoneStateListener;
79: import com.android.internal.telephony.imsphone.ImsPhoneCall;
112:  * originally called PhoneFactory to obtain the interface.
419:      * PhoneNotifier is an abstraction for all system-wide
424:     protected PhoneNotifier mNotifier;
453:      * Retrieves Nai for phones. Returns null if Nai is not set.
522:                     boolean unitTestMode, int phoneId,
524:         mPhoneId = phoneId;
563:          * By default old phones won't have the property set but do generate
597:      * Start setup of ImsPhone, which will start trying to connect to the ImsResolver. Will not be
606:             if (mImsPhone == null) {
607:                 mImsPhone = PhoneFactory.makeImsPhone(mNotifier, this);
608:                 CallManager.getInstance().registerPhone(mImsPhone);
609:                 mImsPhone.registerForSilentRedial(
684:                     PhoneConstants.State state = getState();
686:                             && ((state == PhoneConstants.State.RINGING) ||
687:                                     (state == PhoneConstants.State.IDLE))) {
698:                 if (getState() == PhoneConstants.State.RINGING) {
716:                         if (mImsPhone != null) {
718:                             mImsPhone.notifyRedialConnectionChanged(cn);
722:                         if (mImsPhone != null) {
723:                             mImsPhone.notifyRedialConnectionChanged(null);
797:                     if (imsPhone != null) {
798:                         conn = imsPhone.getHandoverConnection();
799:                         migrateFrom(imsPhone);
801:                         Rlog.d(LOG_TAG, "HANDOVER_STARTED: mImsPhone null");
806:                     if (imsPhone != null) {
807:                         imsPhone.notifySrvccState(srvccState);
809:                         Rlog.d(LOG_TAG, "HANDOVER_COMPLETED: mImsPhone null");
862:      * {@link PhoneConstants.State} which can be obtained using the {@link PhoneStateListener}
1032:             // Since CallManager has already registered with both CS and IMS phones,
1777:     public abstract PhoneConstants.State getState();
1975:      * Sets the minimum time in milli-seconds between {@link PhoneStateListener#onCellInfoChanged
1976:      * PhoneStateListener.onCellInfoChanged} will be invoked.
1991:      * available on this interface. Use PhoneStateNotifier or similar instead.
2097:      * available on this interface. Use PhoneStateNotifier or similar instead.
2139:      * interface. Use <code>PhoneStateNotifier</code> or an equivalent.
2572:     public PhoneConstants.DataState getDataConnectionState(String apnType) {
2573:         return PhoneConstants.DataState.DISCONNECTED;
2648:     // phones
2728:         if (mImsPhone != null) {
2729:             isPresent = isVideoCallOrConference(mImsPhone.getForegroundCall()) ||
2730:                     isVideoCallOrConference(mImsPhone.getBackgroundCall()) ||
2731:                     isVideoCallOrConference(mImsPhone.getRingingCall());
2873:      * Retrieves the MIN for CDMA phones.
2889:      *  Retrieves PRL Version for CDMA phones
3535:      * Retrieves the MSISDN from the UICC. For GSM/UMTS phones, this is equivalent to
3536:      * {@link #getLine1Number()}. For CDMA phones, {@link #getLine1Number()} returns
3537:      * the MDN, so this method is provided to return the MSISDN on CDMA/LTE phones.
3545:      * Retrieves the EF_PNN from the UICC For GSM/UMTS phones.
3554:      * {@link android.telephony.PhoneStateListener} instead.
3557:     public PhoneConstants.DataState getDataConnectionState() {
3558:         return getDataConnectionState(PhoneConstants.APN_TYPE_DEFAULT);
3572:         // This function should be overridden by class GsmCdmaPhone.
3621:         return mImsPhone;
3687:      * Return if UT capability of ImsPhone is enabled or not
3691:         if (mImsPhone != null) {
3692:             return mImsPhone.isUtEnabled();
3711:         // dialInternal shall be overriden by GsmCdmaPhone
3716:      * This function is for CSFB SS. GsmCdmaPhone overrides this function.
3748:      * Return the service state of mImsPhone if it is STATE_IN_SERVICE
3753:         if (imsPhone != null
3754:                 && imsPhone.getServiceState().getState() == ServiceState.STATE_IN_SERVICE) {
3828:         if (imsPhone != null) {
3829:             isImsRegistered = imsPhone.isImsRegistered();
3847:         if (imsPhone != null) {
3848:             isWifiCallingEnabled = imsPhone.isWifiCallingEnabled();
3861:         if (imsPhone != null) {
3862:             isAvailable = imsPhone.isImsCapabilityAvailable(capability, regTech);
3875:         if (imsPhone != null) {
3876:             isVolteEnabled = imsPhone.isVolteEnabled();
3889:         if (imsPhone != null) {
3890:             regTech = imsPhone.getImsRegistrationTech();
3902:         if (imsPhone != null) {
3903:             imsPhone.getImsRegistrationTech(callback);
3914:         if (imsPhone != null) {
3915:             imsPhone.getImsRegistrationState(callback);
4032:         int type = PhoneFactory.calculatePreferredNetworkType(mContext, getSubId());
4043:             int type = PhoneFactory.calculatePreferredNetworkType(mContext, getSubId());
4087:         if (mImsPhone == null) {
4091:         return mImsPhone.isImsAvailable();
4102:         if (imsPhone != null) {
4103:             return imsPhone.isVideoEnabled();
4227:         if (imsPhone == null || !imsPhone.isWifiCallingEnabled()) {
4228:             ImsManager imsManager = ImsManager.getInstance(context, phoneId);
4436:         if (mImsPhone != null) {
4438:                 mImsPhone.dump(fd, pw, args);
420:      * state change notification. DefaultPhoneNotifier is
497:      * @param notifier An instance of DefaultPhoneNotifier,
513:      * @param notifier An instance of DefaultPhoneNotifier,
2537:         // This function is added to send the notification to DefaultPhoneNotifier.
2659:         return mIsPhoneInEcmState;
2670:         mIsPhoneInEcmState = isInEcm;
2714:         if (call instanceof ImsPhoneCall) {
2715:             ImsPhoneCall imsPhoneCall = (ImsPhoneCall) call;
2716:             ImsCall imsCall = imsPhoneCall.getImsCall();
2770:                 mPhoneId, UiccController.APP_FAM_3GPP);
3511:      * A fucntion of type getPhoneProp(propType) where propType is an
3591:         return mUiccController.getUiccCard(mPhoneId);
3736:         return SubscriptionController.getInstance().getSubIdUsingPhoneId(mPhoneId);
3744:         return mPhoneId;
4074:         ImsManager imsManager = ImsManager.getInstance(mContext, mPhoneId);
4398:         pw.println(" mPhoneId=" + mPhoneId);
4425:         pw.println(" getPhoneName()=" + getPhoneName());
4426:         pw.println(" getPhoneType()=" + getPhoneType());
android.googlesource.com/platform/superproject:external/guice/examples/src/example/xml/Phone.java: [ master, ]
3: public class Phone {
android.googlesource.com/platform/external/guice:examples/src/example/xml/Phone.java: [ master, ] Duplicate result
android.googlesource.com/platform/external/valgrind:include/vki/vki-linux.h: [ master, ]
1643:   char phone[VKI_ISDN_MSNLEN];
1645: } vki_isdn_net_ioctl_phone;
android.googlesource.com/platform/frameworks/base:cmds/statsd/src/atoms.proto: [ master, ]
6706:         PHONE = 9;
138:         PhoneSignalStrengthChanged phone_signal_strength_changed =
199:         PhoneServiceStateChanged phone_service_state_changed = 94 [(module) = "framework"];
200:         PhoneStateChanged phone_state_changed = 95 [(module) = "framework"];
2816:         HARDWARE_FAILED_MICROPHONE = 1;
2986: message PhoneSignalStrengthChanged {
2998: message PhoneServiceStateChanged {
3010: message PhoneStateChanged {
1567:  *   frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1572:         // The keyguard is hidden when the phone is unlocked.
1574:         // The keyguard is shown when the phone is locked (screen turns off).
1588:  *   frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
2981:  * Logs phone signal strength changes.
2993:  * Logs when the phone state, sim state or signal strength changes
3005:  * Logs when the phone becomes on or off.
3068:                 statusbar/phone/NavigationBarView.java
3666:  *      frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
1735:     // For multi-sim phones, this distinguishes between the sim cards.
1757:     // For multi-sim phones, this distinguishes between the sim cards.
6491:  * time_in_state files not being present on some phones, have not been addressed. These should be
7925:  * Track how we arbitrate between microphone/input requests.
7940:  * Track how we arbitrate between microphone requests.
7955:  * Track how we arbitrate between microphone/input requests.
7970:  * 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/superproject:frameworks/base/cmds/statsd/src/atoms.proto: [ master, ]
5602:         PHONE = 9;
2546:         HARDWARE_FAILED_MICROPHONE = 1;
2716: message PhoneSignalStrengthChanged {
2728: message PhoneServiceStateChanged {
2740: message PhoneStateChanged {
116:         PhoneSignalStrengthChanged phone_signal_strength_changed = 40;
173:         PhoneServiceStateChanged phone_service_state_changed = 94;
174:         PhoneStateChanged phone_state_changed = 95;
1301:  *   frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1306:         // The keyguard is hidden when the phone is unlocked.
1308:         // The keyguard is shown when the phone is locked (screen turns off).
1322:  *   frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
2711:  * Logs phone signal strength changes.
2723:  * Logs when the phone state, sim state or signal strength changes
2735:  * Logs when the phone becomes on or off.
3272:  *      frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
1469:     // For multi-sim phones, this distinguishes between the sim cards.
1491:     // For multi-sim phones, this distinguishes between the sim cards.
5397:  * time_in_state files not being present on some phones, have not been addressed. These should be
6780:  * Track how we arbitrate between microphone/input requests.
6795:  * Track how we arbitrate between microphone requests.
6810:  * Track how we arbitrate between microphone/input requests.
6825:  * Track how we arbitrate between microphone/input requests.
chromium.googlesource.com/android_tools:sdk/sources/android-25/android/provider/ContactsContract.java: [ master, ]
1117:         public static final int PHONE = 20;
5941:         public static final class Phone implements DataColumnsWithJoins, CommonColumns,
5946:             private Phone() {}
9101:             public static final String PHONE = "phone";
9109:             public static final String PHONE_TYPE = "phone_type";
9115:             public static final String PHONE_ISPRIMARY = "phone_isprimary";
9121:             public static final String SECONDARY_PHONE = "secondary_phone";
9135:             public static final String TERTIARY_PHONE = "tertiary_phone";
1087:     public interface PhoneticNameStyle {
1185:         public static final String PHONETIC_NAME_STYLE = "phonetic_name_style";
1198:         public static final String PHONETIC_NAME = "phonetic_name";
5009:     protected interface PhoneLookupColumns {
5168:     public static final class PhoneLookup implements BaseColumns, PhoneLookupColumns,
5173:         private PhoneLookup() {}
5763:             public static final String PHONETIC_GIVEN_NAME = DATA7;
5769:             public static final String PHONETIC_MIDDLE_NAME = DATA8;
5775:             public static final String PHONETIC_FAMILY_NAME = DATA9;
5787:             public static final String PHONETIC_NAME_STYLE = DATA11;
6834:             public static final String PHONETIC_NAME = DATA8;
6846:             public static final String PHONETIC_NAME_STYLE = DATA10;
9077:             public static final String PHONETIC_NAME = "phonetic_name";
183:     public static final String STREQUENT_PHONE_ONLY = "strequent_phone_only";
990:         public static final String HAS_PHONE_NUMBER = "has_phone_number";
6008:             public static final String SEARCH_PHONE_NUMBER_KEY = "search_phone_number";
8995:         public static final String EXTRA_PHONE_URIS =
9129:             public static final String SECONDARY_PHONE_TYPE = "secondary_phone_type";
9143:             public static final String TERTIARY_PHONE_TYPE = "tertiary_phone_type";
1121:         public static final int STRUCTURED_PHONETIC_NAME = 37;
7637:         public static final String SUMMARY_WITH_PHONES = "summ_phones";
8023:         public static final String UNGROUPED_WITH_PHONES = "summ_phones";
8948:         public static final String ACTION_GET_MULTIPLE_PHONES =
68:  * as a phone number or email addresses.  The set of data kinds that can be
149:      * {@link CommonDataKinds.Phone#CONTENT_URI},
180:      * return only phone-related results. For example, frequently contacted person list should
181:      * include persons contacted via phone (not email, sms, etc.)
203:      * A boolean parameter for {@link CommonDataKinds.Phone#CONTENT_URI Phone.CONTENT_URI},
281:      * in email and phone lookup functionalities, it should also implement
284:      * {@link CommonDataKinds.Phone#CONTENT_FILTER_URI CommonDataKinds.Phone.CONTENT_FILTER_URI}.
581:          * allow creation of shortcuts for data items like email, phone or postal address,
986:          * An indicator of whether this contact has at least one phone number. "1" if there is
987:          * at least one phone number, "0" otherwise.
1110:      * of increasing priority: {@link #EMAIL}, {@link #PHONE},
1295:      * <li>If you need to look up a contact by the phone number, use
1376:      * <td>{@link #HAS_PHONE_NUMBER}</td>
1378:      * <td>An indicator of whether this contact has at least one phone number.
1379:      * "1" if there is at least one phone number, "0" otherwise.</td>
2409:      * Changes to the structured name, organization, phone number, email address,
2493:      * finalizes phone-side deletion by calling {@code resolver.delete(...)}
2496:      * changes to the phone, but not the reverse.  If one of those raw contacts
2497:      * is marked for deletion, it will remain on the phone.  However it will be
2710:      * SOURCE_ID field on the phone.
2731:      * the sync adapter updates the contact on the phone (without the
3234:          * camera that can be used for video chat (e.g. a front-facing camera on a phone).
4244:      * information (such as a phone number) and its
4255:      * {@link CommonDataKinds.Phone Phone.CONTENT_ITEM_TYPE}, then the column
4257:      * phone number, but if the data kind is
4264:      * {@link CommonDataKinds.Phone}, {@link CommonDataKinds.Email} etc. As a
4266:      * For example, {@link CommonDataKinds.Phone Phone.NUMBER} is the same as
4299:      * single transaction, which ensures that the phone-side and server-side
4337:      * values.put(Data.MIMETYPE, Phone.CONTENT_ITEM_TYPE);
4338:      * values.put(Phone.NUMBER, "1-800-GOOG-411");
4339:      * values.put(Phone.TYPE, Phone.TYPE_CUSTOM);
4340:      * values.put(Phone.LABEL, "free directory assistance");
4351:      *          .withValue(Data.MIMETYPE, Phone.CONTENT_ITEM_TYPE)
4352:      *          .withValue(Phone.NUMBER, "1-800-GOOG-411")
4353:      *          .withValue(Phone.TYPE, Phone.TYPE_CUSTOM)
4354:      *          .withValue(Phone.LABEL, "free directory assistance")
4400:      *          new String[] {Data._ID, Phone.NUMBER, Phone.TYPE, Phone.LABEL},
4402:      *                  + Data.MIMETYPE + "='" + Phone.CONTENT_ITEM_TYPE + "'",
4412:      *          new String[] {Data._ID, Phone.NUMBER, Phone.TYPE, Phone.LABEL},
4414:      *                  + Data.MIMETYPE + "='" + Phone.CONTENT_ITEM_TYPE + "'",
4454:      * <li>{@link CommonDataKinds.Phone Phone.CONTENT_ITEM_TYPE}</li>
4493:      * the default phone number to use for the contact).</td>
4677:      * <td>{@link #HAS_PHONE_NUMBER}</td>
5022:          * The phone number as the user entered it.
5028:          * The type of phone number, for example Home or Work.
5034:          * The user defined label for the phone number.
5040:          * The phone number's E164 representation.
5047:      * A table that represents the result of looking up a phone number, for
5066:      * <td>Phone number.</td>
5072:      * <td>Phone number type. See {@link CommonDataKinds.Phone}.</td>
5078:      * <td>Custom label for the phone number. See {@link CommonDataKinds.Phone}.</td>
5132:      * <td>{@link #HAS_PHONE_NUMBER}</td>
5176:          * The content:// style URI for this table. Append the phone number you want to lookup
5184:                 "phone_lookup");
5233:                 "phone_lookup_enterprise");
5236:          * The MIME type of {@link #CONTENT_FILTER_URI} providing a directory of phone lookup rows.
5240:         public static final String CONTENT_TYPE = "vnd.android.cursor.dir/phone_lookup";
5949:             public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/phone_v2";
5955:             public static final String CONTENT_TYPE = "vnd.android.cursor.dir/phone_v2";
5980:              * The content:// style URL for phone lookup using a filter. The filter returns
5982:              * to display names as well as phone numbers. The filter argument should be passed
6005:              * If "1" or "true", phone numbers are searched.  If "0" or "false", phone numbers
6032:              * The phone number as the user entered it.
6038:              * The phone number's E164 representation. This value can be omitted in which
7466:          * that users can use for calling purposes. {@link Phone} and {@link SipAddress} are the
7471:          * each column. For example the meaning for {@link Phone}'s type is different than
7478:              * Similar to {@link Phone#CONTENT_URI}, but returns callable data instead of only
7479:              * phone numbers.
7484:              * Similar to {@link Phone#CONTENT_FILTER_URI}, but allows users to filter callable
7491:              * Similar to {@link Phone#ENTERPRISE_CONTENT_FILTER_URI}, but allows users to filter
7501:          * to start communicating with a person ({@link Phone} and {@link Email}). Note that this
7505:          * can use to initiate communications with another contact. {@link Phone} and {@link Email}
7631:          * {@link CommonDataKinds.GroupMembership} in this group, and also have phone numbers.
7763:      * phone numbers. Read-only value that is only present when querying
8019:          * no {@link CommonDataKinds.GroupMembership} entries, and also have phone numbers.
8083:      * no {@link CommonDataKinds.GroupMembership} entries, and also have phone
8170:      * {@link ContactsContract.CommonDataKinds.Phone#CONTENT_FILTER_URI}, and users can benefit
8185:      * interactions using the same contact data field (for example a phone number can be used to
8186:      * make phone calls or send SMS).
8241:          * Type of usage for voice interaction, which includes phone call, voice chat, and
8371:          * For example, passing the value {@link CommonDataKinds.Phone#CONTENT_ITEM_TYPE} can
8372:          * cause phone numbers to be displayed more prominently in QuickContacts.
8581:          *             {@link CommonDataKinds.Phone#CONTENT_ITEM_TYPE} can cause phone numbers to be
8621:          *             {@link CommonDataKinds.Phone#CONTENT_ITEM_TYPE} can cause phone numbers to be
8813:          * phone number or human readable username/user_id like "a_super_cool_user_name". This label
8818:          * <li><em>Note: Some apps may choose to use phone number as the unique contact ID in DATA1.
8819:          * If this applies to you and you’d like phone number to be shown below the Contact Name by
8822:          * make sure it does not include prefix text such as "Message +<phone>" or "Free Message
8823:          * +<phone>", etc. If you must show the prefix text in the Contacts App, please use a
8833:          * will use existing phone number entries as contact ID's for such app.
8894:          * otherwise, the value will be a phone number), and should be the unambiguous contact
8895:          * endpoint. This value is app-specific, it could be some proprietary ID or a phone number.
8931:          * list of phone numbers which come from the contacts or
8932:          * {@link #EXTRA_PHONE_URIS}.
8934:          * The phone numbers being passed in through {@link #EXTRA_PHONE_URIS}
8940:          * {@link android.app.Activity#RESULT_OK}, the array of picked phone
8942:          * {@link #EXTRA_PHONE_URIS}; otherwise, the
8984:          * The phone numbers want to be picked by default should be passed in as
8985:          * input value. These phone numbers could belong to the contacts or not.
8987:          * The phone numbers which were picked by the user are returned as output
8990:          * Type: array of URIs, the tel URI is used for the phone numbers which don't
8991:          * belong to any contact, the content URI is used for phone id in contacts.
8996:             "com.android.contacts.extra.PHONE_URIS";
9098:              * The extra field for the contact phone number.
9104:              * The extra field for the contact phone number type.
9106:              * {@link CommonDataKinds.Phone},
9112:              * The extra field for the phone isprimary flag.
9118:              * The extra field for an optional second contact phone number.
9124:              * The extra field for an optional second contact phone number type.
9126:              * {@link CommonDataKinds.Phone},
9132:              * The extra field for an optional third contact phone number.
9138:              * The extra field for an optional third contact phone number type.
9140:              * {@link CommonDataKinds.Phone},
9242:              * For example, an Exchange contact can only have one phone numbers of type Home,
9243:              * so the contact editor may choose a different type for this phone number to
9244:              * avoid dropping the valueable part of the row, which is the phone number.
110:  * {@link PhoneLookup}, which is used for quick caller-ID lookup</li>
430:          * {@link PhoneLookup#ENTERPRISE_CONTENT_FILTER_URI}, may contain this kind of URI.
850:      * @see PhoneLookup
901:      * @see PhoneLookup
1091:          * Pinyin is a phonetic method of entering Chinese characters. Typically not explicitly
1103:          * Hangul is the Korean phonetic alphabet.
1111:      * {@link #ORGANIZATION}, {@link #NICKNAME}, {@link #STRUCTURED_PHONETIC_NAME},
1120:         /** Display name comes from a structured name that only has phonetic components. */
1182:          * The phonetic alphabet used to represent the {@link #PHONETIC_NAME}.  See
1183:          * {@link PhoneticNameStyle}.
1189:          * Pronunciation of the full name in the phonetic alphabet specified by
1190:          * {@link #PHONETIC_NAME_STYLE}.
1194:          * interest only in countries with commonly used phonetic alphabets,
1195:          * such as Japan and Korea. See {@link PhoneticNameStyle}.
1205:          * it is the Hiragana version of the phonetic name.
1296:      * {@link PhoneLookup#CONTENT_FILTER_URI PhoneLookup.CONTENT_FILTER_URI},
1496:          * {@link PhoneLookup#ENTERPRISE_CONTENT_FILTER_URI} may contain this kind of URI.
1739:          * {@link PhoneLookup#ENTERPRISE_CONTENT_FILTER_URI}.
1747:          * {@link PhoneLookup#ENTERPRISE_CONTENT_FILTER_URI}.
1756:          * {@link PhoneLookup#ENTERPRISE_CONTENT_FILTER_URI} may return such a contact.
2483:      * AggregationExceptions, PhoneLookup rows are deleted automatically. When all raw
3221:          * An allowed flag of {@link #CHAT_CAPABILITY}. Indicates audio-chat capability (microphone
5007:      * @see PhoneLookup
5052:      * Uri uri = Uri.withAppendedPath(PhoneLookup.CONTENT_FILTER_URI, Uri.encode(phoneNumber));
5053:      * resolver.query(uri, new String[]{PhoneLookup.DISPLAY_NAME,...
5060:      * <th colspan='4'>PhoneLookup</th>
5179:          * Uri lookupUri = Uri.withAppendedPath(PhoneLookup.CONTENT_FILTER_URI,
5180:          *         Uri.encode(phoneNumber));
5228:          * Uri lookupUri = Uri.withAppendedPath(PhoneLookup.ENTERPRISE_CONTENT_FILTER_URI,
5229:          *         Uri.encode(phoneNumber));
5694:          * <td>{@link #PHONETIC_GIVEN_NAME}</td>
5696:          * <td>Used for phonetic spelling of the name, e.g. Pinyin, Katakana, Hiragana</td>
5700:          * <td>{@link #PHONETIC_MIDDLE_NAME}</td>
5706:          * <td>{@link #PHONETIC_FAMILY_NAME}</td>
5760:              * The phonetic version of the given name for the contact.
5766:              * The phonetic version of the additional name for the contact.
5772:              * The phonetic version of the family name for the contact.
5784:              * The alphabet used for capturing the phonetic name.
5785:              * See ContactsContract.PhoneticNameStyle.
5883:          * A data kind representing a telephone number.
5953:              * phones.
5963:                     "phones");
5977:                     Uri.withAppendedPath(Data.ENTERPRISE_CONTENT_URI, "phones");
6072:                     case TYPE_HOME: return com.android.internal.R.string.phoneTypeHome;
6073:                     case TYPE_MOBILE: return com.android.internal.R.string.phoneTypeMobile;
6074:                     case TYPE_WORK: return com.android.internal.R.string.phoneTypeWork;
6075:                     case TYPE_FAX_WORK: return com.android.internal.R.string.phoneTypeFaxWork;
6076:                     case TYPE_FAX_HOME: return com.android.internal.R.string.phoneTypeFaxHome;
6077:                     case TYPE_PAGER: return com.android.internal.R.string.phoneTypePager;
6078:                     case TYPE_OTHER: return com.android.internal.R.string.phoneTypeOther;
6079:                     case TYPE_CALLBACK: return com.android.internal.R.string.phoneTypeCallback;
6080:                     case TYPE_CAR: return com.android.internal.R.string.phoneTypeCar;
6081:                     case TYPE_COMPANY_MAIN: return com.android.internal.R.string.phoneTypeCompanyMain;
6082:                     case TYPE_ISDN: return com.android.internal.R.string.phoneTypeIsdn;
6083:                     case TYPE_MAIN: return com.android.internal.R.string.phoneTypeMain;
6084:                     case TYPE_OTHER_FAX: return com.android.internal.R.string.phoneTypeOtherFax;
6085:                     case TYPE_RADIO: return com.android.internal.R.string.phoneTypeRadio;
6086:                     case TYPE_TELEX: return com.android.internal.R.string.phoneTypeTelex;
6087:                     case TYPE_TTY_TDD: return com.android.internal.R.string.phoneTypeTtyTdd;
6088:                     case TYPE_WORK_MOBILE: return com.android.internal.R.string.phoneTypeWorkMobile;
6089:                     case TYPE_WORK_PAGER: return com.android.internal.R.string.phoneTypeWorkPager;
6090:                     case TYPE_ASSISTANT: return com.android.internal.R.string.phoneTypeAssistant;
6091:                     case TYPE_MMS: return com.android.internal.R.string.phoneTypeMms;
6092:                     default: return com.android.internal.R.string.phoneTypeCustom;
6769:          * <td>{@link #PHONETIC_NAME}</td>
6781:          * <td>PHONETIC_NAME_STYLE</td>
6831:              * The phonetic name of this company as the user entered it.
6843:              * The alphabet used for capturing the phonetic name.
6844:              * See {@link ContactsContract.PhoneticNameStyle}.
7759:      * <td>{@link #SUMMARY_WITH_PHONES}</td>
8080:      * <td>{@link #UNGROUPED_WITH_PHONES}</td>
8505:          *            {@link PhoneLookup#ENTERPRISE_CONTENT_FILTER_URI}.
8541:          *            {@link PhoneLookup#ENTERPRISE_CONTENT_FILTER_URI}.
8574:          *            {@link PhoneLookup#ENTERPRISE_CONTENT_FILTER_URI}.
8614:          *            {@link PhoneLookup#ENTERPRISE_CONTENT_FILTER_URI}.
8930:          * Starts an Activity that lets the user select the multiple phones from a
8949:                 "com.android.contacts.action.GET_MULTIPLE_PHONES";
8982:          * Used with {@link #ACTION_GET_MULTIPLE_PHONES} as the input or output value.
9074:              * The extra field for the contact phonetic name.
android.googlesource.com/platform/superproject:tools/adt/idea/android/gen/icons/AndroidIcons.java: [ master, ]
166:     public static final Icon Phone = load("/icons/nele/phone.png");
83:     public static final Icon Mobile_32 = load("/icons/formfactors/phone_tablet_32.png"); // 32x32
89:     public static final Icon Mobile_64 = load("/icons/formfactors/64/phone_tablet.png"); // 64x64
android.googlesource.com/platform/tools/adt/idea:android/gen/icons/AndroidIcons.java: [ master, ] Duplicate result
android.googlesource.com/platform/packages/apps/ContactsCommon:src/com/android/contacts/common/model/account/BaseAccountType.java: [ master, ]
104:         static final int PHONE = 10;
60:     protected static final int FLAGS_PHONE = EditorInfo.TYPE_CLASS_PHONE;
256:     protected DataKind addDataKindPhone(Context context) throws DefinitionException {
540:     public static class PhoneActionInflater extends CommonInflater {
552:     public static class PhoneActionAltInflater extends CommonInflater {
1034:     private static class PhoneKindBuilder extends KindBuilder {
65:     protected static final int FLAGS_PHONETIC = EditorInfo.TYPE_CLASS_TEXT
125