Found 26831 results in 3821 files, showing top 50 files (show more).
android.googlesource.com/platform/packages/services/Telephony:src/com/android/phone/PhoneInterfaceManager.java: [ master, ]
377:         public Phone phone;
17: package com.android.phone;
198: public class PhoneInterfaceManager extends ITelephony.Stub {
1639:     private PhoneInterfaceManager(PhoneGlobals app) {
1655:     private Phone getDefaultPhone() {
1686:     private Phone getPhone(int subId) {
2294:     public String getNetworkCountryIsoForPhone(int phoneId) {
5781:     public int checkCarrierPrivilegesForPackageAnyPhone(String pkgName) {
5804:     public List<String> getCarrierPackageNamesForIntentAndPhone(Intent intent, int phoneId) {
6262:     public boolean isWorldPhone(int subId, String callingPackage, String callingFeatureId) {
307:     private PhoneConfigurationManager mPhoneConfigurationManager;
1666:     private Phone getPhoneFromRequest(MainThreadRequest request) {
1674:     private Phone getPhoneFromSubId(int subId) {
2072:     private void shutdownRadioUsingPhoneId(int phoneId) {
2734:     public int getActivePhoneType() {
2739:     public int getActivePhoneTypeForSlot(int slotIndex) {
3778:     private void checkModifyPhoneStatePermission(int subId, String message) {
4416:     private Phone getPhoneFromSlotIdOrThrowException(int slotIndex) {
5848:     public List<String> getPackagesWithCarrierPrivilegesForAllPhones() {
6388:     public int getSubIdForPhoneAccount(PhoneAccount phoneAccount) {
6398:     public int getSubIdForPhoneAccountHandle(
6413:     public @Nullable PhoneAccountHandle getPhoneAccountHandleForSubscriptionId(int subscriptionId) {
21: import static com.android.internal.telephony.PhoneConstants.PHONE_TYPE_IMS;
142: import com.android.internal.telephony.Phone;
175: import com.android.phone.settings.PickSmsSubscriptionActivity;
176: import com.android.phone.vvm.PhoneAccountHandleConverter;
177: import com.android.phone.vvm.RemoteVvmTaskManager;
178: import com.android.phone.vvm.VisualVoicemailSettingsUtil;
179: import com.android.phone.vvm.VisualVoicemailSmsFilterConfig;
376:         // In cases where subId is unavailable, the caller needs to specify the phone.
385:         MainThreadRequest(Object argument, Phone phone, WorkSource workSource) {
387:             if (phone != null) {
388:                 this.phone = phone;
416:      * A handler that processes messages on the main thread in the phone process. Since many
417:      * of the Phone calls are not thread safe this is needed to shuttle the requests from the
418:      * inbound binder threads to the main thread in the phone process.  The Binder thread
435:             final Phone defaultPhone = getDefaultPhone();
440:                     final Phone phone = getPhoneFromRequest(request);
459:                         request.result = phone != null
460:                                 ? phone.handleUssdRequest(ussdRequest, wrappedCallback) : false;
471:                     final Phone phone = getPhoneFromRequest(request);
472:                     request.result = phone != null ?
1257:                     request.phone.requestCellInfoUpdate(request.workSource, onCompleted);
1271:                     request.phone.requestCellInfoUpdate(request.workSource,
1299:                     Phone phone = getPhoneFromRequest(request);
1300:                     phone.getCellIdentity(ws, obtainMessage(EVENT_GET_CELL_LOCATION_DONE, request));
1308:                         phone = getPhoneFromRequest(request);
1309:                         request.result = (phone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA)
1331:                             .enablePhone(request.phone, enable, onCompleted);
1337:                     int phoneId = request.phone.getPhoneId();
1352:                             .getPhoneStatusFromModem(request.phone, onCompleted);
1357:                     int id = request.phone.getPhoneId();
1380:                     request.phone.setSystemSelectionChannels(args.first, onCompleted);
1553:     private Object sendRequest(int command, Object argument, Phone phone, WorkSource workSource) {
1555:                 command, argument, SubscriptionManager.INVALID_SUBSCRIPTION_ID, phone, workSource);
1564:             int command, Object argument, Integer subId, Phone phone, WorkSource workSource) {
1570:         if (subId != SubscriptionManager.INVALID_SUBSCRIPTION_ID && phone != null) {
1571:             throw new IllegalArgumentException("subId and phone cannot both be specified!");
1572:         } else if (phone != null) {
1573:             request = new MainThreadRequest(argument, phone, workSource);
1613:      * Same as {@link #sendRequestAsync(int,Object)} except it takes a Phone and WorkSource.
1617:             int command, Object argument, Phone phone, WorkSource workSource) {
1618:         MainThreadRequest request = new MainThreadRequest(argument, phone, workSource);
1656:         Phone thePhone = getPhone(getDefaultSubscription());
1663:         ServiceManager.addService("phone", this);
1667:         if (request.phone != null) {
1668:             return request.phone;
1680:         Phone phone = getPhoneFromRequest(request);
1681:         return phone == null ? null :
1682:                 UiccController.getInstance().getUiccCard(phone.getPhoneId());
1685:     // returns phone associated with the subId.
1690:     private void sendEraseModemConfig(Phone phone) {
1691:         if (phone != null) {
1693:                   mApp, phone.getSubId(), "eraseModemConfig");
1731:             // PENDING: should we just silently fail if phone is offhook or ringing?
1752:         // from the context of the phone app.
1755:         if (mAppOps.noteOp(AppOpsManager.OPSTR_CALL_PHONE, Binder.getCallingUid(), callingPackage)
1941:             final Phone phone = getPhone(subId);
1942:             if (phone != null) {
1943:                 phone.updateServiceLocation();
1987:             final Phone phone = getPhone(subId);
1988:             if (phone != null) {
1989:                 return phone.getServiceState().getState() != ServiceState.STATE_POWER_OFF;
2007:             final Phone phone = getPhone(subId);
2008:             if (phone != null) {
2009:                 phone.setRadioPower(!isRadioOnForSubscriber(subId));
2025:             final Phone phone = getPhone(subId);
2026:             if (phone == null) {
2029:             if ((phone.getServiceState().getState() != ServiceState.STATE_POWER_OFF) != turnOn) {
2047:                 Phone phone = PhoneFactory.getPhone(i);
2048:                 if (phone != null && phone.isRadioAvailable()) return true;
2064:                 logv("Shutting down Phone " + i);
2073:         Phone phone = PhoneFactory.getPhone(phoneId);
2074:         if (phone != null && phone.isRadioAvailable()) {
2075:             phone.shutdownRadio();
2084:             final Phone defaultPhone = PhoneFactory.getDefaultPhone();
2089:                 loge("There's no default phone.");
2102:             final Phone phone = getPhone(subId);
2103:             if (phone != null) {
2104:                 phone.setRadioPower(turnOn);
2122:             final Phone phone = getPhone(subId);
2123:             if (phone != null) {
2124:                 phone.getDataEnabledSettings().setUserDataEnabled(true);
2142:             final Phone phone = getPhone(subId);
2143:             if (phone != null) {
2144:                 phone.getDataEnabledSettings().setUserDataEnabled(false);
2158:             final Phone phone = getPhone(subId);
2159:             if (phone != null) {
2160:                 return phone.isDataAllowed(ApnSetting.TYPE_DEFAULT);
2209:             Phone phone = PhoneFactory.getPhone(slotIndex);
2210:             return phone == null ? TelephonyManager.CALL_STATE_IDLE :
2211:                     PhoneConstantConversions.convertCallState(phone.getState());
2226:             final Phone phone = getPhone(subId);
2227:             if (phone != null) {
2228:                 return PhoneConstantConversions.convertDataState(phone.getDataConnectionState());
2247:             final Phone phone = getPhone(subId);
2248:             if (phone != null) {
2249:                 return DefaultPhoneNotifier.convertDataActivityState(phone.getDataActivityState());
2278:                 return (getDefaultPhone().getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA)
2299:             if (phoneId == SubscriptionManager.INVALID_PHONE_INDEX) {
2300:                 // Get default phone in this case.
2301:                 phoneId = SubscriptionManager.DEFAULT_PHONE_INDEX;
2304:             Phone phone = PhoneFactory.getPhone(phoneId);
2305:             if (phone == null) return "";
2306:             ServiceStateTracker sst = phone.getServiceStateTracker();
2311:             EmergencyNumberTracker ent = phone.getEmergencyNumberTracker();
2330:             final Phone phone = getPhone(subId);
2331:             if (phone != null) {
2332:                 phone.enableLocationUpdates();
2351:             final Phone phone = getPhone(subId);
2352:             if (phone != null) {
2353:                 phone.disableLocationUpdates();
2412:         for (Phone phone : PhoneFactory.getPhones()) {
2413:             List<CellInfo> info = phone.getAllCellInfo();
2452:             for (Phone phone : PhoneFactory.getPhones()) {
2454:                         CMD_GET_ALL_CELL_INFO, null, phone, workSource);
2505:         final Phone phone = getPhoneFromSubId(subId);
2506:         if (phone == null) throw new IllegalArgumentException("Invalid Subscription Id: " + subId);
2508:         sendRequestAsync(CMD_REQUEST_CELL_INFO_UPDATE, cb, phone, workSource);
2526:         Phone phone = PhoneFactory.getPhone(slotIndex);
2527:         if (phone == null) {
2530:         int subId = phone.getSubId();
2538:             return phone.getImei();
2546:         Phone phone = PhoneFactory.getPhone(slotIndex);
2548:         if (phone != null) {
2549:             String imei = phone.getImei();
2557:         Phone phone = PhoneFactory.getPhone(slotIndex);
2558:         if (phone == null) {
2562:         int subId = phone.getSubId();
2570:             return phone.getMeid();
2578:         Phone phone = PhoneFactory.getPhone(slotIndex);
2580:         if (phone != null) {
2581:             String meid = phone.getMeid();
2590:         Phone phone = PhoneFactory.getPhone(slotIndex);
2591:         if (phone == null) {
2594:         int subId = phone.getSubId();
2603:             return phone.getDeviceSvn();
2613:             final Phone phone = getPhone(subId);
2614:             return phone == null ? TelephonyManager.UNKNOWN_CARRIER_ID : phone.getCarrierId();
2624:             final Phone phone = getPhone(subId);
2625:             return phone == null ? null : phone.getCarrierName();
2635:             final Phone phone = getPhone(subId);
2636:             return phone == null ? TelephonyManager.UNKNOWN_CARRIER_ID
2637:                     : phone.getSpecificCarrierId();
2647:             final Phone phone = getPhone(subId);
2648:             return phone == null ? null : phone.getSpecificCarrierName();
2659:         final Phone phone = PhoneFactory.getPhone(slotIndex);
2660:         if (phone == null) {
2665:             return CarrierResolver.getCarrierIdFromMccMnc(phone.getContext(), mccmnc);
2676:      * Make sure the caller has the MODIFY_PHONE_STATE permission.
2681:         mApp.enforceCallingOrSelfPermission(android.Manifest.permission.MODIFY_PHONE_STATE, null);
2701:      * Make sure the caller has the CALL_PHONE permission.
2706:         mApp.enforceCallingOrSelfPermission(android.Manifest.permission.CALL_PHONE, null);
2742:             final Phone phone = PhoneFactory.getPhone(slotIndex);
2743:             if (phone == null) {
2744:                 return PhoneConstants.PHONE_TYPE_NONE;
2746:                 return phone.getPhoneType();
2773:             final Phone phone = getPhone(subId);
2774:             if (phone != null) {
2775:                 return phone.getCdmaEriIconIndex();
2806:             final Phone phone = getPhone(subId);
2807:             if (phone != null) {
2808:                 return phone.getCdmaEriIconMode();
2837:             final Phone phone = getPhone(subId);
2838:             if (phone != null) {
2839:                 return phone.getCdmaEriText();
2858:             final Phone phone = getPhone(subId);
2859:             if (phone != null && phone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA) {
2860:                 return phone.getLine1Number();
2862:                 loge("getCdmaMdn: no phone found. Invalid subId: " + subId);
2880:             final Phone phone = getPhone(subId);
2881:             if (phone != null && phone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA) {
2882:                 return phone.getCdmaMin();
2894:         if (mApp.checkCallingOrSelfPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
2896:             throw new SecurityException("Caller must hold the MODIFY_PHONE_STATE permission");
3060:             final Phone phone = getPhone(subId);
3061:             if (phone != null) {
3062:                 phone.setVoiceActivationState(activationState);
3081:             final Phone phone = getPhone(subId);
3082:             if (phone != null) {
3083:                 phone.setDataActivationState(activationState);
3099:         final Phone phone = getPhone(subId);
3102:             if (phone != null) {
3103:                 return phone.getVoiceActivationState();
3119:         final Phone phone = getPhone(subId);
3122:             if (phone != null) {
3123:                 return phone.getDataActivationState();
3145:             final Phone phone = getPhone(subId);
3146:             if (phone != null) {
3147:                 return phone.getVoiceMessageCount();
3164:             final Phone phone = getPhone(subId);
3165:             return (phone == null ? false : phone.isConcurrentVoiceAndDataAllowed());
3178:         final Phone defaultPhone = getDefaultPhone();
3216:             for (Phone phone : PhoneFactory.getPhones()) {
3217:                 if (phone.isInEmergencySmsMode()) {
3228:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3255:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3293:             Phone phone = getPhone(subId);
3294:             if (phone == null) {
3299:             phone.getImsRegistrationState(regState -> {
3326:             Phone phone = getPhone(subId);
3327:             if (phone == null) {
3332:             phone.getImsRegistrationTech(regTech -> {
3351:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3377:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3428:             Phone phone = getPhone(subId);
3429:             if (phone == null) return false;
3430:             return phone.isImsCapabilityAvailable(capability, regTech);
3478:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3515:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3549:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3584:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3636:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3718:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3785:         Phone phone = getPhone(subId);
3786:         if (phone == null) {
3787:             loge("phone instance null for subid " + subId);
3791:             if (!doesImsCapabilityRequireProvisioning(phone.getContext(), subId, capability)) {
3795:             if (!doesRcsCapabilityRequireProvisioning(phone.getContext(), subId, capability)) {
4229:             final Phone phone = getPhone(subId);
4230:             if (phone != null) {
4231:                 return phone.getServiceState().getDataNetworkType();
4263:             final Phone phone = getPhone(subId);
4264:             if (phone != null) {
4265:                 return phone.getServiceState().getDataNetworkType();
4288:             final Phone phone = getPhone(subId);
4289:             if (phone != null) {
4290:                 return phone.getServiceState().getVoiceNetworkType();
4315:             final Phone phone = PhoneFactory.getPhone(slotIndex);
4316:             if (phone != null) {
4317:                 return phone.getIccCard().hasIccCard();
4332:      * @return {@link Phone#LTE_ON_CDMA_UNKNOWN}, {@link Phone#LTE_ON_CDMA_FALSE}
4333:      * or {@link Phone#LTE_ON_CDMA_TRUE}
4352:             final Phone phone = getPhone(subId);
4353:             if (phone == null) {
4356:                 return phone.getLteOnCdmaMode();
4420:                     + " does not correspond to an active phone");
4451:     private IccOpenLogicalChannelResponse iccOpenLogicalChannelWithPermission(Phone phone,
4468:                     CMD_OPEN_CHANNEL, new Pair<String, Integer>(aid, p2), phone,
4493:     private boolean iccCloseLogicalChannelWithPermission(Phone phone, int channel) {
4499:             Boolean success = (Boolean) sendRequest(CMD_CLOSE_CHANNEL, channel, phone,
4536:     private String iccTransmitApduLogicalChannelWithPermission(Phone phone, int channel, int cla,
4545:                     new IccAPDUArgument(channel, cla, command, p1, p2, p3, data), phone,
4592:     private String iccTransmitApduBasicChannelWithPermission(Phone phone, String callingPackage,
4610:                     new IccAPDUArgument(0, cla, command, p1, p2, p3, data), phone,
4844:         Phone phone = PhoneFactory.getPhone(slotIndex);
4845:         if (phone != null) {
4847:                     mApp, phone.getSubId(), "resetModemConfig");
4870:         Phone phone = PhoneFactory.getPhone(slotIndex);
4871:         if (phone != null) {
4873:                     mApp, phone.getSubId(), "rebootModem");
4889:         final Phone defaultPhone = getDefaultPhone();
5414:         final Phone defaultPhone = getDefaultPhone();
5532:         final Phone phone = getPhone(subId);
5534:             if (phone != null) {
5535:                 return phone.hasMatchedTetherApnSetting();
5559:             Phone phone = PhoneFactory.getPhone(phoneId);
5560:             if (phone != null) {
5562:                 phone.getDataEnabledSettings().setUserDataEnabled(enable);
5564:                 loge("setUserDataEnabled: no phone found. Invalid subId=" + subId);
5582:         final Phone phone = getPhone(subId);
5584:             if (phone != null) {
5589:                 phone.setAlwaysReportSignalStrength(isEnable);
5591:                 loge("setAlwaysReportSignalStrength: no phone found for subId="
5620:      * Accepts either ACCESS_NETWORK_STATE, MODIFY_PHONE_STATE or carrier privileges.
5638:             Phone phone = PhoneFactory.getPhone(phoneId);
5639:             if (phone != null) {
5640:                 boolean retVal = phone.isUserDataEnabled();
5644:                 if (DBG) loge("isUserDataEnabled: no phone subId=" + subId + " retVal=false");
5667:             Phone phone = PhoneFactory.getPhone(phoneId);
5668:             if (phone != null) {
5669:                 boolean retVal = phone.getDataEnabledSettings().isDataEnabled();
5673:                 if (DBG) loge("isDataEnabled: no phone subId=" + subId + " retVal=false");
5682:             Phone phone) {
5688:         PackageManager pkgMgr = phone.getContext().getPackageManager();
5693:             SubscriptionInfo subInfo = subController.getSubscriptionInfo(phone.getSubId());
5695:                     phone.getContext().getSystemService(Context.TELEPHONY_SUBSCRIPTION_SERVICE);
5707:     private int getCarrierPrivilegeStatusFromCarrierConfigRules(int privilegeFromSim, Phone phone,
5716:             SubscriptionInfo subInfo = subController.getSubscriptionInfo(phone.getSubId());
5718:                     phone.getContext().getSystemService(Context.TELEPHONY_SUBSCRIPTION_SERVICE);
5728:         final Phone phone = getPhone(subId);
5729:         if (phone == null) {
5733:         UiccCard card = UiccController.getInstance().getUiccCard(phone.getPhoneId());
5741:                 phone.getContext().getPackageManager()), Binder.getCallingUid(), phone);
5747:         final Phone phone = getPhone(subId);
5748:         if (phone == null) {
5753:                 UiccController.getInstance().getUiccProfileForPhone(phone.getPhoneId());
5760:                         phone.getContext().getPackageManager(), uid), uid, phone);
5865:         final Phone phone = getPhone(subId);
5866:         UiccCard card = phone == null ? null : phone.getUiccCard();
5888:             final Phone phone = getPhone(subId);
5889:             if (phone == null) {
5892:             final String subscriberId = phone.getSubscriberId();
6115:             final Phone phone = getPhone(subId);
6116:             return phone == null ? false : phone.setOperatorBrandOverride(brand);
6131:             final Phone phone = getPhone(subId);
6132:             if (phone == null) {
6135:             return phone.setRoamingOverride(gsmRoamingList, gsmNonRoamingList, cdmaRoamingList,
6186:         Phone phone = PhoneFactory.getPhone(phoneId);
6188:         if (phone == null) {
6195:                             mApp, phone.getSubId(), "getRadioAccessFamily");
6205:         final Phone defaultPhone = getDefaultPhone();
6219:         final Phone defaultPhone = getDefaultPhone();
6273:                     .getBoolean(CarrierConfigManager.KEY_WORLD_PHONE_BOOL);
6304:         final Phone phone = getPhone(subscriptionId);
6305:         if (phone == null) {
6306:             loge("isRttSupported: no Phone found. Invalid subId:" + subscriptionId);
6313:                     phone.getContext().getResources().getBoolean(R.bool.config_support_rtt);
6346:      * Returns the unique device ID of phone, for example, the IMEI for
6350:      *   {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
6354:         final Phone phone = PhoneFactory.getPhone(0);
6355:         if (phone == null) {
6358:         int subId = phone.getSubId();
6366:             return phone.getDeviceId();
6379:         Phone phone = getPhone(subId);
6380:         if (phone != null) {
6381:             return phone.isImsRegistered();
6402:             throw new SecurityException("Requires READ_PHONE_STATE permission.");
6416:             Phone phone = getPhone(subscriptionId);
6417:             if (phone == null) {
6420:             return PhoneUtils.makePstnPhoneAccountHandle(phone);
6432:             Phone phone = getPhone(subId);
6433:             if (phone != null) {
6434:                 return phone.isWifiCallingEnabled();
6449:             Phone phone = getPhone(subId);
6450:             if (phone != null) {
6451:                 return phone.isVideoEnabled();
6467:             Phone phone = getPhone(subId);
6468:             if (phone != null) {
6469:                 return phone.getImsRegistrationTech();
6527:         final Phone phone = getPhone(subId);
6528:         if (phone == null) {
6535:                     phone.getContext().getOpPackageName(), null);
6544:             final Locale localeFromDefaultSim = phone.getLocaleFromSimAndCarrierPrefs();
6672:             final Phone phone = getPhone(subId);
6673:             if (phone == null) {
6677:             ServiceState ss = phone.getServiceState();
6690:      * Returns the URI for the per-account voicemail ringtone set in Phone settings.
6701:             Phone phone = PhoneUtils.getPhoneForPhoneAccountHandle(accountHandle);
6702:             if (phone == null) {
6703:                 phone = getDefaultPhone();
6706:             return VoicemailNotificationSettingsUtil.getRingtoneUri(phone.getContext());
6716:      * has permission {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}.
6726:         final Phone defaultPhone = getDefaultPhone();
6737:             Phone phone = PhoneUtils.getPhoneForPhoneAccountHandle(phoneAccountHandle);
6738:             if (phone == null) {
6739:                 phone = defaultPhone;
6741:             VoicemailNotificationSettingsUtil.setRingtoneUri(phone.getContext(), uri);
6748:      * Returns whether vibration is set for voicemail notification in Phone settings.
6758:             Phone phone = PhoneUtils.getPhoneForPhoneAccountHandle(accountHandle);
6759:             if (phone == null) {
6760:                 phone = getDefaultPhone();
6763:             return VoicemailNotificationSettingsUtil.isVibrationEnabled(phone.getContext());
6773:      * has permission {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}.
6783:         final Phone defaultPhone = getDefaultPhone();
6794:             Phone phone = PhoneUtils.getPhoneForPhoneAccountHandle(phoneAccountHandle);
6795:             if (phone == null) {
6796:                 phone = defaultPhone;
6798:             VoicemailNotificationSettingsUtil.setVibrationEnabled(phone.getContext(), enabled);
6805:      * Make sure either called from same process as self (phone) or IPC caller has read privilege.
6810:         mApp.enforceCallingOrSelfPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE,
6815:      * Make sure either called from same process as self (phone) or IPC caller has send SMS
6858:         Phone phone = getPhone(subId);
6862:             if (phone == null) {
6867:                 aid = UiccController.getInstance().getUiccCard(phone.getPhoneId())
6887:         Phone phone = getPhone(subId);
6891:             if (phone == null) {
6896:                 esn = phone.getEsn();
6915:         Phone phone = getPhone(subId);
6919:             if (phone == null) {
6924:                 cdmaPrlVersion = phone.getCdmaPrlVersion();
7018:         final Phone phone = getPhone(subId);
7021:         if (phone == null) {
7026:             phone.carrierActionSetMeteredApnsEnabled(enabled);
7043:         final Phone phone = getPhone(subId);
7046:         if (phone == null) {
7051:             phone.carrierActionSetRadioEnabled(enabled);
7071:         final Phone phone = getPhone(subId);
7074:         if (phone == null) {
7079:             phone.carrierActionReportDefaultNetworkStatus(report);
7095:         final Phone phone = getPhone(subId);
7096:         if (phone == null) {
7101:             phone.carrierActionResetAll();
7108:      * Called when "adb shell dumpsys phone" is invoked. Dump is also automatically invoked when a
7115:             writer.println("Permission Denial: can't dump Phone from pid="
7145:             Phone phone = getPhone(subId);
7146:             if (phone != null) {
7147:                 phone.getDataEnabledSettings().setPolicyDataEnabled(enabled);
7166:         Phone phone = getPhone(subId);
7170:             if (phone != null) {
7171:                 return phone.getClientRequestStats();
7198:         Phone phone = PhoneFactory.getPhone(slotIndex);
7204:             if (phone != null) {
7205:                 phone.setSimPowerState(state, workSource);
7227:      * Check if phone is in emergency callback mode
7228:      * @return true if phone is in emergency callback mode
7234:         final Phone phone = getPhone(subId);
7238:             if (phone != null) {
7239:                 return phone.isInEcm();
7259:             Phone p = getPhone(subId);
7279:         Phone phone = PhoneFactory.getPhone(slotIndex);
7280:         if (phone != null) {
7281:             if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp, phone.getSubId(),
7288:                 return phone.getRadioPowerState();
7301:      * {@link android.Manifest.permission#READ_PHONE_STATE} or that the calling app has carrier
7316:             Phone phone = getPhone(subId);
7317:             isEnabled =  phone != null ? phone.getDataRoamingEnabled() : false;
7332:      * {@link android.Manifest.permission#MODIFY_PHONE_STATE} or that the calling app has carrier
7345:             Phone phone = getPhone(subId);
7346:             if (phone != null) {
7347:                 phone.setDataRoamingEnabled(isEnabled);
7363:             Phone phone = getPhone(subId);
7364:             if (phone != null) {
7365:                 isAllowed = phone.isCspPlmnEnabled();
7380:             // even without READ_PRIVILEGED_PHONE_STATE, we allow the call to continue if the caller
7517:      * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}.
7526:             Phone phone = getPhone(subId);
7527:             if (phone == null) {
7530:             UiccCard uiccCard = phone.getUiccCard();
7567:      * not set, return {@link Phone#PREFERRED_NT_MODE}.
7575:         return Phone.PREFERRED_NT_MODE;
7585:             final Phone phone = getPhone(subId);
7586:             if (phone == null) {
7590:             phone.setCarrierTestOverride(mccmnc, imsi, iccid, gid1, gid2, plmn, spn,
7603:             final Phone phone = getPhone(subId);
7604:             if (phone == null) {
7608:             return phone.getCarrierIdListVersion();
7677:             throw new SecurityException("Requires READ_PHONE_STATE permission.");
7682:             for (Phone phone: PhoneFactory.getPhones()) {
7683:                 if (phone.getEmergencyNumberTracker() != null
7684:                         && phone.getEmergencyNumberTracker().getEmergencyNumberList() != null) {
7686:                             phone.getSubId(),
7687:                             phone.getEmergencyNumberTracker().getEmergencyNumberList());
7698:         final Phone defaultPhone = getDefaultPhone();
7706:             for (Phone phone: PhoneFactory.getPhones()) {
7707:                 if (phone.getEmergencyNumberTracker() != null
7708:                         && phone.getEmergencyNumberTracker() != null) {
7709:                     if (phone.getEmergencyNumberTracker().isEmergencyNumber(
7731:             for (Phone phone: PhoneFactory.getPhones()) {
7732:                 EmergencyNumberTracker tracker = phone.getEmergencyNumberTracker();
7753:             for (Phone phone: PhoneFactory.getPhones()) {
7754:                 EmergencyNumberTracker tracker = phone.getEmergencyNumberTracker();
7773:             final Phone phone = getPhone(subId);
7774:             if (phone == null) {
7778:             return phone.getEmergencyNumberDbVersion();
7790:             for (Phone phone: PhoneFactory.getPhones()) {
7791:                 EmergencyNumberTracker tracker = phone.getEmergencyNumberTracker();
7807:             for (Phone phone: PhoneFactory.getPhones()) {
7808:                 EmergencyNumberTracker tracker = phone.getEmergencyNumberTracker();
7824:             for (Phone phone: PhoneFactory.getPhones()) {
7825:                 EmergencyNumberTracker tracker = phone.getEmergencyNumberTracker();
7838:         Phone phone = getPhone(subId);
7839:         if (phone == null) {
7845:                     .getUiccProfileForPhone(phone.getPhoneId());
7864:             Phone phone = PhoneFactory.getPhone(slotIndex);
7865:             if (phone == null) {
7868:                 return (Boolean) sendRequest(CMD_REQUEST_ENABLE_MODEM, enable, phone, null);
7881:         Phone phone = PhoneFactory.getPhone(slotIndex);
7882:         if (phone == null) return false;
7885:                 mApp, phone.getSubId(), callingPackage, callingFeatureId,
7887:             throw new SecurityException("Requires READ_PHONE_STATE permission.");
7893:                 return mPhoneConfigurationManager.getPhoneStatusFromCache(phone.getPhoneId());
7895:                 return (Boolean) sendRequest(CMD_GET_MODEM_STATUS, null, phone, null);
7963:      * Note: Switch from multi-sim to single-sim is only possible with MODIFY_PHONE_STATE
7964:      * permission, but the other way around is possible with either MODIFY_PHONE_STATE
7993:         Phone phone = getPhone(subId);
7994:         if (phone == null) {
7999:             UiccCard uiccCard = phone.getUiccCard();
8069:         Phone phone = getDefaultPhone();
8070:         if (phone == null) return -1;
8071:         HalVersion hv = phone.getHalVersion();
8101:         enforceReadPrivilegedPermission("Needs READ_PRIVILEGED_PHONE_STATE for "
8107:             Phone phone = getPhone(subId);
8108:             if (phone == null) return false;
8110:             boolean isMetered = ApnSettingUtils.isMeteredApnType(apnType, phone);
8111:             return !isMetered || phone.getDataEnabledSettings().isDataEnabled(apnType);
8124:             Phone phone = getPhone(subId);
8125:             if (phone == null) return true; // By default return true.
8127:             return ApnSettingUtils.isMeteredApnType(apnType, phone);
8139:             Phone phone = getPhone(subscriptionId);
8140:             if (phone == null) {
8160:             sendRequestAsync(CMD_SET_SYSTEM_SELECTION_CHANNELS, argument, phone, null);
8230:             Phone phone = getPhone(subId);
8231:             if (phone == null) return false;
8233:             return phone.getDataEnabledSettings().setAllowDataDuringVoiceCall(allow);
8246:             Phone phone = getPhone(subId);
8247:             if (phone == null) return false;
8249:             return phone.getDataEnabledSettings().isDataAllowedInVoiceCall();
8262:             Phone phone = getPhone(subId);
8263:             if (phone == null) return false;
8265:             return phone.getDataEnabledSettings().setAlwaysAllowMmsData(alwaysAllow);
8283:             for (Phone phone : PhoneFactory.getPhones()) {
8284:                 Phone defaultPhone = phone.getImsPhone();
8285:                 if (defaultPhone != null && defaultPhone.getPhoneType() == PHONE_TYPE_IMS) {
8330:             Phone phone = getPhone(subId);
8331:             if (phone != null && phone.getIccCard() != null) {
8332:                 return phone.getIccCard().getIccLockEnabled();
8352:         Phone phone = getPhone(subId);
8353:         if (phone == null) {
8360:                     new Pair<Boolean, String>(enabled, password), phone, null);
8382:         Phone phone = getPhone(subId);
8383:         if (phone == null) {
8390:                     new Pair<String, String>(oldPassword, newPassword), phone, null);
22: import static com.android.internal.telephony.PhoneConstants.SUBSCRIPTION_KEY;
65: import android.telecom.PhoneAccount;
66: import android.telecom.PhoneAccountHandle;
85: import android.telephony.PhoneCapability;
86: import android.telephony.PhoneNumberRange;
143: import com.android.internal.telephony.PhoneConfigurationManager;
144: import com.android.internal.telephony.PhoneConstantConversions;
145: import com.android.internal.telephony.PhoneConstants;
146: import com.android.internal.telephony.PhoneFactory;
159: import com.android.internal.telephony.imsphone.ImsPhone;
160: import com.android.internal.telephony.imsphone.ImsPhoneCallTracker;
199:     private static final String LOG_TAG = "PhoneInterfaceManager";
200:     private static final boolean DBG = (PhoneGlobals.DBG_LEVEL >= 2);
297:     private static PhoneInterfaceManager sInstance;
299:     private PhoneGlobals mApp;
690:                     defaultPhone.nvReadItem((Integer) request.argument, onCompleted,
717:                     defaultPhone.nvWriteItem(idValue.first, idValue.second, onCompleted,
728:                     defaultPhone.nvWriteCdmaPrl((byte[]) request.argument, onCompleted);
738:                     defaultPhone.resetModemConfig(onCompleted);
784:                     defaultPhone.invokeOemRilRequestRaw((byte[]) request.argument, onCompleted);
1022:                     if (defaultPhone != null) {
1023:                         defaultPhone.getModemActivityInfo(onCompleted, request.workSource);
1086:                     defaultPhone.setAllowedCarriers(argument, onCompleted, request.workSource);
1114:                     defaultPhone.getAllowedCarriers(onCompleted, request.workSource);
1320:                     defaultPhone.rebootModem(onCompleted);
1330:                     PhoneConfigurationManager.getInstance()
1340:                         mPhoneConfigurationManager.addToPhoneStatusCache(phoneId, msg.arg1 == 1);
1351:                     PhoneConfigurationManager.getInstance()
1439:                     defaultPhone.eraseModemConfig(onCompleted);
1624:      * Initialize the singleton PhoneInterfaceManager instance.
1625:      * This is only done once, at startup, from PhoneApp.onCreate().
1627:     /* package */ static PhoneInterfaceManager init(PhoneGlobals app) {
1628:         synchronized (PhoneInterfaceManager.class) {
1630:                 sInstance = new PhoneInterfaceManager(app);
1641:         mCM = PhoneGlobals.getInstance().mCM;
1642:         mImsResolver = PhoneGlobals.getInstance().getImsResolver();
1650:         mPhoneConfigurationManager = PhoneConfigurationManager.getInstance();
1657:         return (thePhone != null) ? thePhone : PhoneFactory.getDefaultPhone();
1676:                 ? getDefaultPhone() : getPhone(subId);
1687:         return PhoneFactory.getPhone(mSubscriptionController.getPhoneId(subId));
1705:         PackageManager pm = getDefaultPhone().getContext().getPackageManager();
1732:             PhoneConstants.State state = mCM.getState(subId);
1733:             if (state != PhoneConstants.State.OFFHOOK && state != PhoneConstants.State.RINGING) {
1792:         return (resultArray[0] == PhoneConstants.PIN_RESULT_SUCCESS) ? true : false;
1797:         return (resultArray[0] == PhoneConstants.PIN_RESULT_SUCCESS) ? true : false;
1805:             final UnlockSim checkSimPin = new UnlockSim(getPhone(subId).getIccCard());
1818:             final UnlockSim checkSimPuk = new UnlockSim(getPhone(subId).getIccCard());
1835:         private int mResult = PhoneConstants.PIN_GENERAL_FAILURE;
1865:                                             mResult = PhoneConstants.PIN_PASSWORD_INCORRECT;
1870:                                             mResult = PhoneConstants.PIN_OPERATION_ABORTED;
1872:                                             mResult = PhoneConstants.PIN_GENERAL_FAILURE;
1875:                                         mResult = PhoneConstants.PIN_RESULT_SUCCESS;
2050:             logv(TelephonyManager.getDefault().getPhoneCount() + " Phones are shutdown.");
2085:             if (defaultPhone != null) {
2086:                 defaultPhone.setRadioPower(turnOn);
2230:                 return PhoneConstantConversions.convertDataState(
2231:                         PhoneConstants.DataState.DISCONNECTED);
2303:             final int subId = mSubscriptionController.getSubIdUsingPhoneId(phoneId);
2518:             getDefaultPhone().setCellInfoListRate(rateInMillis, workSource);
2722:         Log.d(LOG_TAG, "[PhoneIntfMgr] " + msg);
2726:         Log.v(LOG_TAG, "[PhoneIntfMgr] " + msg);
2730:         Log.e(LOG_TAG, "[PhoneIntfMgr] " + msg);
2892:     public void requestNumberVerification(PhoneNumberRange range, long timeoutMillis,
2921:             return getDefaultPhone().needsOtaServiceProvisioning();
2956:             PhoneAccountHandle phoneAccountHandle = PhoneAccountHandleConverter.fromSubId(subId);
2957:             if (phoneAccountHandle == null) {
2960:             return VisualVoicemailSettingsUtil.dump(mApp, phoneAccountHandle);
3045:         SmsController smsController = PhoneFactory.getSmsController();
3180:         TelecomManager tm = defaultPhone.getContext().getSystemService(TelecomManager.class);
3189:             defaultPhone.sendDialerSpecialCode(inputCode);
3244:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3268:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone.
3364:         // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3391:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone.
3407:         // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3486:         // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3504:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3524:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3539:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3558:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3574:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3593:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3609:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3625:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3645:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3661:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3676:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3692:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3708:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3727:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3746:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3764:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3809:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3839:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3872:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3931:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
4100:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
4125:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
4151:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
4177:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
4347:             return PhoneConstants.LTE_ON_CDMA_UNKNOWN;
4354:                 return PhoneConstants.LTE_ON_CDMA_UNKNOWN;
4417:         int phoneId = UiccController.getInstance().getPhoneIdFromSlotId(slotIndex);
4418:         if (phoneId == -1) {
4422:         return PhoneFactory.getPhone(phoneId);
4457:                 ComponentInfo bestComponent = EuiccConnector.findBestComponent(getDefaultPhone()
4599:                 ComponentInfo bestComponent = EuiccConnector.findBestComponent(getDefaultPhone()
4890:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp, defaultPhone.getSubId(),
4897:             return defaultPhone.getPcscfAddress(apnType);
5148:             getDefaultPhone().setImsRegistrationState(registered);
5354:                     request, messenger, binder, getPhone(subId),
5415:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp, defaultPhone.getSubId(),
5423:             return PhoneFactory.calculatePreferredNetworkType(defaultPhone.getContext(), 0);
5557:             int phoneId = mSubscriptionController.getPhoneId(subId);
5558:             if (DBG) log("setUserDataEnabled: subId=" + subId + " phoneId=" + phoneId);
5636:             int phoneId = mSubscriptionController.getPhoneId(subId);
5637:             if (DBG) log("isUserDataEnabled: subId=" + subId + " phoneId=" + phoneId);
5665:             int phoneId = mSubscriptionController.getPhoneId(subId);
5666:             if (DBG) log("isDataEnabled: subId=" + subId + " phoneId=" + phoneId);
5769:         int phoneId = SubscriptionManager.getPhoneId(subId);
5770:         UiccCard card = UiccController.getInstance().getUiccCard(phoneId);
5777:             getPhone(phoneId), pkgName);
5794:                 getPhone(i), pkgName);
5805:         if (!SubscriptionManager.isValidPhoneId(phoneId)) {
5806:             loge("phoneId " + phoneId + " is not valid.");
5809:         UiccCard card = UiccController.getInstance().getUiccCard(phoneId);
5811:             loge("getCarrierPackageNamesForIntentAndPhone: No UICC");
5818:     public List<String> getPackagesWithCarrierPrivileges(int phoneId) {
5822:         UiccCard card = UiccController.getInstance().getUiccCard(phoneId);
6185:     public int getRadioAccessFamily(int phoneId, String callingPackage) {
6196:             raf = ProxyController.getInstance().getRadioAccessFamily(phoneId);
6210:             ImsManager.getInstance(defaultPhone.getContext(),
6211:                     defaultPhone.getPhoneId()).setVtSetting(enable);
6220:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp, defaultPhone.getSubId(),
6232:                     ImsManager.getInstance(defaultPhone.getContext(), defaultPhone.getPhoneId());
6347:      * GSM and the MEID for CDMA phones. Return null if device ID is not available.
6391:             return PhoneUtils.getSubIdForPhoneAccount(phoneAccount);
6399:             PhoneAccountHandle phoneAccountHandle, String callingPackage, String callingFeatureId) {
6406:             return PhoneUtils.getSubIdForPhoneAccountHandle(phoneAccountHandle);
6500:             cleanUpSmsRawTable(getDefaultPhone().getContext());
6511:               sendEraseModemConfig(getDefaultPhone());
6692:      * @param accountHandle The handle for the {@link PhoneAccount} for which to retrieve the
6695:      * PhoneAccount.
6698:     public Uri getVoicemailRingtoneUri(PhoneAccountHandle accountHandle) {
6718:      * @param phoneAccountHandle The handle for the {@link PhoneAccount} for which to set the
6721:      * PhoneAccount.
6725:             PhoneAccountHandle phoneAccountHandle, Uri uri) {
6728:         TelecomManager tm = defaultPhone.getContext().getSystemService(TelecomManager.class);
6731:                     mApp, PhoneUtils.getSubIdForPhoneAccountHandle(phoneAccountHandle),
6750:      * @param accountHandle The handle for the {@link PhoneAccount} for which to retrieve the
6752:      * @return {@code true} if the vibration is set for this PhoneAccount, {@code false} otherwise.
6755:     public boolean isVoicemailVibrationEnabled(PhoneAccountHandle accountHandle) {
6775:      * @param phoneAccountHandle The handle for the {@link PhoneAccount} for which to set the
6778:      * specific PhoneAccount.
6782:             PhoneAccountHandle phoneAccountHandle, boolean enabled) {
6785:         TelecomManager tm = defaultPhone.getContext().getSystemService(TelecomManager.class);
6788:                     mApp, PhoneUtils.getSubIdForPhoneAccountHandle(phoneAccountHandle),
7129:         (new TelephonyShellCommand(this, getDefaultPhone().getContext()))
7382:             if (checkCarrierPrivilegesForPackageAnyPhone(callingPackage)
7571:         int phoneId = mSubscriptionController.getPhoneId(subId);
7572:         if (phoneId >= 0 && phoneId < list.size() && list.get(phoneId) != null) {
7573:             return list.get(phoneId);
7702:                             mApp, defaultPhone.getSubId(), "isEmergencyNumber(Potential)");
7920:                 getDefaultPhone().getSubId(), callingPackage, callingFeatureId,
7943:         PhoneCapability staticCapability =
8049:             int phoneCount = TelephonyManager.getDefault().getPhoneCount();
8051:             int[] logicalSlotsMapping = new int[phoneCount];
8183:         SmsPermissions permissions = new SmsPermissions(getDefaultPhone(), mApp,
8204:             return SubscriptionManager.getResourcesForSubId(getDefaultPhone().getContext(), subId)
8216:             return SubscriptionManager.getResourcesForSubId(getDefaultPhone().getContext(), subId)
8286:                     ImsPhone imsPhone = (ImsPhone) defaultPhone;
8288:                             (ImsPhoneCallTracker) imsPhone.getCallTracker();
8290:                     Rlog.i(LOG_TAG, "setCepEnabled isCepEnabled=" + isCepEnabled + ", for imsPhone "
8291:                             + imsPhone.getMsisdn());
132: import com.android.internal.telephony.DefaultPhoneNotifier;
473:                             getPhoneFromRequest(request).handlePinMmi((String) request.argument)
748:                     getPhoneFromRequest(request).getPreferredNetworkType(onCompleted);
774:                     getPhoneFromRequest(request).setPreferredNetworkType(networkType, onCompleted);
798:                     getPhoneFromRequest(request).setVoiceMailNumber(tagNum.first, tagNum.second,
810:                     getPhoneFromRequest(request).setNetworkSelectionModeAutomatic(onCompleted);
820:                     getPhoneFromRequest(request).getAvailableNetworks(onCompleted);
827:                     getPhoneFromRequest(request).getCallForwardingOption(
884:                     getPhoneFromRequest(request).setCallForwardingOption(
906:                     getPhoneFromRequest(request).getCallWaiting(onCompleted);
950:                     getPhoneFromRequest(request).setCallWaiting(isEnable, onCompleted);
1002:                     getPhoneFromRequest(request).selectNetworkManually(selArg.operatorInfo,
1197:                     getPhoneFromRequest(request).getNetworkSelectionMode(onCompleted);
1218:                     getPhoneFromRequest(request).queryCdmaRoamingPreference(onCompleted);
1234:                     getPhoneFromRequest(request).setCdmaRoamingPreference(mode, onCompleted);
1246:                     getPhoneFromRequest(request).setCdmaSubscription(subscriptionMode, onCompleted);
1361:                         mPhoneConfigurationManager.addToPhoneStatusCache(id,
1449:                     getPhoneFromRequest(request).getIccCard().changeIccLockPassword(
1467:                     getPhoneFromRequest(request).getIccCard().setIccLockEnabled(
1670:             return getPhoneFromSubId(request.subId);
1971:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
2046:             for (int i = 0; i < TelephonyManager.getDefault().getPhoneCount(); i++) {
2063:             for (int i = 0; i < TelephonyManager.getDefault().getPhoneCount(); i++) {
2065:                 shutdownRadioUsingPhoneId(i);
2595:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
2735:         return getActivePhoneTypeForSlot(getSlotForDefaultSubscription());
2765:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
2798:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
2829:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
2970:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
3138:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
3198:                     .enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3235:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3261:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3318:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3358:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3383:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3483:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3520:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3554:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3589:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3641:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3723:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3805:         checkModifyPhoneStatePermission(subId, "setRcsProvisioningStatusForCapability");
3869:         checkModifyPhoneStatePermission(subId, "setImsProvisioningStatusForCapability");
4221:                 && !TelephonyPermissions.checkCallingOrSelfReadPhoneStateNoThrow(
4255:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
4280:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
4372:         return mSubscriptionController.getPhoneId(getDefaultSubscription());
4434:         return iccOpenLogicalChannelWithPermission(getPhoneFromSubId(subId), callingPackage, aid,
4447:         return iccOpenLogicalChannelWithPermission(getPhoneFromSlotIdOrThrowException(slotIndex),
4482:         return iccCloseLogicalChannelWithPermission(getPhoneFromSubId(subId), channel);
4489:         return iccCloseLogicalChannelWithPermission(getPhoneFromSlotIdOrThrowException(slotIndex),
4518:         return iccTransmitApduLogicalChannelWithPermission(getPhoneFromSubId(subId), channel, cla,
4532:                 getPhoneFromSlotIdOrThrowException(slotIndex), channel, cla, command, p1, p2, p3,
4571:         return iccTransmitApduBasicChannelWithPermission(getPhoneFromSubId(subId), callingPackage,
4587:                 getPhoneFromSlotIdOrThrowException(slotIndex), callingPackage, cla, command, p1,
4672:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
4710:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp, subId, callingPackage,
5091:                 .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
5438:                 .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
5487:                 .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
5785:         for (int i = 0; i < TelephonyManager.getDefault().getPhoneCount(); i++) {
5849:         enforceReadPrivilegedPermission("getPackagesWithCarrierPrivilegesForAllPhones");
5855:             for (int i = 0; i < TelephonyManager.getDefault().getPhoneCount(); i++) {
5935:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneNumber(
5962:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
5985:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
6194:                     .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
6244:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
6263:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
6400:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp, getDefaultSubscription(),
6401:                 callingPackage, callingFeatureId, "getSubIdForPhoneAccountHandle")) {
6636:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
7162:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
7319:             TelephonyPermissions.enforeceCallingOrSelfReadPhoneStatePermissionOrCarrierPrivilege(
7357:                 .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
7481:                         slot.getPhoneId(),
7617:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
7625:             return mPhoneConfigurationManager.getNumberOfModemsWithSimultaneousDataConnections();
7634:                 .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
7674:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
7701:                     .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
7884:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
7919:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp,
7944:                 mPhoneConfigurationManager.getStaticPhoneCapability();
7984:             mPhoneConfigurationManager.switchMultiSimConfig(numOfSims);
8024:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
8031:             return mPhoneConfigurationManager.isRebootRequiredForModemConfigChange();
8040:         metrics.updateEnabledModemBitmap((1 << TelephonyManager.from(mApp).getPhoneCount()) - 1);
8054:                 if (SubscriptionManager.isValidPhoneId(slotInfos[i].getLogicalSlotIdx())) {
8169:                 SubscriptionManager.getPhoneId(subId), UiccController.APP_FAM_3GPP);
8287:                     ImsPhoneCallTracker imsPhoneCallTracker =
8289:                     imsPhoneCallTracker.setConferenceEventPackageEnabled(isCepEnabled);
android.googlesource.com/platform/superproject:packages/services/Telephony/src/com/android/phone/PhoneInterfaceManager.java: [ master, ]
377:         public Phone phone;
17: package com.android.phone;
198: public class PhoneInterfaceManager extends ITelephony.Stub {
1639:     private PhoneInterfaceManager(PhoneGlobals app) {
1655:     private Phone getDefaultPhone() {
1686:     private Phone getPhone(int subId) {
2289:     public String getNetworkCountryIsoForPhone(int phoneId) {
5776:     public int checkCarrierPrivilegesForPackageAnyPhone(String pkgName) {
5799:     public List<String> getCarrierPackageNamesForIntentAndPhone(Intent intent, int phoneId) {
6257:     public boolean isWorldPhone(int subId, String callingPackage, String callingFeatureId) {
307:     private PhoneConfigurationManager mPhoneConfigurationManager;
1666:     private Phone getPhoneFromRequest(MainThreadRequest request) {
1674:     private Phone getPhoneFromSubId(int subId) {
2067:     private void shutdownRadioUsingPhoneId(int phoneId) {
2729:     public int getActivePhoneType() {
2734:     public int getActivePhoneTypeForSlot(int slotIndex) {
3773:     private void checkModifyPhoneStatePermission(int subId, String message) {
4411:     private Phone getPhoneFromSlotIdOrThrowException(int slotIndex) {
5843:     public List<String> getPackagesWithCarrierPrivilegesForAllPhones() {
6383:     public int getSubIdForPhoneAccount(PhoneAccount phoneAccount) {
6393:     public int getSubIdForPhoneAccountHandle(
6408:     public @Nullable PhoneAccountHandle getPhoneAccountHandleForSubscriptionId(int subscriptionId) {
21: import static com.android.internal.telephony.PhoneConstants.PHONE_TYPE_IMS;
142: import com.android.internal.telephony.Phone;
175: import com.android.phone.settings.PickSmsSubscriptionActivity;
176: import com.android.phone.vvm.PhoneAccountHandleConverter;
177: import com.android.phone.vvm.RemoteVvmTaskManager;
178: import com.android.phone.vvm.VisualVoicemailSettingsUtil;
179: import com.android.phone.vvm.VisualVoicemailSmsFilterConfig;
376:         // In cases where subId is unavailable, the caller needs to specify the phone.
385:         MainThreadRequest(Object argument, Phone phone, WorkSource workSource) {
387:             if (phone != null) {
388:                 this.phone = phone;
416:      * A handler that processes messages on the main thread in the phone process. Since many
417:      * of the Phone calls are not thread safe this is needed to shuttle the requests from the
418:      * inbound binder threads to the main thread in the phone process.  The Binder thread
435:             final Phone defaultPhone = getDefaultPhone();
440:                     final Phone phone = getPhoneFromRequest(request);
459:                         request.result = phone != null
460:                                 ? phone.handleUssdRequest(ussdRequest, wrappedCallback) : false;
471:                     final Phone phone = getPhoneFromRequest(request);
472:                     request.result = phone != null ?
1257:                     request.phone.requestCellInfoUpdate(request.workSource, onCompleted);
1271:                     request.phone.requestCellInfoUpdate(request.workSource,
1299:                     Phone phone = getPhoneFromRequest(request);
1300:                     phone.getCellIdentity(ws, obtainMessage(EVENT_GET_CELL_LOCATION_DONE, request));
1308:                         phone = getPhoneFromRequest(request);
1309:                         request.result = (phone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA)
1331:                             .enablePhone(request.phone, enable, onCompleted);
1337:                     int phoneId = request.phone.getPhoneId();
1352:                             .getPhoneStatusFromModem(request.phone, onCompleted);
1357:                     int id = request.phone.getPhoneId();
1380:                     request.phone.setSystemSelectionChannels(args.first, onCompleted);
1553:     private Object sendRequest(int command, Object argument, Phone phone, WorkSource workSource) {
1555:                 command, argument, SubscriptionManager.INVALID_SUBSCRIPTION_ID, phone, workSource);
1564:             int command, Object argument, Integer subId, Phone phone, WorkSource workSource) {
1570:         if (subId != SubscriptionManager.INVALID_SUBSCRIPTION_ID && phone != null) {
1571:             throw new IllegalArgumentException("subId and phone cannot both be specified!");
1572:         } else if (phone != null) {
1573:             request = new MainThreadRequest(argument, phone, workSource);
1613:      * Same as {@link #sendRequestAsync(int,Object)} except it takes a Phone and WorkSource.
1617:             int command, Object argument, Phone phone, WorkSource workSource) {
1618:         MainThreadRequest request = new MainThreadRequest(argument, phone, workSource);
1656:         Phone thePhone = getPhone(getDefaultSubscription());
1663:         ServiceManager.addService("phone", this);
1667:         if (request.phone != null) {
1668:             return request.phone;
1680:         Phone phone = getPhoneFromRequest(request);
1681:         return phone == null ? null :
1682:                 UiccController.getInstance().getUiccCard(phone.getPhoneId());
1685:     // returns phone associated with the subId.
1690:     private void sendEraseModemConfig(Phone phone) {
1691:         if (phone != null) {
1693:                   mApp, phone.getSubId(), "eraseModemConfig");
1731:             // PENDING: should we just silently fail if phone is offhook or ringing?
1752:         // from the context of the phone app.
1755:         if (mAppOps.noteOp(AppOpsManager.OPSTR_CALL_PHONE, Binder.getCallingUid(), callingPackage)
1936:             final Phone phone = getPhone(subId);
1937:             if (phone != null) {
1938:                 phone.updateServiceLocation();
1982:             final Phone phone = getPhone(subId);
1983:             if (phone != null) {
1984:                 return phone.getServiceState().getState() != ServiceState.STATE_POWER_OFF;
2002:             final Phone phone = getPhone(subId);
2003:             if (phone != null) {
2004:                 phone.setRadioPower(!isRadioOnForSubscriber(subId));
2020:             final Phone phone = getPhone(subId);
2021:             if (phone == null) {
2024:             if ((phone.getServiceState().getState() != ServiceState.STATE_POWER_OFF) != turnOn) {
2042:                 Phone phone = PhoneFactory.getPhone(i);
2043:                 if (phone != null && phone.isRadioAvailable()) return true;
2059:                 logv("Shutting down Phone " + i);
2068:         Phone phone = PhoneFactory.getPhone(phoneId);
2069:         if (phone != null && phone.isRadioAvailable()) {
2070:             phone.shutdownRadio();
2079:             final Phone defaultPhone = PhoneFactory.getDefaultPhone();
2084:                 loge("There's no default phone.");
2097:             final Phone phone = getPhone(subId);
2098:             if (phone != null) {
2099:                 phone.setRadioPower(turnOn);
2117:             final Phone phone = getPhone(subId);
2118:             if (phone != null) {
2119:                 phone.getDataEnabledSettings().setUserDataEnabled(true);
2137:             final Phone phone = getPhone(subId);
2138:             if (phone != null) {
2139:                 phone.getDataEnabledSettings().setUserDataEnabled(false);
2153:             final Phone phone = getPhone(subId);
2154:             if (phone != null) {
2155:                 return phone.isDataAllowed(ApnSetting.TYPE_DEFAULT);
2204:             Phone phone = PhoneFactory.getPhone(slotIndex);
2205:             return phone == null ? TelephonyManager.CALL_STATE_IDLE :
2206:                     PhoneConstantConversions.convertCallState(phone.getState());
2221:             final Phone phone = getPhone(subId);
2222:             if (phone != null) {
2223:                 return PhoneConstantConversions.convertDataState(phone.getDataConnectionState());
2242:             final Phone phone = getPhone(subId);
2243:             if (phone != null) {
2244:                 return DefaultPhoneNotifier.convertDataActivityState(phone.getDataActivityState());
2273:                 return (getDefaultPhone().getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA)
2294:             if (phoneId == SubscriptionManager.INVALID_PHONE_INDEX) {
2295:                 // Get default phone in this case.
2296:                 phoneId = SubscriptionManager.DEFAULT_PHONE_INDEX;
2299:             Phone phone = PhoneFactory.getPhone(phoneId);
2300:             if (phone == null) return "";
2301:             ServiceStateTracker sst = phone.getServiceStateTracker();
2306:             EmergencyNumberTracker ent = phone.getEmergencyNumberTracker();
2325:             final Phone phone = getPhone(subId);
2326:             if (phone != null) {
2327:                 phone.enableLocationUpdates();
2346:             final Phone phone = getPhone(subId);
2347:             if (phone != null) {
2348:                 phone.disableLocationUpdates();
2407:         for (Phone phone : PhoneFactory.getPhones()) {
2408:             List<CellInfo> info = phone.getAllCellInfo();
2447:             for (Phone phone : PhoneFactory.getPhones()) {
2449:                         CMD_GET_ALL_CELL_INFO, null, phone, workSource);
2500:         final Phone phone = getPhoneFromSubId(subId);
2501:         if (phone == null) throw new IllegalArgumentException("Invalid Subscription Id: " + subId);
2503:         sendRequestAsync(CMD_REQUEST_CELL_INFO_UPDATE, cb, phone, workSource);
2521:         Phone phone = PhoneFactory.getPhone(slotIndex);
2522:         if (phone == null) {
2525:         int subId = phone.getSubId();
2533:             return phone.getImei();
2541:         Phone phone = PhoneFactory.getPhone(slotIndex);
2543:         if (phone != null) {
2544:             String imei = phone.getImei();
2552:         Phone phone = PhoneFactory.getPhone(slotIndex);
2553:         if (phone == null) {
2557:         int subId = phone.getSubId();
2565:             return phone.getMeid();
2573:         Phone phone = PhoneFactory.getPhone(slotIndex);
2575:         if (phone != null) {
2576:             String meid = phone.getMeid();
2585:         Phone phone = PhoneFactory.getPhone(slotIndex);
2586:         if (phone == null) {
2589:         int subId = phone.getSubId();
2598:             return phone.getDeviceSvn();
2608:             final Phone phone = getPhone(subId);
2609:             return phone == null ? TelephonyManager.UNKNOWN_CARRIER_ID : phone.getCarrierId();
2619:             final Phone phone = getPhone(subId);
2620:             return phone == null ? null : phone.getCarrierName();
2630:             final Phone phone = getPhone(subId);
2631:             return phone == null ? TelephonyManager.UNKNOWN_CARRIER_ID
2632:                     : phone.getSpecificCarrierId();
2642:             final Phone phone = getPhone(subId);
2643:             return phone == null ? null : phone.getSpecificCarrierName();
2654:         final Phone phone = PhoneFactory.getPhone(slotIndex);
2655:         if (phone == null) {
2660:             return CarrierResolver.getCarrierIdFromMccMnc(phone.getContext(), mccmnc);
2671:      * Make sure the caller has the MODIFY_PHONE_STATE permission.
2676:         mApp.enforceCallingOrSelfPermission(android.Manifest.permission.MODIFY_PHONE_STATE, null);
2696:      * Make sure the caller has the CALL_PHONE permission.
2701:         mApp.enforceCallingOrSelfPermission(android.Manifest.permission.CALL_PHONE, null);
2737:             final Phone phone = PhoneFactory.getPhone(slotIndex);
2738:             if (phone == null) {
2739:                 return PhoneConstants.PHONE_TYPE_NONE;
2741:                 return phone.getPhoneType();
2768:             final Phone phone = getPhone(subId);
2769:             if (phone != null) {
2770:                 return phone.getCdmaEriIconIndex();
2801:             final Phone phone = getPhone(subId);
2802:             if (phone != null) {
2803:                 return phone.getCdmaEriIconMode();
2832:             final Phone phone = getPhone(subId);
2833:             if (phone != null) {
2834:                 return phone.getCdmaEriText();
2853:             final Phone phone = getPhone(subId);
2854:             if (phone != null && phone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA) {
2855:                 return phone.getLine1Number();
2857:                 loge("getCdmaMdn: no phone found. Invalid subId: " + subId);
2875:             final Phone phone = getPhone(subId);
2876:             if (phone != null && phone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA) {
2877:                 return phone.getCdmaMin();
2889:         if (mApp.checkCallingOrSelfPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
2891:             throw new SecurityException("Caller must hold the MODIFY_PHONE_STATE permission");
3055:             final Phone phone = getPhone(subId);
3056:             if (phone != null) {
3057:                 phone.setVoiceActivationState(activationState);
3076:             final Phone phone = getPhone(subId);
3077:             if (phone != null) {
3078:                 phone.setDataActivationState(activationState);
3094:         final Phone phone = getPhone(subId);
3097:             if (phone != null) {
3098:                 return phone.getVoiceActivationState();
3114:         final Phone phone = getPhone(subId);
3117:             if (phone != null) {
3118:                 return phone.getDataActivationState();
3140:             final Phone phone = getPhone(subId);
3141:             if (phone != null) {
3142:                 return phone.getVoiceMessageCount();
3159:             final Phone phone = getPhone(subId);
3160:             return (phone == null ? false : phone.isConcurrentVoiceAndDataAllowed());
3173:         final Phone defaultPhone = getDefaultPhone();
3211:             for (Phone phone : PhoneFactory.getPhones()) {
3212:                 if (phone.isInEmergencySmsMode()) {
3223:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3250:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3288:             Phone phone = getPhone(subId);
3289:             if (phone == null) {
3294:             phone.getImsRegistrationState(regState -> {
3321:             Phone phone = getPhone(subId);
3322:             if (phone == null) {
3327:             phone.getImsRegistrationTech(regTech -> {
3346:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3372:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3423:             Phone phone = getPhone(subId);
3424:             if (phone == null) return false;
3425:             return phone.isImsCapabilityAvailable(capability, regTech);
3473:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3510:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3544:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3579:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3631:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3713:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3780:         Phone phone = getPhone(subId);
3781:         if (phone == null) {
3782:             loge("phone instance null for subid " + subId);
3786:             if (!doesImsCapabilityRequireProvisioning(phone.getContext(), subId, capability)) {
3790:             if (!doesRcsCapabilityRequireProvisioning(phone.getContext(), subId, capability)) {
4224:             final Phone phone = getPhone(subId);
4225:             if (phone != null) {
4226:                 return phone.getServiceState().getDataNetworkType();
4258:             final Phone phone = getPhone(subId);
4259:             if (phone != null) {
4260:                 return phone.getServiceState().getDataNetworkType();
4283:             final Phone phone = getPhone(subId);
4284:             if (phone != null) {
4285:                 return phone.getServiceState().getVoiceNetworkType();
4310:             final Phone phone = PhoneFactory.getPhone(slotIndex);
4311:             if (phone != null) {
4312:                 return phone.getIccCard().hasIccCard();
4327:      * @return {@link Phone#LTE_ON_CDMA_UNKNOWN}, {@link Phone#LTE_ON_CDMA_FALSE}
4328:      * or {@link Phone#LTE_ON_CDMA_TRUE}
4347:             final Phone phone = getPhone(subId);
4348:             if (phone == null) {
4351:                 return phone.getLteOnCdmaMode();
4415:                     + " does not correspond to an active phone");
4446:     private IccOpenLogicalChannelResponse iccOpenLogicalChannelWithPermission(Phone phone,
4463:                     CMD_OPEN_CHANNEL, new Pair<String, Integer>(aid, p2), phone,
4488:     private boolean iccCloseLogicalChannelWithPermission(Phone phone, int channel) {
4494:             Boolean success = (Boolean) sendRequest(CMD_CLOSE_CHANNEL, channel, phone,
4531:     private String iccTransmitApduLogicalChannelWithPermission(Phone phone, int channel, int cla,
4540:                     new IccAPDUArgument(channel, cla, command, p1, p2, p3, data), phone,
4587:     private String iccTransmitApduBasicChannelWithPermission(Phone phone, String callingPackage,
4605:                     new IccAPDUArgument(0, cla, command, p1, p2, p3, data), phone,
4839:         Phone phone = PhoneFactory.getPhone(slotIndex);
4840:         if (phone != null) {
4842:                     mApp, phone.getSubId(), "resetModemConfig");
4865:         Phone phone = PhoneFactory.getPhone(slotIndex);
4866:         if (phone != null) {
4868:                     mApp, phone.getSubId(), "rebootModem");
4884:         final Phone defaultPhone = getDefaultPhone();
5409:         final Phone defaultPhone = getDefaultPhone();
5527:         final Phone phone = getPhone(subId);
5529:             if (phone != null) {
5530:                 return phone.hasMatchedTetherApnSetting();
5554:             Phone phone = PhoneFactory.getPhone(phoneId);
5555:             if (phone != null) {
5557:                 phone.getDataEnabledSettings().setUserDataEnabled(enable);
5559:                 loge("setUserDataEnabled: no phone found. Invalid subId=" + subId);
5577:         final Phone phone = getPhone(subId);
5579:             if (phone != null) {
5584:                 phone.setAlwaysReportSignalStrength(isEnable);
5586:                 loge("setAlwaysReportSignalStrength: no phone found for subId="
5615:      * Accepts either ACCESS_NETWORK_STATE, MODIFY_PHONE_STATE or carrier privileges.
5633:             Phone phone = PhoneFactory.getPhone(phoneId);
5634:             if (phone != null) {
5635:                 boolean retVal = phone.isUserDataEnabled();
5639:                 if (DBG) loge("isUserDataEnabled: no phone subId=" + subId + " retVal=false");
5662:             Phone phone = PhoneFactory.getPhone(phoneId);
5663:             if (phone != null) {
5664:                 boolean retVal = phone.getDataEnabledSettings().isDataEnabled();
5668:                 if (DBG) loge("isDataEnabled: no phone subId=" + subId + " retVal=false");
5677:             Phone phone) {
5683:         PackageManager pkgMgr = phone.getContext().getPackageManager();
5688:             SubscriptionInfo subInfo = subController.getSubscriptionInfo(phone.getSubId());
5690:                     phone.getContext().getSystemService(Context.TELEPHONY_SUBSCRIPTION_SERVICE);
5702:     private int getCarrierPrivilegeStatusFromCarrierConfigRules(int privilegeFromSim, Phone phone,
5711:             SubscriptionInfo subInfo = subController.getSubscriptionInfo(phone.getSubId());
5713:                     phone.getContext().getSystemService(Context.TELEPHONY_SUBSCRIPTION_SERVICE);
5723:         final Phone phone = getPhone(subId);
5724:         if (phone == null) {
5728:         UiccCard card = UiccController.getInstance().getUiccCard(phone.getPhoneId());
5736:                 phone.getContext().getPackageManager()), Binder.getCallingUid(), phone);
5742:         final Phone phone = getPhone(subId);
5743:         if (phone == null) {
5748:                 UiccController.getInstance().getUiccProfileForPhone(phone.getPhoneId());
5755:                         phone.getContext().getPackageManager(), uid), uid, phone);
5860:         final Phone phone = getPhone(subId);
5861:         UiccCard card = phone == null ? null : phone.getUiccCard();
5883:             final Phone phone = getPhone(subId);
5884:             if (phone == null) {
5887:             final String subscriberId = phone.getSubscriberId();
6110:             final Phone phone = getPhone(subId);
6111:             return phone == null ? false : phone.setOperatorBrandOverride(brand);
6126:             final Phone phone = getPhone(subId);
6127:             if (phone == null) {
6130:             return phone.setRoamingOverride(gsmRoamingList, gsmNonRoamingList, cdmaRoamingList,
6181:         Phone phone = PhoneFactory.getPhone(phoneId);
6183:         if (phone == null) {
6190:                             mApp, phone.getSubId(), "getRadioAccessFamily");
6200:         final Phone defaultPhone = getDefaultPhone();
6214:         final Phone defaultPhone = getDefaultPhone();
6268:                     .getBoolean(CarrierConfigManager.KEY_WORLD_PHONE_BOOL);
6299:         final Phone phone = getPhone(subscriptionId);
6300:         if (phone == null) {
6301:             loge("isRttSupported: no Phone found. Invalid subId:" + subscriptionId);
6308:                     phone.getContext().getResources().getBoolean(R.bool.config_support_rtt);
6341:      * Returns the unique device ID of phone, for example, the IMEI for
6345:      *   {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
6349:         final Phone phone = PhoneFactory.getPhone(0);
6350:         if (phone == null) {
6353:         int subId = phone.getSubId();
6361:             return phone.getDeviceId();
6374:         Phone phone = getPhone(subId);
6375:         if (phone != null) {
6376:             return phone.isImsRegistered();
6397:             throw new SecurityException("Requires READ_PHONE_STATE permission.");
6411:             Phone phone = getPhone(subscriptionId);
6412:             if (phone == null) {
6415:             return PhoneUtils.makePstnPhoneAccountHandle(phone);
6427:             Phone phone = getPhone(subId);
6428:             if (phone != null) {
6429:                 return phone.isWifiCallingEnabled();
6444:             Phone phone = getPhone(subId);
6445:             if (phone != null) {
6446:                 return phone.isVideoEnabled();
6462:             Phone phone = getPhone(subId);
6463:             if (phone != null) {
6464:                 return phone.getImsRegistrationTech();
6522:         final Phone phone = getPhone(subId);
6523:         if (phone == null) {
6530:                     phone.getContext().getOpPackageName(), null);
6539:             final Locale localeFromDefaultSim = phone.getLocaleFromSimAndCarrierPrefs();
6667:             final Phone phone = getPhone(subId);
6668:             if (phone == null) {
6672:             ServiceState ss = phone.getServiceState();
6685:      * Returns the URI for the per-account voicemail ringtone set in Phone settings.
6696:             Phone phone = PhoneUtils.getPhoneForPhoneAccountHandle(accountHandle);
6697:             if (phone == null) {
6698:                 phone = getDefaultPhone();
6701:             return VoicemailNotificationSettingsUtil.getRingtoneUri(phone.getContext());
6711:      * has permission {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}.
6721:         final Phone defaultPhone = getDefaultPhone();
6732:             Phone phone = PhoneUtils.getPhoneForPhoneAccountHandle(phoneAccountHandle);
6733:             if (phone == null) {
6734:                 phone = defaultPhone;
6736:             VoicemailNotificationSettingsUtil.setRingtoneUri(phone.getContext(), uri);
6743:      * Returns whether vibration is set for voicemail notification in Phone settings.
6753:             Phone phone = PhoneUtils.getPhoneForPhoneAccountHandle(accountHandle);
6754:             if (phone == null) {
6755:                 phone = getDefaultPhone();
6758:             return VoicemailNotificationSettingsUtil.isVibrationEnabled(phone.getContext());
6768:      * has permission {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}.
6778:         final Phone defaultPhone = getDefaultPhone();
6789:             Phone phone = PhoneUtils.getPhoneForPhoneAccountHandle(phoneAccountHandle);
6790:             if (phone == null) {
6791:                 phone = defaultPhone;
6793:             VoicemailNotificationSettingsUtil.setVibrationEnabled(phone.getContext(), enabled);
6800:      * Make sure either called from same process as self (phone) or IPC caller has read privilege.
6805:         mApp.enforceCallingOrSelfPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE,
6810:      * Make sure either called from same process as self (phone) or IPC caller has send SMS
6853:         Phone phone = getPhone(subId);
6857:             if (phone == null) {
6862:                 aid = UiccController.getInstance().getUiccCard(phone.getPhoneId())
6882:         Phone phone = getPhone(subId);
6886:             if (phone == null) {
6891:                 esn = phone.getEsn();
6910:         Phone phone = getPhone(subId);
6914:             if (phone == null) {
6919:                 cdmaPrlVersion = phone.getCdmaPrlVersion();
7013:         final Phone phone = getPhone(subId);
7016:         if (phone == null) {
7021:             phone.carrierActionSetMeteredApnsEnabled(enabled);
7038:         final Phone phone = getPhone(subId);
7041:         if (phone == null) {
7046:             phone.carrierActionSetRadioEnabled(enabled);
7066:         final Phone phone = getPhone(subId);
7069:         if (phone == null) {
7074:             phone.carrierActionReportDefaultNetworkStatus(report);
7090:         final Phone phone = getPhone(subId);
7091:         if (phone == null) {
7096:             phone.carrierActionResetAll();
7103:      * Called when "adb shell dumpsys phone" is invoked. Dump is also automatically invoked when a
7110:             writer.println("Permission Denial: can't dump Phone from pid="
7140:             Phone phone = getPhone(subId);
7141:             if (phone != null) {
7142:                 phone.getDataEnabledSettings().setPolicyDataEnabled(enabled);
7161:         Phone phone = getPhone(subId);
7165:             if (phone != null) {
7166:                 return phone.getClientRequestStats();
7193:         Phone phone = PhoneFactory.getPhone(slotIndex);
7199:             if (phone != null) {
7200:                 phone.setSimPowerState(state, workSource);
7222:      * Check if phone is in emergency callback mode
7223:      * @return true if phone is in emergency callback mode
7229:         final Phone phone = getPhone(subId);
7233:             if (phone != null) {
7234:                 return phone.isInEcm();
7254:             Phone p = getPhone(subId);
7274:         Phone phone = PhoneFactory.getPhone(slotIndex);
7275:         if (phone != null) {
7276:             if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp, phone.getSubId(),
7283:                 return phone.getRadioPowerState();
7296:      * {@link android.Manifest.permission#READ_PHONE_STATE} or that the calling app has carrier
7311:             Phone phone = getPhone(subId);
7312:             isEnabled =  phone != null ? phone.getDataRoamingEnabled() : false;
7327:      * {@link android.Manifest.permission#MODIFY_PHONE_STATE} or that the calling app has carrier
7340:             Phone phone = getPhone(subId);
7341:             if (phone != null) {
7342:                 phone.setDataRoamingEnabled(isEnabled);
7358:             Phone phone = getPhone(subId);
7359:             if (phone != null) {
7360:                 isAllowed = phone.isCspPlmnEnabled();
7375:             // even without READ_PRIVILEGED_PHONE_STATE, we allow the call to continue if the caller
7512:      * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}.
7521:             Phone phone = getPhone(subId);
7522:             if (phone == null) {
7525:             UiccCard uiccCard = phone.getUiccCard();
7562:      * not set, return {@link Phone#PREFERRED_NT_MODE}.
7570:         return Phone.PREFERRED_NT_MODE;
7580:             final Phone phone = getPhone(subId);
7581:             if (phone == null) {
7585:             phone.setCarrierTestOverride(mccmnc, imsi, iccid, gid1, gid2, plmn, spn,
7598:             final Phone phone = getPhone(subId);
7599:             if (phone == null) {
7603:             return phone.getCarrierIdListVersion();
7672:             throw new SecurityException("Requires READ_PHONE_STATE permission.");
7677:             for (Phone phone: PhoneFactory.getPhones()) {
7678:                 if (phone.getEmergencyNumberTracker() != null
7679:                         && phone.getEmergencyNumberTracker().getEmergencyNumberList() != null) {
7681:                             phone.getSubId(),
7682:                             phone.getEmergencyNumberTracker().getEmergencyNumberList());
7693:         final Phone defaultPhone = getDefaultPhone();
7701:             for (Phone phone: PhoneFactory.getPhones()) {
7702:                 if (phone.getEmergencyNumberTracker() != null
7703:                         && phone.getEmergencyNumberTracker() != null) {
7704:                     if (phone.getEmergencyNumberTracker().isEmergencyNumber(
7726:             for (Phone phone: PhoneFactory.getPhones()) {
7727:                 EmergencyNumberTracker tracker = phone.getEmergencyNumberTracker();
7748:             for (Phone phone: PhoneFactory.getPhones()) {
7749:                 EmergencyNumberTracker tracker = phone.getEmergencyNumberTracker();
7768:             final Phone phone = getPhone(subId);
7769:             if (phone == null) {
7773:             return phone.getEmergencyNumberDbVersion();
7785:             for (Phone phone: PhoneFactory.getPhones()) {
7786:                 EmergencyNumberTracker tracker = phone.getEmergencyNumberTracker();
7802:             for (Phone phone: PhoneFactory.getPhones()) {
7803:                 EmergencyNumberTracker tracker = phone.getEmergencyNumberTracker();
7819:             for (Phone phone: PhoneFactory.getPhones()) {
7820:                 EmergencyNumberTracker tracker = phone.getEmergencyNumberTracker();
7833:         Phone phone = getPhone(subId);
7834:         if (phone == null) {
7840:                     .getUiccProfileForPhone(phone.getPhoneId());
7859:             Phone phone = PhoneFactory.getPhone(slotIndex);
7860:             if (phone == null) {
7863:                 return (Boolean) sendRequest(CMD_REQUEST_ENABLE_MODEM, enable, phone, null);
7876:         Phone phone = PhoneFactory.getPhone(slotIndex);
7877:         if (phone == null) return false;
7880:                 mApp, phone.getSubId(), callingPackage, callingFeatureId,
7882:             throw new SecurityException("Requires READ_PHONE_STATE permission.");
7888:                 return mPhoneConfigurationManager.getPhoneStatusFromCache(phone.getPhoneId());
7890:                 return (Boolean) sendRequest(CMD_GET_MODEM_STATUS, null, phone, null);
7958:      * Note: Switch from multi-sim to single-sim is only possible with MODIFY_PHONE_STATE
7959:      * permission, but the other way around is possible with either MODIFY_PHONE_STATE
7988:         Phone phone = getPhone(subId);
7989:         if (phone == null) {
7994:             UiccCard uiccCard = phone.getUiccCard();
8064:         Phone phone = getDefaultPhone();
8065:         if (phone == null) return -1;
8066:         HalVersion hv = phone.getHalVersion();
8096:         enforceReadPrivilegedPermission("Needs READ_PRIVILEGED_PHONE_STATE for "
8102:             Phone phone = getPhone(subId);
8103:             if (phone == null) return false;
8105:             boolean isMetered = ApnSettingUtils.isMeteredApnType(apnType, phone);
8106:             return !isMetered || phone.getDataEnabledSettings().isDataEnabled(apnType);
8119:             Phone phone = getPhone(subId);
8120:             if (phone == null) return true; // By default return true.
8122:             return ApnSettingUtils.isMeteredApnType(apnType, phone);
8134:             Phone phone = getPhone(subscriptionId);
8135:             if (phone == null) {
8155:             sendRequestAsync(CMD_SET_SYSTEM_SELECTION_CHANNELS, argument, phone, null);
8225:             Phone phone = getPhone(subId);
8226:             if (phone == null) return false;
8228:             return phone.getDataEnabledSettings().setAllowDataDuringVoiceCall(allow);
8241:             Phone phone = getPhone(subId);
8242:             if (phone == null) return false;
8244:             return phone.getDataEnabledSettings().isDataAllowedInVoiceCall();
8257:             Phone phone = getPhone(subId);
8258:             if (phone == null) return false;
8260:             return phone.getDataEnabledSettings().setAlwaysAllowMmsData(alwaysAllow);
8278:             for (Phone phone : PhoneFactory.getPhones()) {
8279:                 Phone defaultPhone = phone.getImsPhone();
8280:                 if (defaultPhone != null && defaultPhone.getPhoneType() == PHONE_TYPE_IMS) {
8325:             Phone phone = getPhone(subId);
8326:             if (phone != null && phone.getIccCard() != null) {
8327:                 return phone.getIccCard().getIccLockEnabled();
8347:         Phone phone = getPhone(subId);
8348:         if (phone == null) {
8355:                     new Pair<Boolean, String>(enabled, password), phone, null);
8377:         Phone phone = getPhone(subId);
8378:         if (phone == null) {
8385:                     new Pair<String, String>(oldPassword, newPassword), phone, null);
22: import static com.android.internal.telephony.PhoneConstants.SUBSCRIPTION_KEY;
65: import android.telecom.PhoneAccount;
66: import android.telecom.PhoneAccountHandle;
85: import android.telephony.PhoneCapability;
86: import android.telephony.PhoneNumberRange;
143: import com.android.internal.telephony.PhoneConfigurationManager;
144: import com.android.internal.telephony.PhoneConstantConversions;
145: import com.android.internal.telephony.PhoneConstants;
146: import com.android.internal.telephony.PhoneFactory;
159: import com.android.internal.telephony.imsphone.ImsPhone;
160: import com.android.internal.telephony.imsphone.ImsPhoneCallTracker;
199:     private static final String LOG_TAG = "PhoneInterfaceManager";
200:     private static final boolean DBG = (PhoneGlobals.DBG_LEVEL >= 2);
297:     private static PhoneInterfaceManager sInstance;
299:     private PhoneGlobals mApp;
690:                     defaultPhone.nvReadItem((Integer) request.argument, onCompleted,
717:                     defaultPhone.nvWriteItem(idValue.first, idValue.second, onCompleted,
728:                     defaultPhone.nvWriteCdmaPrl((byte[]) request.argument, onCompleted);
738:                     defaultPhone.resetModemConfig(onCompleted);
784:                     defaultPhone.invokeOemRilRequestRaw((byte[]) request.argument, onCompleted);
1022:                     if (defaultPhone != null) {
1023:                         defaultPhone.getModemActivityInfo(onCompleted, request.workSource);
1086:                     defaultPhone.setAllowedCarriers(argument, onCompleted, request.workSource);
1114:                     defaultPhone.getAllowedCarriers(onCompleted, request.workSource);
1320:                     defaultPhone.rebootModem(onCompleted);
1330:                     PhoneConfigurationManager.getInstance()
1340:                         mPhoneConfigurationManager.addToPhoneStatusCache(phoneId, msg.arg1 == 1);
1351:                     PhoneConfigurationManager.getInstance()
1439:                     defaultPhone.eraseModemConfig(onCompleted);
1624:      * Initialize the singleton PhoneInterfaceManager instance.
1625:      * This is only done once, at startup, from PhoneApp.onCreate().
1627:     /* package */ static PhoneInterfaceManager init(PhoneGlobals app) {
1628:         synchronized (PhoneInterfaceManager.class) {
1630:                 sInstance = new PhoneInterfaceManager(app);
1641:         mCM = PhoneGlobals.getInstance().mCM;
1642:         mImsResolver = PhoneGlobals.getInstance().getImsResolver();
1650:         mPhoneConfigurationManager = PhoneConfigurationManager.getInstance();
1657:         return (thePhone != null) ? thePhone : PhoneFactory.getDefaultPhone();
1676:                 ? getDefaultPhone() : getPhone(subId);
1687:         return PhoneFactory.getPhone(mSubscriptionController.getPhoneId(subId));
1705:         PackageManager pm = getDefaultPhone().getContext().getPackageManager();
1732:             PhoneConstants.State state = mCM.getState(subId);
1733:             if (state != PhoneConstants.State.OFFHOOK && state != PhoneConstants.State.RINGING) {
1792:         return (resultArray[0] == PhoneConstants.PIN_RESULT_SUCCESS) ? true : false;
1797:         return (resultArray[0] == PhoneConstants.PIN_RESULT_SUCCESS) ? true : false;
1805:             final UnlockSim checkSimPin = new UnlockSim(getPhone(subId).getIccCard());
1818:             final UnlockSim checkSimPuk = new UnlockSim(getPhone(subId).getIccCard());
1835:         private int mResult = PhoneConstants.PIN_GENERAL_FAILURE;
1865:                                             mResult = PhoneConstants.PIN_PASSWORD_INCORRECT;
1867:                                             mResult = PhoneConstants.PIN_GENERAL_FAILURE;
1870:                                         mResult = PhoneConstants.PIN_RESULT_SUCCESS;
2045:             logv(TelephonyManager.getDefault().getPhoneCount() + " Phones are shutdown.");
2080:             if (defaultPhone != null) {
2081:                 defaultPhone.setRadioPower(turnOn);
2225:                 return PhoneConstantConversions.convertDataState(
2226:                         PhoneConstants.DataState.DISCONNECTED);
2298:             final int subId = mSubscriptionController.getSubIdUsingPhoneId(phoneId);
2513:             getDefaultPhone().setCellInfoListRate(rateInMillis, workSource);
2717:         Log.d(LOG_TAG, "[PhoneIntfMgr] " + msg);
2721:         Log.v(LOG_TAG, "[PhoneIntfMgr] " + msg);
2725:         Log.e(LOG_TAG, "[PhoneIntfMgr] " + msg);
2887:     public void requestNumberVerification(PhoneNumberRange range, long timeoutMillis,
2916:             return getDefaultPhone().needsOtaServiceProvisioning();
2951:             PhoneAccountHandle phoneAccountHandle = PhoneAccountHandleConverter.fromSubId(subId);
2952:             if (phoneAccountHandle == null) {
2955:             return VisualVoicemailSettingsUtil.dump(mApp, phoneAccountHandle);
3040:         SmsController smsController = PhoneFactory.getSmsController();
3175:         TelecomManager tm = defaultPhone.getContext().getSystemService(TelecomManager.class);
3184:             defaultPhone.sendDialerSpecialCode(inputCode);
3239:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3263:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone.
3359:         // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3386:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone.
3402:         // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3481:         // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3499:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3519:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3534:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3553:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3569:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3588:             // 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.
3640:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3656:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3671:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3687:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3703:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3722:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3741:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3759:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3804:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3834:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3867:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3926:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
4095:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
4120:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
4146:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
4172:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
4342:             return PhoneConstants.LTE_ON_CDMA_UNKNOWN;
4349:                 return PhoneConstants.LTE_ON_CDMA_UNKNOWN;
4412:         int phoneId = UiccController.getInstance().getPhoneIdFromSlotId(slotIndex);
4413:         if (phoneId == -1) {
4417:         return PhoneFactory.getPhone(phoneId);
4452:                 ComponentInfo bestComponent = EuiccConnector.findBestComponent(getDefaultPhone()
4594:                 ComponentInfo bestComponent = EuiccConnector.findBestComponent(getDefaultPhone()
4885:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp, defaultPhone.getSubId(),
4892:             return defaultPhone.getPcscfAddress(apnType);
5143:             getDefaultPhone().setImsRegistrationState(registered);
5349:                     request, messenger, binder, getPhone(subId),
5410:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp, defaultPhone.getSubId(),
5418:             return PhoneFactory.calculatePreferredNetworkType(defaultPhone.getContext(), 0);
5552:             int phoneId = mSubscriptionController.getPhoneId(subId);
5553:             if (DBG) log("setUserDataEnabled: subId=" + subId + " phoneId=" + phoneId);
5631:             int phoneId = mSubscriptionController.getPhoneId(subId);
5632:             if (DBG) log("isUserDataEnabled: subId=" + subId + " phoneId=" + phoneId);
5660:             int phoneId = mSubscriptionController.getPhoneId(subId);
5661:             if (DBG) log("isDataEnabled: subId=" + subId + " phoneId=" + phoneId);
5764:         int phoneId = SubscriptionManager.getPhoneId(subId);
5765:         UiccCard card = UiccController.getInstance().getUiccCard(phoneId);
5772:             getPhone(phoneId), pkgName);
5789:                 getPhone(i), pkgName);
5800:         if (!SubscriptionManager.isValidPhoneId(phoneId)) {
5801:             loge("phoneId " + phoneId + " is not valid.");
5804:         UiccCard card = UiccController.getInstance().getUiccCard(phoneId);
5806:             loge("getCarrierPackageNamesForIntentAndPhone: No UICC");
5813:     public List<String> getPackagesWithCarrierPrivileges(int phoneId) {
5817:         UiccCard card = UiccController.getInstance().getUiccCard(phoneId);
6180:     public int getRadioAccessFamily(int phoneId, String callingPackage) {
6191:             raf = ProxyController.getInstance().getRadioAccessFamily(phoneId);
6205:             ImsManager.getInstance(defaultPhone.getContext(),
6206:                     defaultPhone.getPhoneId()).setVtSetting(enable);
6215:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp, defaultPhone.getSubId(),
6227:                     ImsManager.getInstance(defaultPhone.getContext(), defaultPhone.getPhoneId());
6342:      * GSM and the MEID for CDMA phones. Return null if device ID is not available.
6386:             return PhoneUtils.getSubIdForPhoneAccount(phoneAccount);
6394:             PhoneAccountHandle phoneAccountHandle, String callingPackage, String callingFeatureId) {
6401:             return PhoneUtils.getSubIdForPhoneAccountHandle(phoneAccountHandle);
6495:             cleanUpSmsRawTable(getDefaultPhone().getContext());
6506:               sendEraseModemConfig(getDefaultPhone());
6687:      * @param accountHandle The handle for the {@link PhoneAccount} for which to retrieve the
6690:      * PhoneAccount.
6693:     public Uri getVoicemailRingtoneUri(PhoneAccountHandle accountHandle) {
6713:      * @param phoneAccountHandle The handle for the {@link PhoneAccount} for which to set the
6716:      * PhoneAccount.
6720:             PhoneAccountHandle phoneAccountHandle, Uri uri) {
6723:         TelecomManager tm = defaultPhone.getContext().getSystemService(TelecomManager.class);
6726:                     mApp, PhoneUtils.getSubIdForPhoneAccountHandle(phoneAccountHandle),
6745:      * @param accountHandle The handle for the {@link PhoneAccount} for which to retrieve the
6747:      * @return {@code true} if the vibration is set for this PhoneAccount, {@code false} otherwise.
6750:     public boolean isVoicemailVibrationEnabled(PhoneAccountHandle accountHandle) {
6770:      * @param phoneAccountHandle The handle for the {@link PhoneAccount} for which to set the
6773:      * specific PhoneAccount.
6777:             PhoneAccountHandle phoneAccountHandle, boolean enabled) {
6780:         TelecomManager tm = defaultPhone.getContext().getSystemService(TelecomManager.class);
6783:                     mApp, PhoneUtils.getSubIdForPhoneAccountHandle(phoneAccountHandle),
7124:         (new TelephonyShellCommand(this, getDefaultPhone().getContext()))
7377:             if (checkCarrierPrivilegesForPackageAnyPhone(callingPackage)
7566:         int phoneId = mSubscriptionController.getPhoneId(subId);
7567:         if (phoneId >= 0 && phoneId < list.size() && list.get(phoneId) != null) {
7568:             return list.get(phoneId);
7697:                             mApp, defaultPhone.getSubId(), "isEmergencyNumber(Potential)");
7915:                 getDefaultPhone().getSubId(), callingPackage, callingFeatureId,
7938:         PhoneCapability staticCapability =
8044:             int phoneCount = TelephonyManager.getDefault().getPhoneCount();
8046:             int[] logicalSlotsMapping = new int[phoneCount];
8178:         SmsPermissions permissions = new SmsPermissions(getDefaultPhone(), mApp,
8199:             return SubscriptionManager.getResourcesForSubId(getDefaultPhone().getContext(), subId)
8211:             return SubscriptionManager.getResourcesForSubId(getDefaultPhone().getContext(), subId)
8281:                     ImsPhone imsPhone = (ImsPhone) defaultPhone;
8283:                             (ImsPhoneCallTracker) imsPhone.getCallTracker();
8285:                     Rlog.i(LOG_TAG, "setCepEnabled isCepEnabled=" + isCepEnabled + ", for imsPhone "
8286:                             + imsPhone.getMsisdn());
132: import com.android.internal.telephony.DefaultPhoneNotifier;
473:                             getPhoneFromRequest(request).handlePinMmi((String) request.argument)
748:                     getPhoneFromRequest(request).getPreferredNetworkType(onCompleted);
774:                     getPhoneFromRequest(request).setPreferredNetworkType(networkType, onCompleted);
798:                     getPhoneFromRequest(request).setVoiceMailNumber(tagNum.first, tagNum.second,
810:                     getPhoneFromRequest(request).setNetworkSelectionModeAutomatic(onCompleted);
820:                     getPhoneFromRequest(request).getAvailableNetworks(onCompleted);
827:                     getPhoneFromRequest(request).getCallForwardingOption(
884:                     getPhoneFromRequest(request).setCallForwardingOption(
906:                     getPhoneFromRequest(request).getCallWaiting(onCompleted);
950:                     getPhoneFromRequest(request).setCallWaiting(isEnable, onCompleted);
1002:                     getPhoneFromRequest(request).selectNetworkManually(selArg.operatorInfo,
1197:                     getPhoneFromRequest(request).getNetworkSelectionMode(onCompleted);
1218:                     getPhoneFromRequest(request).queryCdmaRoamingPreference(onCompleted);
1234:                     getPhoneFromRequest(request).setCdmaRoamingPreference(mode, onCompleted);
1246:                     getPhoneFromRequest(request).setCdmaSubscription(subscriptionMode, onCompleted);
1361:                         mPhoneConfigurationManager.addToPhoneStatusCache(id,
1449:                     getPhoneFromRequest(request).getIccCard().changeIccLockPassword(
1467:                     getPhoneFromRequest(request).getIccCard().setIccLockEnabled(
1670:             return getPhoneFromSubId(request.subId);
1966:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
2041:             for (int i = 0; i < TelephonyManager.getDefault().getPhoneCount(); i++) {
2058:             for (int i = 0; i < TelephonyManager.getDefault().getPhoneCount(); i++) {
2060:                 shutdownRadioUsingPhoneId(i);
2590:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
2730:         return getActivePhoneTypeForSlot(getSlotForDefaultSubscription());
2760:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
2793:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
2824:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
2965:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
3133:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
3193:                     .enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3230:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3256:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3313:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3353:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3378:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3478:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3515:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3549:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3584:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3636:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3718:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3800:         checkModifyPhoneStatePermission(subId, "setRcsProvisioningStatusForCapability");
3864:         checkModifyPhoneStatePermission(subId, "setImsProvisioningStatusForCapability");
4216:                 && !TelephonyPermissions.checkCallingOrSelfReadPhoneStateNoThrow(
4250:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
4275:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
4367:         return mSubscriptionController.getPhoneId(getDefaultSubscription());
4429:         return iccOpenLogicalChannelWithPermission(getPhoneFromSubId(subId), callingPackage, aid,
4442:         return iccOpenLogicalChannelWithPermission(getPhoneFromSlotIdOrThrowException(slotIndex),
4477:         return iccCloseLogicalChannelWithPermission(getPhoneFromSubId(subId), channel);
4484:         return iccCloseLogicalChannelWithPermission(getPhoneFromSlotIdOrThrowException(slotIndex),
4513:         return iccTransmitApduLogicalChannelWithPermission(getPhoneFromSubId(subId), channel, cla,
4527:                 getPhoneFromSlotIdOrThrowException(slotIndex), channel, cla, command, p1, p2, p3,
4566:         return iccTransmitApduBasicChannelWithPermission(getPhoneFromSubId(subId), callingPackage,
4582:                 getPhoneFromSlotIdOrThrowException(slotIndex), callingPackage, cla, command, p1,
4667:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
4705:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp, subId, callingPackage,
5086:                 .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
5433:                 .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
5482:                 .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
5780:         for (int i = 0; i < TelephonyManager.getDefault().getPhoneCount(); i++) {
5844:         enforceReadPrivilegedPermission("getPackagesWithCarrierPrivilegesForAllPhones");
5850:             for (int i = 0; i < TelephonyManager.getDefault().getPhoneCount(); i++) {
5930:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneNumber(
5957:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
5980:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
6189:                     .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
6239:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
6258:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
6395:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp, getDefaultSubscription(),
6396:                 callingPackage, callingFeatureId, "getSubIdForPhoneAccountHandle")) {
6631:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
7157:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
7314:             TelephonyPermissions.enforeceCallingOrSelfReadPhoneStatePermissionOrCarrierPrivilege(
7352:                 .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
7476:                         slot.getPhoneId(),
7612:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
7620:             return mPhoneConfigurationManager.getNumberOfModemsWithSimultaneousDataConnections();
7629:                 .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
7669:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
7696:                     .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
7879:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
7914:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp,
7939:                 mPhoneConfigurationManager.getStaticPhoneCapability();
7979:             mPhoneConfigurationManager.switchMultiSimConfig(numOfSims);
8019:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
8026:             return mPhoneConfigurationManager.isRebootRequiredForModemConfigChange();
8035:         metrics.updateEnabledModemBitmap((1 << TelephonyManager.from(mApp).getPhoneCount()) - 1);
8049:                 if (SubscriptionManager.isValidPhoneId(slotInfos[i].getLogicalSlotIdx())) {
8164:                 SubscriptionManager.getPhoneId(subId), UiccController.APP_FAM_3GPP);
8282:                     ImsPhoneCallTracker imsPhoneCallTracker =
8284:                     imsPhoneCallTracker.setConferenceEventPackageEnabled(isCepEnabled);
android.googlesource.com/platform/frameworks/opt/telephony:src/java/com/android/internal/telephony/Phone.java: [ master, ]
116: public abstract class Phone extends Handler implements PhoneInternalInterface {
498:     protected Phone(String name, PhoneNotifier notifier, Context context, CommandsInterface ci,
515:     protected Phone(String name, PhoneNotifier notifier, Context context, CommandsInterface ci,
328:     protected Phone mImsPhone = null;
594:     public void createImsPhone() {
3516:     public Phone getImsPhone() {
4164:     public Phone getDefaultPhone() {
193:     protected static final int EVENT_UPDATE_PHONE_OBJECT            = 42;
294:     protected boolean mIsPhoneInEcmState = false;
325:     protected int mPhoneId;
438:     public String getPhoneName() {
442:     protected void setPhoneName(String name) {
1776:     public void updatePhoneObject(int voiceRadioTech) {
2627:     public abstract int getPhoneType();
3639:     public int getPhoneId() {
3647:     public int getVoicePhoneServiceState() {
106:  * A base implementation for the com.android.internal.telephony.Phone interface.
108:  * Note that implementations of Phone.java are expected to be used
117:     private static final String LOG_TAG = "Phone";
242:      * This method is invoked when the Phone exits Emergency Callback Mode.
292:     // Keep track of whether or not the phone is in Emergency Callback Mode for Phone and
433:      * Returns a string identifier for this phone interface for parties
434:      *  outside the phone app process.
489:      * Constructs a Phone in normal (non-unit test) mode.
500:         this(name, notifier, context, ci, unitTestMode, SubscriptionManager.DEFAULT_PHONE_INDEX,
505:      * Constructs a Phone in normal (non-unit test) mode.
513:      * @param phoneId the phone-id of this phone.
541:         * (i.e. voice) phone calls over the telephony network, and is allowed
568:         if (getPhoneType() == PhoneConstants.PHONE_TYPE_IMS) {
583:         if (getPhoneType() != PhoneConstants.PHONE_TYPE_SIP) {
595:         if (getPhoneType() == PhoneConstants.PHONE_TYPE_SIP) {
599:         synchronized(Phone.lockForRadioTechnologyChange) {
662:         // messages to be handled whether or not the phone is being destroyed
664:         // resources of the phone being destroyed
784:         Phone imsPhone = mImsPhone;
823:      * Gets the context for the phone, as set at initialization time.
879:      * Subclasses of Phone probably want to replace this with a
905:      * Subclasses of Phone probably want to replace this with a
929:      * Subclasses of Phone probably want to replace this with a
941:      * Notify the phone that an SMS has been sent. This will be used determine if the SMS was sent
955:      * Determine if the Phone has recently sent an emergency SMS and is still in the interval of
996:     protected void migrateFrom(Phone from) {
1009:         // The emergency state of IMS phone will be cleared in ImsPhone#notifySrvccState after
1072:      *   Connection.getCall() == Phone.getRingingCall()
1092:      * Notifies when phone's video capabilities changes <p>
1097:      *  AsyncResult.result = true if phone supports video calling <p>
1236:      * Example: If Phone.dial is called with "*#31#", then the app will
1548:      * For unit tests; don't send notifications to "Phone"
1565:      * Subclasses of Phone probably want to replace this with a
1670:         // no need for regular phone
1674:      * Subclasses of Phone probably want to replace this with a
1685:      * If this is a simulated phone interface, returns a SimulatedRadioControl.
1699:      * the thread that originally obtained this Phone instance.
1704:                     "com.android.internal.telephony.Phone must be used from within one thread");
1736:      * If the phone has an active call and call waiting occurs,
1737:      * then the phone state is RINGING not OFFHOOK
1746:      * Retrieves the IccFileHandler of the Phone instance
1765:      * Retrieves the Handler of the Phone instance
1772:      * Update the phone object if the voice radio technology has changed
1780:     * Retrieves the ServiceStateTracker of the phone instance.
1788:      * Retrieves the EmergencyNumberTracker of the phone instance.
1810:      * Retrieves the DeviceStateMonitor of the phone instance.
1817:      * Retrieves the DisplayInfoController of the phone instance.
1865:      * Returns the ICC card interface for this phone, or null
1871:         //throw new Exception("getIccCard Shouldn't be called from Phone");
2050:         if (getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA) {
2218:      * - {@link com.android.internal.telephony.Phone#TTY_MODE_OFF}
2219:      * - {@link com.android.internal.telephony.Phone#TTY_MODE_FULL}
2220:      * - {@link com.android.internal.telephony.Phone#TTY_MODE_HCO}
2221:      * - {@link com.android.internal.telephony.Phone#TTY_MODE_VCO}
2232:      * - {@link com.android.internal.telephony.Phone#TTY_MODE_OFF}
2233:      * - {@link com.android.internal.telephony.Phone#TTY_MODE_FULL}
2234:      * - {@link com.android.internal.telephony.Phone#TTY_MODE_HCO}
2235:      * - {@link com.android.internal.telephony.Phone#TTY_MODE_VCO}
2532:     // This property is used to handle phone process crashes, and is the same for CDMA and IMS
2539:      * @return {@code true} if we are in emergency call back mode. This is a period where the phone
2559:      * @return true if this Phone is in an emergency call that caused emergency callback mode to be
2567:      * Set whether or not this Phone has an active emergency call that was placed during emergency
2623:      * Return a numerical identifier for the phone radio interface.
2624:      * @return PHONE_TYPE_XXX as defined above.
2637:     /** sets the voice mail count of the phone and notifies listeners. */
3319:      * Subclasses of Phone probably want to replace this with a
3337:      * Notify registrants if phone is video capable.
3469:         Rlog.e(LOG_TAG, "Error! This function should never be executed, inactive Phone.");
3482:      * Gets the Uicc card corresponding to this phone.
3483:      * @return the UiccCard object corresponding to the phone ID.
3513:      * Return an instance of a IMS phone
3636:      * Returns the phone id.
3648:         Phone imsPhone = mImsPhone;
3722:         Phone imsPhone = mImsPhone;
3741:         Phone imsPhone = mImsPhone;
3755:         Phone imsPhone = mImsPhone;
3769:         Phone imsPhone = mImsPhone;
3779:      * @return the IMS MmTel Registration technology for this Phone, defined in
3783:         Phone imsPhone = mImsPhone;
3793:      * Get the IMS MmTel Registration technology for this Phone, defined in
3797:         Phone imsPhone = mImsPhone;
3806:      * Asynchronously get the IMS MmTel Registration state for this Phone.
3809:         Phone imsPhone = mImsPhone;
3867:      *  Set phone radio capability
3869:      *  @param rc the phone radio capability defined in
3878:      *  Get phone radio access family
3898:      *  Get phone radio capability
3912:      *  @param rc the phone radio capability currently in effect for this phone.
3945:      * Registers the handler when phone radio  capability is changed.
3956:      * Unregister for notifications when phone radio type and access technology is changed.
3991:      * Determines if video calling is enabled for the phone.
3997:         Phone imsPhone = mImsPhone;
4119:     public static void checkWfcWifiOnlyModeBeforeDial(Phone imsPhone, int phoneId, Context context)
4159:      * This function returns the parent phone of the current phone. It is applicable
4160:      * only for IMS phone (function is overridden by ImsPhone). For others the phone
4198:      * none of the phone is in service, and one of them has the capability to make the emergency
4205:         for (Phone phone : PhoneFactory.getPhones()) {
4206:             if (phone != null) {
4207:                 ServiceState ss = phone.getServiceStateTracker().getServiceState();
4208:                 // One of the phone is in service, hence the device is not emergency call only.
4280:         pw.println("Phone: subId=" + getSubId());
4455:         pw.println("Phone Local Log: ");
51: import android.telephony.PhoneStateListener;
80: import com.android.internal.telephony.imsphone.ImsPhoneCall;
110:  * originally called PhoneFactory to obtain the interface.
415:      * PhoneNotifier is an abstraction for all system-wide
420:     protected PhoneNotifier mNotifier;
447:      * Retrieves Nai for phones. Returns null if Nai is not set.
516:                     boolean unitTestMode, int phoneId,
518:         mPhoneId = phoneId;
557:          * By default old phones won't have the property set but do generate
591:      * Start setup of ImsPhone, which will start trying to connect to the ImsResolver. Will not be
600:             if (mImsPhone == null) {
601:                 mImsPhone = PhoneFactory.makeImsPhone(mNotifier, this);
602:                 CallManager.getInstance().registerPhone(mImsPhone);
603:                 mImsPhone.registerForSilentRedial(
678:                     PhoneConstants.State state = getState();
680:                             && ((state == PhoneConstants.State.RINGING) ||
681:                                     (state == PhoneConstants.State.IDLE))) {
692:                 if (getState() == PhoneConstants.State.RINGING) {
710:                         if (mImsPhone != null) {
712:                             mImsPhone.notifyRedialConnectionChanged(cn);
716:                         if (mImsPhone != null) {
717:                             mImsPhone.notifyRedialConnectionChanged(null);
791:                     if (imsPhone != null) {
792:                         conn = imsPhone.getHandoverConnection();
793:                         migrateFrom(imsPhone);
795:                         Rlog.d(LOG_TAG, "HANDOVER_STARTED: mImsPhone null");
800:                     if (imsPhone != null) {
801:                         imsPhone.notifySrvccState(srvccState);
803:                         Rlog.d(LOG_TAG, "HANDOVER_COMPLETED: mImsPhone null");
856:      * {@link PhoneConstants.State} which can be obtained using the {@link PhoneStateListener}
1026:             // Since CallManager has already registered with both CS and IMS phones,
1743:     public abstract PhoneConstants.State getState();
1941:      * Sets the minimum time in milli-seconds between {@link PhoneStateListener#onCellInfoChanged
1942:      * PhoneStateListener.onCellInfoChanged} will be invoked.
1957:      * available on this interface. Use PhoneStateNotifier or similar instead.
2045:      * available on this interface. Use PhoneStateNotifier or similar instead.
2087:      * interface. Use <code>PhoneStateNotifier</code> or an equivalent.
2457:     public PhoneConstants.DataState getDataConnectionState(String apnType) {
2458:         return PhoneConstants.DataState.DISCONNECTED;
2533:     // phones
2613:         if (mImsPhone != null) {
2614:             isPresent = isVideoCallOrConference(mImsPhone.getForegroundCall()) ||
2615:                     isVideoCallOrConference(mImsPhone.getBackgroundCall()) ||
2616:                     isVideoCallOrConference(mImsPhone.getRingingCall());
2758:      * Retrieves the MIN for CDMA phones.
2774:      *  Retrieves PRL Version for CDMA phones
3413:      * Retrieves the MSISDN from the UICC. For GSM/UMTS phones, this is equivalent to
3414:      * {@link #getLine1Number()}. For CDMA phones, {@link #getLine1Number()} returns
3415:      * the MDN, so this method is provided to return the MSISDN on CDMA/LTE phones.
3423:      * Retrieves the EF_PNN from the UICC For GSM/UMTS phones.
3432:      * {@link android.telephony.PhoneStateListener} instead.
3435:     public PhoneConstants.DataState getDataConnectionState() {
3436:         return getDataConnectionState(PhoneConstants.APN_TYPE_DEFAULT);
3453:      * @return {@link PhoneConstants#LTE_ON_CDMA_UNKNOWN}, {@link PhoneConstants#LTE_ON_CDMA_FALSE}
3454:      * or {@link PhoneConstants#LTE_ON_CDMA_TRUE}
3468:         // This function should be overridden by class GsmCdmaPhone.
3517:         return mImsPhone;
3583:      * Return if UT capability of ImsPhone is enabled or not
3587:         if (mImsPhone != null) {
3588:             return mImsPhone.isUtEnabled();
3607:         // dialInternal shall be overriden by GsmCdmaPhone
3612:      * This function is for CSFB SS. GsmCdmaPhone overrides this function.
3644:      * Return the service state of mImsPhone if it is STATE_IN_SERVICE
3649:         if (imsPhone != null
3650:                 && imsPhone.getServiceState().getState() == ServiceState.STATE_IN_SERVICE) {
3724:         if (imsPhone != null) {
3725:             isImsRegistered = imsPhone.isImsRegistered();
3743:         if (imsPhone != null) {
3744:             isWifiCallingEnabled = imsPhone.isWifiCallingEnabled();
3757:         if (imsPhone != null) {
3758:             isAvailable = imsPhone.isImsCapabilityAvailable(capability, regTech);
3771:         if (imsPhone != null) {
3772:             isVolteEnabled = imsPhone.isVolteEnabled();
3785:         if (imsPhone != null) {
3786:             regTech = imsPhone.getImsRegistrationTech();
3798:         if (imsPhone != null) {
3799:             imsPhone.getImsRegistrationTech(callback);
3810:         if (imsPhone != null) {
3811:             imsPhone.getImsRegistrationState(callback);
3928:         int type = PhoneFactory.calculatePreferredNetworkType(mContext, getSubId());
3939:             int type = PhoneFactory.calculatePreferredNetworkType(mContext, getSubId());
3983:         if (mImsPhone == null) {
3987:         return mImsPhone.isImsAvailable();
3998:         if (imsPhone != null) {
3999:             return imsPhone.isVideoEnabled();
4121:         if (imsPhone == null || !imsPhone.isWifiCallingEnabled()) {
4122:             ImsManager imsManager = ImsManager.getInstance(context, phoneId);
4319:         if (mImsPhone != null) {
4321:                 mImsPhone.dump(fd, pw, args);
416:      * state change notification. DefaultPhoneNotifier is
491:      * @param notifier An instance of DefaultPhoneNotifier,
507:      * @param notifier An instance of DefaultPhoneNotifier,
2414:         // This function is added to send the notification to DefaultPhoneNotifier.
2544:         return mIsPhoneInEcmState;
2555:         mIsPhoneInEcmState = isInEcm;
2599:         if (call instanceof ImsPhoneCall) {
2600:             ImsPhoneCall imsPhoneCall = (ImsPhoneCall) call;
2601:             ImsCall imsCall = imsPhoneCall.getImsCall();
2655:                 mPhoneId, UiccController.APP_FAM_3GPP);
3389:      * A fucntion of type getPhoneProp(propType) where propType is an
3487:         return mUiccController.getUiccCard(mPhoneId);
3632:         return SubscriptionController.getInstance().getSubIdUsingPhoneId(mPhoneId);
3640:         return mPhoneId;
3970:         ImsManager imsManager = ImsManager.getInstance(mContext, mPhoneId);
4281:         pw.println(" mPhoneId=" + mPhoneId);
4308:         pw.println(" getPhoneName()=" + getPhoneName());
4309:         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/opt/vcard:java/com/android/vcard/VCardEntry.java: [ master, ]
101:         PHONE,
315:     public static class PhoneData implements EntryElement {
325:         public PhoneData(String data, int type, String label, boolean isPrimary) {
1779:     private void addPhone(int type, String data, String label, boolean isPrimary) {
143:         private String mPhoneticFamily;
144:         private String mPhoneticGiven;
145:         private String mPhoneticMiddle;
167:         public boolean emptyPhoneticStructuredName() {
750:         private final String mPhoneticName; // We won't have this in "TITLE" property.
870:         public String getPhoneticName() {
1555:     private List<PhoneData> mPhoneList;
1865:     private String buildSinglePhoneticNameFromSortAsParam(Map<String, Collection<String>> paramMap) {
2078:     private void handlePhoneticNameFromSound(List<String> elems) {
2633:     public final List<PhoneData> getPhoneList() {
33: import android.provider.ContactsContract.CommonDataKinds.Phone;
337:             builder.withValueBackReference(Phone.RAW_CONTACT_ID, backReferenceIndex);
338:             builder.withValue(Data.MIMETYPE, Phone.CONTENT_ITEM_TYPE);
340:             builder.withValue(Phone.TYPE, mType);
341:             if (mType == Phone.TYPE_CUSTOM) {
342:                 builder.withValue(Phone.LABEL, mLabel);
344:             builder.withValue(Phone.NUMBER, mNumber);
346:                 builder.withValue(Phone.IS_PRIMARY, 1);
388:             return EntryLabel.PHONE;
1786:         if (type == Phone.TYPE_PAGER || VCardConfig.refrainPhoneNumberFormatting(mVCardType)) {
1790:             // Note that some other codes (like the phone number formatter) or modules expect this
2307:                 // Given propValue is in URI format, not in phone number format used until
2315:                     // we may still have non-URI phone number. To keep given data as much as
2340:                     type = Phone.TYPE_CUSTOM;
2355:             // The phone number available via Skype.
2357:             final int type = Phone.TYPE_OTHER;
19: import com.android.vcard.VCardUtils.PhoneNumberUtilsPort;
42: import android.telephony.PhoneNumberUtils;
196:             boolean phoneticNameSpecified = false;
199:                 builder.withValue(StructuredName.PHONETIC_GIVEN_NAME, mPhoneticGiven);
200:                 phoneticNameSpecified = true;
203:                 builder.withValue(StructuredName.PHONETIC_FAMILY_NAME, mPhoneticFamily);
204:                 phoneticNameSpecified = true;
207:                 builder.withValue(StructuredName.PHONETIC_MIDDLE_NAME, mPhoneticMiddle);
208:                 phoneticNameSpecified = true;
211:             // SORT-STRING is used only when phonetic names aren't specified in
213:             if (!phoneticNameSpecified) {
214:                 builder.withValue(StructuredName.PHONETIC_GIVEN_NAME, mSortString);
361:             if (!(obj instanceof PhoneData)) {
364:             PhoneData phoneData = (PhoneData) obj;
365:             return (mType == phoneData.mType
366:                     && TextUtils.equals(mNumber, phoneData.mNumber)
367:                     && TextUtils.equals(mLabel, phoneData.mLabel)
368:                     && (mIsPrimary == phoneData.mIsPrimary));
755:                 final String titleName, final String phoneticName, int type,
761:             mPhoneticName = phoneticName;
806:                 builder.withValue(Organization.PHONETIC_NAME, mPhoneticName);
1781:             mPhoneList = new ArrayList<PhoneData>();
1797:                 // See RFC 3601 and docs for PhoneNumberUtils for more info.
1799:                     builder.append(PhoneNumberUtils.PAUSE);
1802:                     builder.append(PhoneNumberUtils.WAIT);
1804:                 } else if (PhoneNumberUtils.is12Key(ch) || (i == 0 && ch == '+')) {
1810:                 formattedNumber = PhoneNumberUtilsPort.formatNumber(
1816:         PhoneData phoneData = new PhoneData(formattedNumber, type, label, isPrimary);
1817:         mPhoneList.add(phoneData);
1854:             final String titleName, final String phoneticName, int type, final boolean isPrimary) {
1859:                 phoneticName, type, isPrimary));
1894:         final String phoneticName = buildSinglePhoneticNameFromSortAsParam(paramMap);
1929:             addNewOrganization(organizationName, departmentName, null, phoneticName, type,
1948:         addNewOrganization(organizationName, departmentName, null, phoneticName, type, isPrimary);
2001:      * them in appropriate phonetic name variables. This method does not care
2072:      * Note: Some Japanese mobile phones use this field for phonetic name, since
2082:             // This means the other properties like "X-PHONETIC-FIRST-NAME" was already found.
2094:         // phones use this order.
2117:                     // phones' preference.
2177:                 final List<String> phoneticNameList = VCardUtils.constructListFromValue(propValue,
2179:                 handlePhoneticNameFromSound(phoneticNameList);
2304:             String phoneNumber = null;
2312:                     phoneNumber = propValue.substring(4);
2317:                     phoneNumber = propValue;
2320:                 phoneNumber = propValue;
2333:                         phoneNumber);
2352:                 addPhone(type, phoneNumber, label, isPrimary);
2365:             addPhone(type, propValue, null, isPrimary);
2399:         } else if (propertyName.equals(VCardConstants.PROPERTY_X_PHONETIC_FIRST_NAME)) {
2401:         } else if (propertyName.equals(VCardConstants.PROPERTY_X_PHONETIC_MIDDLE_NAME)) {
2403:         } else if (propertyName.equals(VCardConstants.PROPERTY_X_PHONETIC_LAST_NAME)) {
168:             return TextUtils.isEmpty(mPhoneticFamily) && TextUtils.isEmpty(mPhoneticGiven)
169:                     && TextUtils.isEmpty(mPhoneticMiddle);
198:             if (!TextUtils.isEmpty(mPhoneticGiven)) {
202:             if (!TextUtils.isEmpty(mPhoneticFamily)) {
206:             if (!TextUtils.isEmpty(mPhoneticMiddle)) {
226:                     && TextUtils.isEmpty(mPhoneticFamily) && TextUtils.isEmpty(mPhoneticMiddle)
227:                     && TextUtils.isEmpty(mPhoneticGiven) && TextUtils.isEmpty(mSortString));
246:                     && TextUtils.equals(mPhoneticFamily, nameData.mPhoneticFamily)
247:                     && TextUtils.equals(mPhoneticMiddle, nameData.mPhoneticMiddle)
248:                     && TextUtils.equals(mPhoneticGiven, nameData.mPhoneticGiven)
255:                     mFormatted, mPhoneticFamily, mPhoneticMiddle,
256:                     mPhoneticGiven, mSortString};
805:             if (mPhoneticName != null) {
817:                     && TextUtils.isEmpty(mTitle) && TextUtils.isEmpty(mPhoneticName);
871:             return mPhoneticName;
1604:         iterateOneList(mPhoneList, iterator);
1780:         if (mPhoneList == null) {
1809:                 final int formattingType = VCardUtils.getPhoneNumberFormat(mVCardType);
2010:                 && !(TextUtils.isEmpty(mNameData.mPhoneticFamily)
2011:                         && TextUtils.isEmpty(mNameData.mPhoneticMiddle) && TextUtils
2012:                         .isEmpty(mNameData.mPhoneticGiven))) {
2031:                 mNameData.mPhoneticMiddle = sortNames.get(2); //$FALL-THROUGH$
2033:                 mNameData.mPhoneticGiven = sortNames.get(1); //$FALL-THROUGH$
2035:                 mNameData.mPhoneticFamily = sortNames.get(0);
2079:         if (!(TextUtils.isEmpty(mNameData.mPhoneticFamily)
2080:                 && TextUtils.isEmpty(mNameData.mPhoneticMiddle) && TextUtils
2081:                 .isEmpty(mNameData.mPhoneticGiven))) {
2112:                     mNameData.mPhoneticFamily = namesArray[0];
2113:                     mNameData.mPhoneticMiddle = namesArray[1];
2114:                     mNameData.mPhoneticGiven = namesArray[2];
2118:                     mNameData.mPhoneticFamily = namesArray[0];
2119:                     mNameData.mPhoneticGiven = namesArray[1];
2121:                     mNameData.mPhoneticGiven = elems.get(0);
2130:             mNameData.mPhoneticMiddle = elems.get(2);
2132:             mNameData.mPhoneticGiven = elems.get(1);
2134:             mNameData.mPhoneticFamily = elems.get(0);
2332:                 final Object typeObject = VCardUtils.getPhoneTypeFromStrings(typeCollection,
2400:             mNameData.mPhoneticGiven = propValue;
2402:             mNameData.mPhoneticMiddle = propValue;
2404:             mNameData.mPhoneticFamily = propValue;
2500:         } else if (!mNameData.emptyPhoneticStructuredName()) {
2502:                     mNameData.mPhoneticFamily, mNameData.mPhoneticMiddle, mNameData.mPhoneticGiven);
2505:         } else if (mPhoneList != null && mPhoneList.size() > 0) {
2506:             displayName = mPhoneList.get(0).mNumber;
2634:         return mPhoneList;
android.googlesource.com/platform/frameworks/base:cmds/statsd/src/atoms.proto: [ master, ]
5593:         PHONE = 9;
2537:         HARDWARE_FAILED_MICROPHONE = 1;
2707: message PhoneSignalStrengthChanged {
2719: message PhoneServiceStateChanged {
2731: message PhoneStateChanged {
116:         PhoneSignalStrengthChanged phone_signal_strength_changed = 40;
173:         PhoneServiceStateChanged phone_service_state_changed = 94;
174:         PhoneStateChanged phone_state_changed = 95;
1292:  *   frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1297:         // The keyguard is hidden when the phone is unlocked.
1299:         // The keyguard is shown when the phone is locked (screen turns off).
1313:  *   frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
2702:  * Logs phone signal strength changes.
2714:  * Logs when the phone state, sim state or signal strength changes
2726:  * Logs when the phone becomes on or off.
3263:  *      frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
1460:     // For multi-sim phones, this distinguishes between the sim cards.
1482:     // For multi-sim phones, this distinguishes between the sim cards.
5388:  * time_in_state files not being present on some phones, have not been addressed. These should be
6605:  * Track how we arbitrate between microphone/input requests.
6620:  * Track how we arbitrate between microphone requests.
6635:  * Track how we arbitrate between microphone/input requests.
6650:  * Track how we arbitrate between microphone/input requests.
android.googlesource.com/platform/superproject:frameworks/base/cmds/statsd/src/atoms.proto: [ master, ]
5593:         PHONE = 9;
2537:         HARDWARE_FAILED_MICROPHONE = 1;
2707: message PhoneSignalStrengthChanged {
2719: message PhoneServiceStateChanged {
2731: message PhoneStateChanged {
116:         PhoneSignalStrengthChanged phone_signal_strength_changed = 40;
173:         PhoneServiceStateChanged phone_service_state_changed = 94;
174:         PhoneStateChanged phone_state_changed = 95;
1292:  *   frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1297:         // The keyguard is hidden when the phone is unlocked.
1299:         // The keyguard is shown when the phone is locked (screen turns off).
1313:  *   frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
2702:  * Logs phone signal strength changes.
2714:  * Logs when the phone state, sim state or signal strength changes
2726:  * Logs when the phone becomes on or off.
3263:  *      frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
1460:     // For multi-sim phones, this distinguishes between the sim cards.
1482:     // For multi-sim phones, this distinguishes between the sim cards.
5388:  * time_in_state files not being present on some phones, have not been addressed. These should be
6601:  * Track how we arbitrate between microphone/input requests.
6616:  * Track how we arbitrate between microphone requests.
6631:  * Track how we arbitrate between microphone/input requests.
6646:  * 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:     protected static EditType buildPhoneType(int type) {
220:     protected DataKind addDataKindPhoneticName(Context context) throws DefinitionException {
30: import android.provider.ContactsContract.CommonDataKinds.Phone;
121:         this.titleRes = R.string.account_phone;
126:         return new EditType(type, Phone.getTypeLabelResource(type));
257:         DataKind kind = addKind(new DataKind(Phone.CONTENT_ITEM_TYPE, R.string.phoneLabelsGroup,
258:                 Weight.PHONE, true));
263:         kind.actionBody = new SimpleInflater(Phone.NUMBER);
264:         kind.typeColumn = Phone.TYPE;
266:         kind.typeList.add(buildPhoneType(Phone.TYPE_MOBILE));
267:         kind.typeList.add(buildPhoneType(Phone.TYPE_HOME