Found 375969 results in 66326 files, showing top 450 files (show more).
android.googlesource.com/platform/packages/services/Telephony:src/com/android/phone/PhoneInterfaceManager.java: [ master, ]
378:         public Phone phone;
17: package com.android.phone;
199: public class PhoneInterfaceManager extends ITelephony.Stub {
1641:     /* package */ PhoneInterfaceManager(PhoneGlobals app) {
1657:     private Phone getDefaultPhone() {
1688:     private Phone getPhone(int subId) {
2296:     public String getNetworkCountryIsoForPhone(int phoneId) {
5799:     public int checkCarrierPrivilegesForPackageAnyPhone(String pkgName) {
5822:     public List<String> getCarrierPackageNamesForIntentAndPhone(Intent intent, int phoneId) {
6280:     public boolean isWorldPhone(int subId, String callingPackage, String callingFeatureId) {
308:     private PhoneConfigurationManager mPhoneConfigurationManager;
1668:     private Phone getPhoneFromRequest(MainThreadRequest request) {
1676:     private Phone getPhoneFromSubId(int subId) {
2074:     private void shutdownRadioUsingPhoneId(int phoneId) {
2736:     public int getActivePhoneType() {
2741:     public int getActivePhoneTypeForSlot(int slotIndex) {
3780:     private void checkModifyPhoneStatePermission(int subId, String message) {
4418:     private Phone getPhoneFromSlotIdOrThrowException(int slotIndex) {
5866:     public List<String> getPackagesWithCarrierPrivilegesForAllPhones() {
6406:     public int getSubIdForPhoneAccount(PhoneAccount phoneAccount) {
6416:     public int getSubIdForPhoneAccountHandle(
6431:     public @Nullable PhoneAccountHandle getPhoneAccountHandleForSubscriptionId(int subscriptionId) {
21: import static com.android.internal.telephony.PhoneConstants.PHONE_TYPE_IMS;
143: import com.android.internal.telephony.Phone;
176: import com.android.phone.settings.PickSmsSubscriptionActivity;
177: import com.android.phone.vvm.PhoneAccountHandleConverter;
178: import com.android.phone.vvm.RemoteVvmTaskManager;
179: import com.android.phone.vvm.VisualVoicemailSettingsUtil;
180: import com.android.phone.vvm.VisualVoicemailSmsFilterConfig;
377:         // In cases where subId is unavailable, the caller needs to specify the phone.
386:         MainThreadRequest(Object argument, Phone phone, WorkSource workSource) {
388:             if (phone != null) {
389:                 this.phone = phone;
417:      * A handler that processes messages on the main thread in the phone process. Since many
418:      * of the Phone calls are not thread safe this is needed to shuttle the requests from the
419:      * inbound binder threads to the main thread in the phone process.  The Binder thread
436:             final Phone defaultPhone = getDefaultPhone();
441:                     final Phone phone = getPhoneFromRequest(request);
460:                         request.result = phone != null
461:                                 ? phone.handleUssdRequest(ussdRequest, wrappedCallback) : false;
472:                     final Phone phone = getPhoneFromRequest(request);
473:                     request.result = phone != null ?
1258:                     request.phone.requestCellInfoUpdate(request.workSource, onCompleted);
1272:                     request.phone.requestCellInfoUpdate(request.workSource,
1300:                     Phone phone = getPhoneFromRequest(request);
1301:                     phone.getCellIdentity(ws, obtainMessage(EVENT_GET_CELL_LOCATION_DONE, request));
1309:                         phone = getPhoneFromRequest(request);
1310:                         request.result = (phone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA)
1332:                             .enablePhone(request.phone, enable, onCompleted);
1338:                     int phoneId = request.phone.getPhoneId();
1353:                             .getPhoneStatusFromModem(request.phone, onCompleted);
1358:                     int id = request.phone.getPhoneId();
1381:                     request.phone.setSystemSelectionChannels(args.first, onCompleted);
1554:     private Object sendRequest(int command, Object argument, Phone phone, WorkSource workSource) {
1556:                 command, argument, SubscriptionManager.INVALID_SUBSCRIPTION_ID, phone, workSource);
1565:             int command, Object argument, Integer subId, Phone phone, WorkSource workSource) {
1571:         if (subId != SubscriptionManager.INVALID_SUBSCRIPTION_ID && phone != null) {
1572:             throw new IllegalArgumentException("subId and phone cannot both be specified!");
1573:         } else if (phone != null) {
1574:             request = new MainThreadRequest(argument, phone, workSource);
1614:      * Same as {@link #sendRequestAsync(int,Object)} except it takes a Phone and WorkSource.
1618:             int command, Object argument, Phone phone, WorkSource workSource) {
1619:         MainThreadRequest request = new MainThreadRequest(argument, phone, workSource);
1658:         Phone thePhone = getPhone(getDefaultSubscription());
1665:         ServiceManager.addService("phone", this);
1669:         if (request.phone != null) {
1670:             return request.phone;
1682:         Phone phone = getPhoneFromRequest(request);
1683:         return phone == null ? null :
1684:                 UiccController.getInstance().getUiccCard(phone.getPhoneId());
1687:     // returns phone associated with the subId.
1692:     private void sendEraseModemConfig(Phone phone) {
1693:         if (phone != null) {
1695:                   mApp, phone.getSubId(), "eraseModemConfig");
1733:             // PENDING: should we just silently fail if phone is offhook or ringing?
1754:         // from the context of the phone app.
1757:         if (mAppOps.noteOp(AppOpsManager.OPSTR_CALL_PHONE, Binder.getCallingUid(), callingPackage)
1943:             final Phone phone = getPhone(subId);
1944:             if (phone != null) {
1945:                 phone.updateServiceLocation();
1989:             final Phone phone = getPhone(subId);
1990:             if (phone != null) {
1991:                 return phone.getServiceState().getState() != ServiceState.STATE_POWER_OFF;
2009:             final Phone phone = getPhone(subId);
2010:             if (phone != null) {
2011:                 phone.setRadioPower(!isRadioOnForSubscriber(subId));
2027:             final Phone phone = getPhone(subId);
2028:             if (phone == null) {
2031:             if ((phone.getServiceState().getState() != ServiceState.STATE_POWER_OFF) != turnOn) {
2049:                 Phone phone = PhoneFactory.getPhone(i);
2050:                 if (phone != null && phone.isRadioAvailable()) return true;
2066:                 logv("Shutting down Phone " + i);
2075:         Phone phone = PhoneFactory.getPhone(phoneId);
2076:         if (phone != null && phone.isRadioAvailable()) {
2077:             phone.shutdownRadio();
2086:             final Phone defaultPhone = PhoneFactory.getDefaultPhone();
2091:                 loge("There's no default phone.");
2104:             final Phone phone = getPhone(subId);
2105:             if (phone != null) {
2106:                 phone.setRadioPower(turnOn);
2124:             final Phone phone = getPhone(subId);
2125:             if (phone != null) {
2126:                 phone.getDataEnabledSettings().setUserDataEnabled(true);
2144:             final Phone phone = getPhone(subId);
2145:             if (phone != null) {
2146:                 phone.getDataEnabledSettings().setUserDataEnabled(false);
2160:             final Phone phone = getPhone(subId);
2161:             if (phone != null) {
2162:                 return phone.isDataAllowed(ApnSetting.TYPE_DEFAULT);
2211:             Phone phone = PhoneFactory.getPhone(slotIndex);
2212:             return phone == null ? TelephonyManager.CALL_STATE_IDLE :
2213:                     PhoneConstantConversions.convertCallState(phone.getState());
2228:             final Phone phone = getPhone(subId);
2229:             if (phone != null) {
2230:                 return PhoneConstantConversions.convertDataState(phone.getDataConnectionState());
2249:             final Phone phone = getPhone(subId);
2250:             if (phone != null) {
2251:                 return DefaultPhoneNotifier.convertDataActivityState(phone.getDataActivityState());
2280:                 return (getDefaultPhone().getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA)
2301:             if (phoneId == SubscriptionManager.INVALID_PHONE_INDEX) {
2302:                 // Get default phone in this case.
2303:                 phoneId = SubscriptionManager.DEFAULT_PHONE_INDEX;
2306:             Phone phone = PhoneFactory.getPhone(phoneId);
2307:             if (phone == null) return "";
2308:             ServiceStateTracker sst = phone.getServiceStateTracker();
2313:             EmergencyNumberTracker ent = phone.getEmergencyNumberTracker();
2332:             final Phone phone = getPhone(subId);
2333:             if (phone != null) {
2334:                 phone.enableLocationUpdates();
2353:             final Phone phone = getPhone(subId);
2354:             if (phone != null) {
2355:                 phone.disableLocationUpdates();
2414:         for (Phone phone : PhoneFactory.getPhones()) {
2415:             List<CellInfo> info = phone.getAllCellInfo();
2454:             for (Phone phone : PhoneFactory.getPhones()) {
2456:                         CMD_GET_ALL_CELL_INFO, null, phone, workSource);
2507:         final Phone phone = getPhoneFromSubId(subId);
2508:         if (phone == null) throw new IllegalArgumentException("Invalid Subscription Id: " + subId);
2510:         sendRequestAsync(CMD_REQUEST_CELL_INFO_UPDATE, cb, phone, workSource);
2528:         Phone phone = PhoneFactory.getPhone(slotIndex);
2529:         if (phone == null) {
2532:         int subId = phone.getSubId();
2540:             return phone.getImei();
2548:         Phone phone = PhoneFactory.getPhone(slotIndex);
2550:         if (phone != null) {
2551:             String imei = phone.getImei();
2559:         Phone phone = PhoneFactory.getPhone(slotIndex);
2560:         if (phone == null) {
2564:         int subId = phone.getSubId();
2572:             return phone.getMeid();
2580:         Phone phone = PhoneFactory.getPhone(slotIndex);
2582:         if (phone != null) {
2583:             String meid = phone.getMeid();
2592:         Phone phone = PhoneFactory.getPhone(slotIndex);
2593:         if (phone == null) {
2596:         int subId = phone.getSubId();
2605:             return phone.getDeviceSvn();
2615:             final Phone phone = getPhone(subId);
2616:             return phone == null ? TelephonyManager.UNKNOWN_CARRIER_ID : phone.getCarrierId();
2626:             final Phone phone = getPhone(subId);
2627:             return phone == null ? null : phone.getCarrierName();
2637:             final Phone phone = getPhone(subId);
2638:             return phone == null ? TelephonyManager.UNKNOWN_CARRIER_ID
2639:                     : phone.getSpecificCarrierId();
2649:             final Phone phone = getPhone(subId);
2650:             return phone == null ? null : phone.getSpecificCarrierName();
2661:         final Phone phone = PhoneFactory.getPhone(slotIndex);
2662:         if (phone == null) {
2667:             return CarrierResolver.getCarrierIdFromMccMnc(phone.getContext(), mccmnc);
2678:      * Make sure the caller has the MODIFY_PHONE_STATE permission.
2683:         mApp.enforceCallingOrSelfPermission(android.Manifest.permission.MODIFY_PHONE_STATE, null);
2703:      * Make sure the caller has the CALL_PHONE permission.
2708:         mApp.enforceCallingOrSelfPermission(android.Manifest.permission.CALL_PHONE, null);
2744:             final Phone phone = PhoneFactory.getPhone(slotIndex);
2745:             if (phone == null) {
2746:                 return PhoneConstants.PHONE_TYPE_NONE;
2748:                 return phone.getPhoneType();
2775:             final Phone phone = getPhone(subId);
2776:             if (phone != null) {
2777:                 return phone.getCdmaEriIconIndex();
2808:             final Phone phone = getPhone(subId);
2809:             if (phone != null) {
2810:                 return phone.getCdmaEriIconMode();
2839:             final Phone phone = getPhone(subId);
2840:             if (phone != null) {
2841:                 return phone.getCdmaEriText();
2860:             final Phone phone = getPhone(subId);
2861:             if (phone != null && phone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA) {
2862:                 return phone.getLine1Number();
2864:                 loge("getCdmaMdn: no phone found. Invalid subId: " + subId);
2882:             final Phone phone = getPhone(subId);
2883:             if (phone != null && phone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA) {
2884:                 return phone.getCdmaMin();
2896:         if (mApp.checkCallingOrSelfPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
2898:             throw new SecurityException("Caller must hold the MODIFY_PHONE_STATE permission");
3062:             final Phone phone = getPhone(subId);
3063:             if (phone != null) {
3064:                 phone.setVoiceActivationState(activationState);
3083:             final Phone phone = getPhone(subId);
3084:             if (phone != null) {
3085:                 phone.setDataActivationState(activationState);
3101:         final Phone phone = getPhone(subId);
3104:             if (phone != null) {
3105:                 return phone.getVoiceActivationState();
3121:         final Phone phone = getPhone(subId);
3124:             if (phone != null) {
3125:                 return phone.getDataActivationState();
3147:             final Phone phone = getPhone(subId);
3148:             if (phone != null) {
3149:                 return phone.getVoiceMessageCount();
3166:             final Phone phone = getPhone(subId);
3167:             return (phone == null ? false : phone.isConcurrentVoiceAndDataAllowed());
3180:         final Phone defaultPhone = getDefaultPhone();
3218:             for (Phone phone : PhoneFactory.getPhones()) {
3219:                 if (phone.isInEmergencySmsMode()) {
3230:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3257:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3295:             Phone phone = getPhone(subId);
3296:             if (phone == null) {
3301:             phone.getImsRegistrationState(regState -> {
3328:             Phone phone = getPhone(subId);
3329:             if (phone == null) {
3334:             phone.getImsRegistrationTech(regTech -> {
3353:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3379:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3430:             Phone phone = getPhone(subId);
3431:             if (phone == null) return false;
3432:             return phone.isImsCapabilityAvailable(capability, regTech);
3480:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3517:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3551:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3586:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3638:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3720:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3787:         Phone phone = getPhone(subId);
3788:         if (phone == null) {
3789:             loge("phone instance null for subid " + subId);
3793:             if (!doesImsCapabilityRequireProvisioning(phone.getContext(), subId, capability)) {
3797:             if (!doesRcsCapabilityRequireProvisioning(phone.getContext(), subId, capability)) {
4231:             final Phone phone = getPhone(subId);
4232:             if (phone != null) {
4233:                 return phone.getServiceState().getDataNetworkType();
4265:             final Phone phone = getPhone(subId);
4266:             if (phone != null) {
4267:                 return phone.getServiceState().getDataNetworkType();
4290:             final Phone phone = getPhone(subId);
4291:             if (phone != null) {
4292:                 return phone.getServiceState().getVoiceNetworkType();
4317:             final Phone phone = PhoneFactory.getPhone(slotIndex);
4318:             if (phone != null) {
4319:                 return phone.getIccCard().hasIccCard();
4334:      * @return {@link Phone#LTE_ON_CDMA_UNKNOWN}, {@link Phone#LTE_ON_CDMA_FALSE}
4335:      * or {@link Phone#LTE_ON_CDMA_TRUE}
4354:             final Phone phone = getPhone(subId);
4355:             if (phone == null) {
4358:                 return phone.getLteOnCdmaMode();
4422:                     + " does not correspond to an active phone");
4453:     private IccOpenLogicalChannelResponse iccOpenLogicalChannelWithPermission(Phone phone,
4470:                     CMD_OPEN_CHANNEL, new Pair<String, Integer>(aid, p2), phone,
4495:     private boolean iccCloseLogicalChannelWithPermission(Phone phone, int channel) {
4501:             Boolean success = (Boolean) sendRequest(CMD_CLOSE_CHANNEL, channel, phone,
4538:     private String iccTransmitApduLogicalChannelWithPermission(Phone phone, int channel, int cla,
4547:                     new IccAPDUArgument(channel, cla, command, p1, p2, p3, data), phone,
4594:     private String iccTransmitApduBasicChannelWithPermission(Phone phone, String callingPackage,
4612:                     new IccAPDUArgument(0, cla, command, p1, p2, p3, data), phone,
4846:         Phone phone = PhoneFactory.getPhone(slotIndex);
4847:         if (phone != null) {
4849:                     mApp, phone.getSubId(), "resetModemConfig");
4872:         Phone phone = PhoneFactory.getPhone(slotIndex);
4873:         if (phone != null) {
4875:                     mApp, phone.getSubId(), "rebootModem");
4891:         final Phone defaultPhone = getDefaultPhone();
5432:         final Phone defaultPhone = getDefaultPhone();
5550:         final Phone phone = getPhone(subId);
5552:             if (phone != null) {
5553:                 return phone.hasMatchedTetherApnSetting();
5577:             Phone phone = PhoneFactory.getPhone(phoneId);
5578:             if (phone != null) {
5580:                 phone.getDataEnabledSettings().setUserDataEnabled(enable);
5582:                 loge("setUserDataEnabled: no phone found. Invalid subId=" + subId);
5600:         final Phone phone = getPhone(subId);
5602:             if (phone != null) {
5607:                 phone.setAlwaysReportSignalStrength(isEnable);
5609:                 loge("setAlwaysReportSignalStrength: no phone found for subId="
5638:      * Accepts either ACCESS_NETWORK_STATE, MODIFY_PHONE_STATE or carrier privileges.
5656:             Phone phone = PhoneFactory.getPhone(phoneId);
5657:             if (phone != null) {
5658:                 boolean retVal = phone.isUserDataEnabled();
5662:                 if (DBG) loge("isUserDataEnabled: no phone subId=" + subId + " retVal=false");
5685:             Phone phone = PhoneFactory.getPhone(phoneId);
5686:             if (phone != null) {
5687:                 boolean retVal = phone.getDataEnabledSettings().isDataEnabled();
5691:                 if (DBG) loge("isDataEnabled: no phone subId=" + subId + " retVal=false");
5700:             Phone phone) {
5706:         PackageManager pkgMgr = phone.getContext().getPackageManager();
5711:             SubscriptionInfo subInfo = subController.getSubscriptionInfo(phone.getSubId());
5713:                     phone.getContext().getSystemService(Context.TELEPHONY_SUBSCRIPTION_SERVICE);
5725:     private int getCarrierPrivilegeStatusFromCarrierConfigRules(int privilegeFromSim, Phone phone,
5734:             SubscriptionInfo subInfo = subController.getSubscriptionInfo(phone.getSubId());
5736:                     phone.getContext().getSystemService(Context.TELEPHONY_SUBSCRIPTION_SERVICE);
5746:         final Phone phone = getPhone(subId);
5747:         if (phone == null) {
5751:         UiccCard card = UiccController.getInstance().getUiccCard(phone.getPhoneId());
5759:                 phone.getContext().getPackageManager()), Binder.getCallingUid(), phone);
5765:         final Phone phone = getPhone(subId);
5766:         if (phone == null) {
5771:                 UiccController.getInstance().getUiccProfileForPhone(phone.getPhoneId());
5778:                         phone.getContext().getPackageManager(), uid), uid, phone);
5883:         final Phone phone = getPhone(subId);
5884:         UiccCard card = phone == null ? null : phone.getUiccCard();
5906:             final Phone phone = getPhone(subId);
5907:             if (phone == null) {
5910:             final String subscriberId = phone.getSubscriberId();
6133:             final Phone phone = getPhone(subId);
6134:             return phone == null ? false : phone.setOperatorBrandOverride(brand);
6149:             final Phone phone = getPhone(subId);
6150:             if (phone == null) {
6153:             return phone.setRoamingOverride(gsmRoamingList, gsmNonRoamingList, cdmaRoamingList,
6204:         Phone phone = PhoneFactory.getPhone(phoneId);
6206:         if (phone == null) {
6213:                             mApp, phone.getSubId(), "getRadioAccessFamily");
6223:         final Phone defaultPhone = getDefaultPhone();
6237:         final Phone defaultPhone = getDefaultPhone();
6291:                     .getBoolean(CarrierConfigManager.KEY_WORLD_PHONE_BOOL);
6322:         final Phone phone = getPhone(subscriptionId);
6323:         if (phone == null) {
6324:             loge("isRttSupported: no Phone found. Invalid subId:" + subscriptionId);
6331:                     phone.getContext().getResources().getBoolean(R.bool.config_support_rtt);
6364:      * Returns the unique device ID of phone, for example, the IMEI for
6368:      *   {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
6372:         final Phone phone = PhoneFactory.getPhone(0);
6373:         if (phone == null) {
6376:         int subId = phone.getSubId();
6384:             return phone.getDeviceId();
6397:         Phone phone = getPhone(subId);
6398:         if (phone != null) {
6399:             return phone.isImsRegistered();
6420:             throw new SecurityException("Requires READ_PHONE_STATE permission.");
6434:             Phone phone = getPhone(subscriptionId);
6435:             if (phone == null) {
6438:             return PhoneUtils.makePstnPhoneAccountHandle(phone);
6450:             Phone phone = getPhone(subId);
6451:             if (phone != null) {
6452:                 return phone.isWifiCallingEnabled();
6467:             Phone phone = getPhone(subId);
6468:             if (phone != null) {
6469:                 return phone.isVideoEnabled();
6485:             Phone phone = getPhone(subId);
6486:             if (phone != null) {
6487:                 return phone.getImsRegistrationTech();
6545:         final Phone phone = getPhone(subId);
6546:         if (phone == null) {
6553:                     phone.getContext().getOpPackageName(), null);
6562:             final Locale localeFromDefaultSim = phone.getLocaleFromSimAndCarrierPrefs();
6690:             final Phone phone = getPhone(subId);
6691:             if (phone == null) {
6695:             ServiceState ss = phone.getServiceState();
6708:      * Returns the URI for the per-account voicemail ringtone set in Phone settings.
6719:             Phone phone = PhoneUtils.getPhoneForPhoneAccountHandle(accountHandle);
6720:             if (phone == null) {
6721:                 phone = getDefaultPhone();
6724:             return VoicemailNotificationSettingsUtil.getRingtoneUri(phone.getContext());
6734:      * has permission {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}.
6744:         final Phone defaultPhone = getDefaultPhone();
6755:             Phone phone = PhoneUtils.getPhoneForPhoneAccountHandle(phoneAccountHandle);
6756:             if (phone == null) {
6757:                 phone = defaultPhone;
6759:             VoicemailNotificationSettingsUtil.setRingtoneUri(phone.getContext(), uri);
6766:      * Returns whether vibration is set for voicemail notification in Phone settings.
6776:             Phone phone = PhoneUtils.getPhoneForPhoneAccountHandle(accountHandle);
6777:             if (phone == null) {
6778:                 phone = getDefaultPhone();
6781:             return VoicemailNotificationSettingsUtil.isVibrationEnabled(phone.getContext());
6791:      * has permission {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}.
6801:         final Phone defaultPhone = getDefaultPhone();
6812:             Phone phone = PhoneUtils.getPhoneForPhoneAccountHandle(phoneAccountHandle);
6813:             if (phone == null) {
6814:                 phone = defaultPhone;
6816:             VoicemailNotificationSettingsUtil.setVibrationEnabled(phone.getContext(), enabled);
6823:      * Make sure either called from same process as self (phone) or IPC caller has read privilege.
6828:         mApp.enforceCallingOrSelfPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE,
6833:      * Make sure either called from same process as self (phone) or IPC caller has send SMS
6876:         Phone phone = getPhone(subId);
6880:             if (phone == null) {
6885:                 aid = UiccController.getInstance().getUiccCard(phone.getPhoneId())
6905:         Phone phone = getPhone(subId);
6909:             if (phone == null) {
6914:                 esn = phone.getEsn();
6933:         Phone phone = getPhone(subId);
6937:             if (phone == null) {
6942:                 cdmaPrlVersion = phone.getCdmaPrlVersion();
7036:         final Phone phone = getPhone(subId);
7039:         if (phone == null) {
7044:             phone.carrierActionSetMeteredApnsEnabled(enabled);
7061:         final Phone phone = getPhone(subId);
7064:         if (phone == null) {
7069:             phone.carrierActionSetRadioEnabled(enabled);
7089:         final Phone phone = getPhone(subId);
7092:         if (phone == null) {
7097:             phone.carrierActionReportDefaultNetworkStatus(report);
7113:         final Phone phone = getPhone(subId);
7114:         if (phone == null) {
7119:             phone.carrierActionResetAll();
7126:      * Called when "adb shell dumpsys phone" is invoked. Dump is also automatically invoked when a
7133:             writer.println("Permission Denial: can't dump Phone from pid="
7163:             Phone phone = getPhone(subId);
7164:             if (phone != null) {
7165:                 phone.getDataEnabledSettings().setPolicyDataEnabled(enabled);
7184:         Phone phone = getPhone(subId);
7188:             if (phone != null) {
7189:                 return phone.getClientRequestStats();
7216:         Phone phone = PhoneFactory.getPhone(slotIndex);
7222:             if (phone != null) {
7223:                 phone.setSimPowerState(state, workSource);
7245:      * Check if phone is in emergency callback mode
7246:      * @return true if phone is in emergency callback mode
7252:         final Phone phone = getPhone(subId);
7256:             if (phone != null) {
7257:                 return phone.isInEcm();
7277:             Phone p = getPhone(subId);
7297:         Phone phone = PhoneFactory.getPhone(slotIndex);
7298:         if (phone != null) {
7299:             if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp, phone.getSubId(),
7306:                 return phone.getRadioPowerState();
7319:      * {@link android.Manifest.permission#READ_PHONE_STATE} or that the calling app has carrier
7334:             Phone phone = getPhone(subId);
7335:             isEnabled =  phone != null ? phone.getDataRoamingEnabled() : false;
7350:      * {@link android.Manifest.permission#MODIFY_PHONE_STATE} or that the calling app has carrier
7363:             Phone phone = getPhone(subId);
7364:             if (phone != null) {
7365:                 phone.setDataRoamingEnabled(isEnabled);
7381:             Phone phone = getPhone(subId);
7382:             if (phone != null) {
7383:                 isAllowed = phone.isCspPlmnEnabled();
7407:             // even without READ_PRIVILEGED_PHONE_STATE, we allow the call to continue if the caller
7544:      * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}.
7553:             Phone phone = getPhone(subId);
7554:             if (phone == null) {
7557:             UiccCard uiccCard = phone.getUiccCard();
7594:      * not set, return {@link Phone#PREFERRED_NT_MODE}.
7602:         return Phone.PREFERRED_NT_MODE;
7612:             final Phone phone = getPhone(subId);
7613:             if (phone == null) {
7617:             phone.setCarrierTestOverride(mccmnc, imsi, iccid, gid1, gid2, plmn, spn,
7630:             final Phone phone = getPhone(subId);
7631:             if (phone == null) {
7635:             return phone.getCarrierIdListVersion();
7704:             throw new SecurityException("Requires READ_PHONE_STATE permission.");
7709:             for (Phone phone: PhoneFactory.getPhones()) {
7710:                 if (phone.getEmergencyNumberTracker() != null
7711:                         && phone.getEmergencyNumberTracker().getEmergencyNumberList() != null) {
7713:                             phone.getSubId(),
7714:                             phone.getEmergencyNumberTracker().getEmergencyNumberList());
7725:         final Phone defaultPhone = getDefaultPhone();
7733:             for (Phone phone: PhoneFactory.getPhones()) {
7734:                 if (phone.getEmergencyNumberTracker() != null
7735:                         && phone.getEmergencyNumberTracker() != null) {
7736:                     if (phone.getEmergencyNumberTracker().isEmergencyNumber(
7758:             for (Phone phone: PhoneFactory.getPhones()) {
7759:                 EmergencyNumberTracker tracker = phone.getEmergencyNumberTracker();
7780:             for (Phone phone: PhoneFactory.getPhones()) {
7781:                 EmergencyNumberTracker tracker = phone.getEmergencyNumberTracker();
7800:             final Phone phone = getPhone(subId);
7801:             if (phone == null) {
7805:             return phone.getEmergencyNumberDbVersion();
7817:             for (Phone phone: PhoneFactory.getPhones()) {
7818:                 EmergencyNumberTracker tracker = phone.getEmergencyNumberTracker();
7834:             for (Phone phone: PhoneFactory.getPhones()) {
7835:                 EmergencyNumberTracker tracker = phone.getEmergencyNumberTracker();
7851:             for (Phone phone: PhoneFactory.getPhones()) {
7852:                 EmergencyNumberTracker tracker = phone.getEmergencyNumberTracker();
7865:         Phone phone = getPhone(subId);
7866:         if (phone == null) {
7872:                     .getUiccProfileForPhone(phone.getPhoneId());
7891:             Phone phone = PhoneFactory.getPhone(slotIndex);
7892:             if (phone == null) {
7895:                 return (Boolean) sendRequest(CMD_REQUEST_ENABLE_MODEM, enable, phone, null);
7908:         Phone phone = PhoneFactory.getPhone(slotIndex);
7909:         if (phone == null) return false;
7912:                 mApp, phone.getSubId(), callingPackage, callingFeatureId,
7914:             throw new SecurityException("Requires READ_PHONE_STATE permission.");
7920:                 return mPhoneConfigurationManager.getPhoneStatusFromCache(phone.getPhoneId());
7922:                 return (Boolean) sendRequest(CMD_GET_MODEM_STATUS, null, phone, null);
7990:      * Note: Switch from multi-sim to single-sim is only possible with MODIFY_PHONE_STATE
7991:      * permission, but the other way around is possible with either MODIFY_PHONE_STATE
8020:         Phone phone = getPhone(subId);
8021:         if (phone == null) {
8026:             UiccCard uiccCard = phone.getUiccCard();
8096:         Phone phone = getDefaultPhone();
8097:         if (phone == null) return -1;
8098:         HalVersion hv = phone.getHalVersion();
8128:         enforceReadPrivilegedPermission("Needs READ_PRIVILEGED_PHONE_STATE for "
8134:             Phone phone = getPhone(subId);
8135:             if (phone == null) return false;
8137:             boolean isMetered = ApnSettingUtils.isMeteredApnType(apnType, phone);
8138:             return !isMetered || phone.getDataEnabledSettings().isDataEnabled(apnType);
8151:             Phone phone = getPhone(subId);
8152:             if (phone == null) return true; // By default return true.
8154:             return ApnSettingUtils.isMeteredApnType(apnType, phone);
8166:             Phone phone = getPhone(subscriptionId);
8167:             if (phone == null) {
8187:             sendRequestAsync(CMD_SET_SYSTEM_SELECTION_CHANNELS, argument, phone, null);
8257:             Phone phone = getPhone(subId);
8258:             if (phone == null) return false;
8260:             return phone.getDataEnabledSettings().setAllowDataDuringVoiceCall(allow);
8273:             Phone phone = getPhone(subId);
8274:             if (phone == null) return false;
8276:             return phone.getDataEnabledSettings().isDataAllowedInVoiceCall();
8289:             Phone phone = getPhone(subId);
8290:             if (phone == null) return false;
8292:             return phone.getDataEnabledSettings().setAlwaysAllowMmsData(alwaysAllow);
8310:             for (Phone phone : PhoneFactory.getPhones()) {
8311:                 Phone defaultPhone = phone.getImsPhone();
8312:                 if (defaultPhone != null && defaultPhone.getPhoneType() == PHONE_TYPE_IMS) {
8357:             Phone phone = getPhone(subId);
8358:             if (phone != null && phone.getIccCard() != null) {
8359:                 return phone.getIccCard().getIccLockEnabled();
8379:         Phone phone = getPhone(subId);
8380:         if (phone == null) {
8387:                     new Pair<Boolean, String>(enabled, password), phone, null);
8409:         Phone phone = getPhone(subId);
8410:         if (phone == null) {
8417:                     new Pair<String, String>(oldPassword, newPassword), phone, null);
22: import static com.android.internal.telephony.PhoneConstants.SUBSCRIPTION_KEY;
65: import android.telecom.PhoneAccount;
66: import android.telecom.PhoneAccountHandle;
85: import android.telephony.PhoneCapability;
86: import android.telephony.PhoneNumberRange;
144: import com.android.internal.telephony.PhoneConfigurationManager;
145: import com.android.internal.telephony.PhoneConstantConversions;
146: import com.android.internal.telephony.PhoneConstants;
147: import com.android.internal.telephony.PhoneFactory;
160: import com.android.internal.telephony.imsphone.ImsPhone;
161: import com.android.internal.telephony.imsphone.ImsPhoneCallTracker;
200:     private static final String LOG_TAG = "PhoneInterfaceManager";
201:     private static final boolean DBG = (PhoneGlobals.DBG_LEVEL >= 2);
298:     private static PhoneInterfaceManager sInstance;
300:     private PhoneGlobals mApp;
691:                     defaultPhone.nvReadItem((Integer) request.argument, onCompleted,
718:                     defaultPhone.nvWriteItem(idValue.first, idValue.second, onCompleted,
729:                     defaultPhone.nvWriteCdmaPrl((byte[]) request.argument, onCompleted);
739:                     defaultPhone.resetModemConfig(onCompleted);
785:                     defaultPhone.invokeOemRilRequestRaw((byte[]) request.argument, onCompleted);
1023:                     if (defaultPhone != null) {
1024:                         defaultPhone.getModemActivityInfo(onCompleted, request.workSource);
1087:                     defaultPhone.setAllowedCarriers(argument, onCompleted, request.workSource);
1115:                     defaultPhone.getAllowedCarriers(onCompleted, request.workSource);
1321:                     defaultPhone.rebootModem(onCompleted);
1331:                     PhoneConfigurationManager.getInstance()
1341:                         mPhoneConfigurationManager.addToPhoneStatusCache(phoneId, msg.arg1 == 1);
1352:                     PhoneConfigurationManager.getInstance()
1440:                     defaultPhone.eraseModemConfig(onCompleted);
1625:      * Initialize the singleton PhoneInterfaceManager instance.
1626:      * This is only done once, at startup, from PhoneApp.onCreate().
1628:     /* package */ static PhoneInterfaceManager init(PhoneGlobals app) {
1629:         synchronized (PhoneInterfaceManager.class) {
1631:                 sInstance = new PhoneInterfaceManager(app);
1643:         mCM = PhoneGlobals.getInstance().mCM;
1644:         mImsResolver = PhoneGlobals.getInstance().getImsResolver();
1652:         mPhoneConfigurationManager = PhoneConfigurationManager.getInstance();
1659:         return (thePhone != null) ? thePhone : PhoneFactory.getDefaultPhone();
1678:                 ? getDefaultPhone() : getPhone(subId);
1689:         return PhoneFactory.getPhone(mSubscriptionController.getPhoneId(subId));
1707:         PackageManager pm = getDefaultPhone().getContext().getPackageManager();
1734:             PhoneConstants.State state = mCM.getState(subId);
1735:             if (state != PhoneConstants.State.OFFHOOK && state != PhoneConstants.State.RINGING) {
1794:         return (resultArray[0] == PhoneConstants.PIN_RESULT_SUCCESS) ? true : false;
1799:         return (resultArray[0] == PhoneConstants.PIN_RESULT_SUCCESS) ? true : false;
1807:             final UnlockSim checkSimPin = new UnlockSim(getPhone(subId).getIccCard());
1820:             final UnlockSim checkSimPuk = new UnlockSim(getPhone(subId).getIccCard());
1837:         private int mResult = PhoneConstants.PIN_GENERAL_FAILURE;
1867:                                             mResult = PhoneConstants.PIN_PASSWORD_INCORRECT;
1872:                                             mResult = PhoneConstants.PIN_OPERATION_ABORTED;
1874:                                             mResult = PhoneConstants.PIN_GENERAL_FAILURE;
1877:                                         mResult = PhoneConstants.PIN_RESULT_SUCCESS;
2052:             logv(TelephonyManager.getDefault().getPhoneCount() + " Phones are shutdown.");
2087:             if (defaultPhone != null) {
2088:                 defaultPhone.setRadioPower(turnOn);
2232:                 return PhoneConstantConversions.convertDataState(
2233:                         PhoneConstants.DataState.DISCONNECTED);
2305:             final int subId = mSubscriptionController.getSubIdUsingPhoneId(phoneId);
2520:             getDefaultPhone().setCellInfoListRate(rateInMillis, workSource);
2724:         Log.d(LOG_TAG, "[PhoneIntfMgr] " + msg);
2728:         Log.v(LOG_TAG, "[PhoneIntfMgr] " + msg);
2732:         Log.e(LOG_TAG, "[PhoneIntfMgr] " + msg);
2894:     public void requestNumberVerification(PhoneNumberRange range, long timeoutMillis,
2923:             return getDefaultPhone().needsOtaServiceProvisioning();
2958:             PhoneAccountHandle phoneAccountHandle = PhoneAccountHandleConverter.fromSubId(subId);
2959:             if (phoneAccountHandle == null) {
2962:             return VisualVoicemailSettingsUtil.dump(mApp, phoneAccountHandle);
3047:         SmsController smsController = PhoneFactory.getSmsController();
3182:         TelecomManager tm = defaultPhone.getContext().getSystemService(TelecomManager.class);
3191:             defaultPhone.sendDialerSpecialCode(inputCode);
3246:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3270:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone.
3366:         // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3393:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone.
3409:         // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3488:         // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3506:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3526:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3541:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3560:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3576:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3595:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3611:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3627:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3647:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3663:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3678:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3694:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3710:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3729:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3748:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3766:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3811:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3841:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3874:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3933:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
4102:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
4127:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
4153:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
4179:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
4349:             return PhoneConstants.LTE_ON_CDMA_UNKNOWN;
4356:                 return PhoneConstants.LTE_ON_CDMA_UNKNOWN;
4419:         int phoneId = UiccController.getInstance().getPhoneIdFromSlotId(slotIndex);
4420:         if (phoneId == -1) {
4424:         return PhoneFactory.getPhone(phoneId);
4459:                 ComponentInfo bestComponent = EuiccConnector.findBestComponent(getDefaultPhone()
4601:                 ComponentInfo bestComponent = EuiccConnector.findBestComponent(getDefaultPhone()
4892:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp, defaultPhone.getSubId(),
4899:             return defaultPhone.getPcscfAddress(apnType);
5166:             getDefaultPhone().setImsRegistrationState(registered);
5372:                     request, messenger, binder, getPhone(subId),
5433:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp, defaultPhone.getSubId(),
5441:             return PhoneFactory.calculatePreferredNetworkType(defaultPhone.getContext(), 0);
5575:             int phoneId = mSubscriptionController.getPhoneId(subId);
5576:             if (DBG) log("setUserDataEnabled: subId=" + subId + " phoneId=" + phoneId);
5654:             int phoneId = mSubscriptionController.getPhoneId(subId);
5655:             if (DBG) log("isUserDataEnabled: subId=" + subId + " phoneId=" + phoneId);
5683:             int phoneId = mSubscriptionController.getPhoneId(subId);
5684:             if (DBG) log("isDataEnabled: subId=" + subId + " phoneId=" + phoneId);
5787:         int phoneId = SubscriptionManager.getPhoneId(subId);
5788:         UiccCard card = UiccController.getInstance().getUiccCard(phoneId);
5795:             getPhone(phoneId), pkgName);
5812:                 getPhone(i), pkgName);
5823:         if (!SubscriptionManager.isValidPhoneId(phoneId)) {
5824:             loge("phoneId " + phoneId + " is not valid.");
5827:         UiccCard card = UiccController.getInstance().getUiccCard(phoneId);
5829:             loge("getCarrierPackageNamesForIntentAndPhone: No UICC");
5836:     public List<String> getPackagesWithCarrierPrivileges(int phoneId) {
5840:         UiccCard card = UiccController.getInstance().getUiccCard(phoneId);
6203:     public int getRadioAccessFamily(int phoneId, String callingPackage) {
6214:             raf = ProxyController.getInstance().getRadioAccessFamily(phoneId);
6228:             ImsManager.getInstance(defaultPhone.getContext(),
6229:                     defaultPhone.getPhoneId()).setVtSetting(enable);
6238:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp, defaultPhone.getSubId(),
6250:                     ImsManager.getInstance(defaultPhone.getContext(), defaultPhone.getPhoneId());
6365:      * GSM and the MEID for CDMA phones. Return null if device ID is not available.
6409:             return PhoneUtils.getSubIdForPhoneAccount(phoneAccount);
6417:             PhoneAccountHandle phoneAccountHandle, String callingPackage, String callingFeatureId) {
6424:             return PhoneUtils.getSubIdForPhoneAccountHandle(phoneAccountHandle);
6518:             cleanUpSmsRawTable(getDefaultPhone().getContext());
6529:               sendEraseModemConfig(getDefaultPhone());
6710:      * @param accountHandle The handle for the {@link PhoneAccount} for which to retrieve the
6713:      * PhoneAccount.
6716:     public Uri getVoicemailRingtoneUri(PhoneAccountHandle accountHandle) {
6736:      * @param phoneAccountHandle The handle for the {@link PhoneAccount} for which to set the
6739:      * PhoneAccount.
6743:             PhoneAccountHandle phoneAccountHandle, Uri uri) {
6746:         TelecomManager tm = defaultPhone.getContext().getSystemService(TelecomManager.class);
6749:                     mApp, PhoneUtils.getSubIdForPhoneAccountHandle(phoneAccountHandle),
6768:      * @param accountHandle The handle for the {@link PhoneAccount} for which to retrieve the
6770:      * @return {@code true} if the vibration is set for this PhoneAccount, {@code false} otherwise.
6773:     public boolean isVoicemailVibrationEnabled(PhoneAccountHandle accountHandle) {
6793:      * @param phoneAccountHandle The handle for the {@link PhoneAccount} for which to set the
6796:      * specific PhoneAccount.
6800:             PhoneAccountHandle phoneAccountHandle, boolean enabled) {
6803:         TelecomManager tm = defaultPhone.getContext().getSystemService(TelecomManager.class);
6806:                     mApp, PhoneUtils.getSubIdForPhoneAccountHandle(phoneAccountHandle),
7147:         (new TelephonyShellCommand(this, getDefaultPhone().getContext()))
7409:             if (checkCarrierPrivilegesForPackageAnyPhone(callingPackage)
7598:         int phoneId = mSubscriptionController.getPhoneId(subId);
7599:         if (phoneId >= 0 && phoneId < list.size() && list.get(phoneId) != null) {
7600:             return list.get(phoneId);
7729:                             mApp, defaultPhone.getSubId(), "isEmergencyNumber(Potential)");
7947:                 getDefaultPhone().getSubId(), callingPackage, callingFeatureId,
7970:         PhoneCapability staticCapability =
8076:             int phoneCount = TelephonyManager.getDefault().getPhoneCount();
8078:             int[] logicalSlotsMapping = new int[phoneCount];
8210:         SmsPermissions permissions = new SmsPermissions(getDefaultPhone(), mApp,
8231:             return SubscriptionManager.getResourcesForSubId(getDefaultPhone().getContext(), subId)
8243:             return SubscriptionManager.getResourcesForSubId(getDefaultPhone().getContext(), subId)
8313:                     ImsPhone imsPhone = (ImsPhone) defaultPhone;
8315:                             (ImsPhoneCallTracker) imsPhone.getCallTracker();
8317:                     Rlog.i(LOG_TAG, "setCepEnabled isCepEnabled=" + isCepEnabled + ", for imsPhone "
8318:                             + imsPhone.getMsisdn());
133: import com.android.internal.telephony.DefaultPhoneNotifier;
474:                             getPhoneFromRequest(request).handlePinMmi((String) request.argument)
749:                     getPhoneFromRequest(request).getPreferredNetworkType(onCompleted);
775:                     getPhoneFromRequest(request).setPreferredNetworkType(networkType, onCompleted);
799:                     getPhoneFromRequest(request).setVoiceMailNumber(tagNum.first, tagNum.second,
811:                     getPhoneFromRequest(request).setNetworkSelectionModeAutomatic(onCompleted);
821:                     getPhoneFromRequest(request).getAvailableNetworks(onCompleted);
828:                     getPhoneFromRequest(request).getCallForwardingOption(
885:                     getPhoneFromRequest(request).setCallForwardingOption(
907:                     getPhoneFromRequest(request).getCallWaiting(onCompleted);
951:                     getPhoneFromRequest(request).setCallWaiting(isEnable, onCompleted);
1003:                     getPhoneFromRequest(request).selectNetworkManually(selArg.operatorInfo,
1198:                     getPhoneFromRequest(request).getNetworkSelectionMode(onCompleted);
1219:                     getPhoneFromRequest(request).queryCdmaRoamingPreference(onCompleted);
1235:                     getPhoneFromRequest(request).setCdmaRoamingPreference(mode, onCompleted);
1247:                     getPhoneFromRequest(request).setCdmaSubscription(subscriptionMode, onCompleted);
1362:                         mPhoneConfigurationManager.addToPhoneStatusCache(id,
1450:                     getPhoneFromRequest(request).getIccCard().changeIccLockPassword(
1468:                     getPhoneFromRequest(request).getIccCard().setIccLockEnabled(
1672:             return getPhoneFromSubId(request.subId);
1973:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
2048:             for (int i = 0; i < TelephonyManager.getDefault().getPhoneCount(); i++) {
2065:             for (int i = 0; i < TelephonyManager.getDefault().getPhoneCount(); i++) {
2067:                 shutdownRadioUsingPhoneId(i);
2597:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
2737:         return getActivePhoneTypeForSlot(getSlotForDefaultSubscription());
2767:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
2800:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
2831:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
2972:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
3140:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
3200:                     .enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3237:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3263:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3320:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3360:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3385:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3485:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3522:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3556:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3591:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3643:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3725:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3807:         checkModifyPhoneStatePermission(subId, "setRcsProvisioningStatusForCapability");
3871:         checkModifyPhoneStatePermission(subId, "setImsProvisioningStatusForCapability");
4223:                 && !TelephonyPermissions.checkCallingOrSelfReadPhoneStateNoThrow(
4257:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
4282:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
4374:         return mSubscriptionController.getPhoneId(getDefaultSubscription());
4436:         return iccOpenLogicalChannelWithPermission(getPhoneFromSubId(subId), callingPackage, aid,
4449:         return iccOpenLogicalChannelWithPermission(getPhoneFromSlotIdOrThrowException(slotIndex),
4484:         return iccCloseLogicalChannelWithPermission(getPhoneFromSubId(subId), channel);
4491:         return iccCloseLogicalChannelWithPermission(getPhoneFromSlotIdOrThrowException(slotIndex),
4520:         return iccTransmitApduLogicalChannelWithPermission(getPhoneFromSubId(subId), channel, cla,
4534:                 getPhoneFromSlotIdOrThrowException(slotIndex), channel, cla, command, p1, p2, p3,
4573:         return iccTransmitApduBasicChannelWithPermission(getPhoneFromSubId(subId), callingPackage,
4589:                 getPhoneFromSlotIdOrThrowException(slotIndex), callingPackage, cla, command, p1,
4674:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
4712:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp, subId, callingPackage,
5109:                 .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
5456:                 .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
5505:                 .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
5803:         for (int i = 0; i < TelephonyManager.getDefault().getPhoneCount(); i++) {
5867:         enforceReadPrivilegedPermission("getPackagesWithCarrierPrivilegesForAllPhones");
5873:             for (int i = 0; i < TelephonyManager.getDefault().getPhoneCount(); i++) {
5953:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneNumber(
5980:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
6003:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
6212:                     .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
6262:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
6281:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
6418:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp, getDefaultSubscription(),
6419:                 callingPackage, callingFeatureId, "getSubIdForPhoneAccountHandle")) {
6654:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
7180:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
7337:             TelephonyPermissions.enforeceCallingOrSelfReadPhoneStatePermissionOrCarrierPrivilege(
7375:                 .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
7508:                         slot.getPhoneId(),
7644:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
7652:             return mPhoneConfigurationManager.getNumberOfModemsWithSimultaneousDataConnections();
7661:                 .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
7701:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
7728:                     .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
7911:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
7946:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp,
7971:                 mPhoneConfigurationManager.getStaticPhoneCapability();
8011:             mPhoneConfigurationManager.switchMultiSimConfig(numOfSims);
8051:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
8058:             return mPhoneConfigurationManager.isRebootRequiredForModemConfigChange();
8067:         metrics.updateEnabledModemBitmap((1 << TelephonyManager.from(mApp).getPhoneCount()) - 1);
8081:                 if (SubscriptionManager.isValidPhoneId(slotInfos[i].getLogicalSlotIdx())) {
8196:                 SubscriptionManager.getPhoneId(subId), UiccController.APP_FAM_3GPP);
8314:                     ImsPhoneCallTracker imsPhoneCallTracker =
8316:                     imsPhoneCallTracker.setConferenceEventPackageEnabled(isCepEnabled);
android.googlesource.com/platform/superproject:packages/services/Telephony/src/com/android/phone/PhoneInterfaceManager.java: [ master, ]
378:         public Phone phone;
17: package com.android.phone;
199: public class PhoneInterfaceManager extends ITelephony.Stub {
1641:     /* package */ PhoneInterfaceManager(PhoneGlobals app) {
1657:     private Phone getDefaultPhone() {
1688:     private Phone getPhone(int subId) {
2296:     public String getNetworkCountryIsoForPhone(int phoneId) {
5783:     public int checkCarrierPrivilegesForPackageAnyPhone(String pkgName) {
5806:     public List<String> getCarrierPackageNamesForIntentAndPhone(Intent intent, int phoneId) {
6264:     public boolean isWorldPhone(int subId, String callingPackage, String callingFeatureId) {
308:     private PhoneConfigurationManager mPhoneConfigurationManager;
1668:     private Phone getPhoneFromRequest(MainThreadRequest request) {
1676:     private Phone getPhoneFromSubId(int subId) {
2074:     private void shutdownRadioUsingPhoneId(int phoneId) {
2736:     public int getActivePhoneType() {
2741:     public int getActivePhoneTypeForSlot(int slotIndex) {
3780:     private void checkModifyPhoneStatePermission(int subId, String message) {
4418:     private Phone getPhoneFromSlotIdOrThrowException(int slotIndex) {
5850:     public List<String> getPackagesWithCarrierPrivilegesForAllPhones() {
6390:     public int getSubIdForPhoneAccount(PhoneAccount phoneAccount) {
6400:     public int getSubIdForPhoneAccountHandle(
6415:     public @Nullable PhoneAccountHandle getPhoneAccountHandleForSubscriptionId(int subscriptionId) {
21: import static com.android.internal.telephony.PhoneConstants.PHONE_TYPE_IMS;
143: import com.android.internal.telephony.Phone;
176: import com.android.phone.settings.PickSmsSubscriptionActivity;
177: import com.android.phone.vvm.PhoneAccountHandleConverter;
178: import com.android.phone.vvm.RemoteVvmTaskManager;
179: import com.android.phone.vvm.VisualVoicemailSettingsUtil;
180: import com.android.phone.vvm.VisualVoicemailSmsFilterConfig;
377:         // In cases where subId is unavailable, the caller needs to specify the phone.
386:         MainThreadRequest(Object argument, Phone phone, WorkSource workSource) {
388:             if (phone != null) {
389:                 this.phone = phone;
417:      * A handler that processes messages on the main thread in the phone process. Since many
418:      * of the Phone calls are not thread safe this is needed to shuttle the requests from the
419:      * inbound binder threads to the main thread in the phone process.  The Binder thread
436:             final Phone defaultPhone = getDefaultPhone();
441:                     final Phone phone = getPhoneFromRequest(request);
460:                         request.result = phone != null
461:                                 ? phone.handleUssdRequest(ussdRequest, wrappedCallback) : false;
472:                     final Phone phone = getPhoneFromRequest(request);
473:                     request.result = phone != null ?
1258:                     request.phone.requestCellInfoUpdate(request.workSource, onCompleted);
1272:                     request.phone.requestCellInfoUpdate(request.workSource,
1300:                     Phone phone = getPhoneFromRequest(request);
1301:                     phone.getCellIdentity(ws, obtainMessage(EVENT_GET_CELL_LOCATION_DONE, request));
1309:                         phone = getPhoneFromRequest(request);
1310:                         request.result = (phone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA)
1332:                             .enablePhone(request.phone, enable, onCompleted);
1338:                     int phoneId = request.phone.getPhoneId();
1353:                             .getPhoneStatusFromModem(request.phone, onCompleted);
1358:                     int id = request.phone.getPhoneId();
1381:                     request.phone.setSystemSelectionChannels(args.first, onCompleted);
1554:     private Object sendRequest(int command, Object argument, Phone phone, WorkSource workSource) {
1556:                 command, argument, SubscriptionManager.INVALID_SUBSCRIPTION_ID, phone, workSource);
1565:             int command, Object argument, Integer subId, Phone phone, WorkSource workSource) {
1571:         if (subId != SubscriptionManager.INVALID_SUBSCRIPTION_ID && phone != null) {
1572:             throw new IllegalArgumentException("subId and phone cannot both be specified!");
1573:         } else if (phone != null) {
1574:             request = new MainThreadRequest(argument, phone, workSource);
1614:      * Same as {@link #sendRequestAsync(int,Object)} except it takes a Phone and WorkSource.
1618:             int command, Object argument, Phone phone, WorkSource workSource) {
1619:         MainThreadRequest request = new MainThreadRequest(argument, phone, workSource);
1658:         Phone thePhone = getPhone(getDefaultSubscription());
1665:         ServiceManager.addService("phone", this);
1669:         if (request.phone != null) {
1670:             return request.phone;
1682:         Phone phone = getPhoneFromRequest(request);
1683:         return phone == null ? null :
1684:                 UiccController.getInstance().getUiccCard(phone.getPhoneId());
1687:     // returns phone associated with the subId.
1692:     private void sendEraseModemConfig(Phone phone) {
1693:         if (phone != null) {
1695:                   mApp, phone.getSubId(), "eraseModemConfig");
1733:             // PENDING: should we just silently fail if phone is offhook or ringing?
1754:         // from the context of the phone app.
1757:         if (mAppOps.noteOp(AppOpsManager.OPSTR_CALL_PHONE, Binder.getCallingUid(), callingPackage)
1943:             final Phone phone = getPhone(subId);
1944:             if (phone != null) {
1945:                 phone.updateServiceLocation();
1989:             final Phone phone = getPhone(subId);
1990:             if (phone != null) {
1991:                 return phone.getServiceState().getState() != ServiceState.STATE_POWER_OFF;
2009:             final Phone phone = getPhone(subId);
2010:             if (phone != null) {
2011:                 phone.setRadioPower(!isRadioOnForSubscriber(subId));
2027:             final Phone phone = getPhone(subId);
2028:             if (phone == null) {
2031:             if ((phone.getServiceState().getState() != ServiceState.STATE_POWER_OFF) != turnOn) {
2049:                 Phone phone = PhoneFactory.getPhone(i);
2050:                 if (phone != null && phone.isRadioAvailable()) return true;
2066:                 logv("Shutting down Phone " + i);
2075:         Phone phone = PhoneFactory.getPhone(phoneId);
2076:         if (phone != null && phone.isRadioAvailable()) {
2077:             phone.shutdownRadio();
2086:             final Phone defaultPhone = PhoneFactory.getDefaultPhone();
2091:                 loge("There's no default phone.");
2104:             final Phone phone = getPhone(subId);
2105:             if (phone != null) {
2106:                 phone.setRadioPower(turnOn);
2124:             final Phone phone = getPhone(subId);
2125:             if (phone != null) {
2126:                 phone.getDataEnabledSettings().setUserDataEnabled(true);
2144:             final Phone phone = getPhone(subId);
2145:             if (phone != null) {
2146:                 phone.getDataEnabledSettings().setUserDataEnabled(false);
2160:             final Phone phone = getPhone(subId);
2161:             if (phone != null) {
2162:                 return phone.isDataAllowed(ApnSetting.TYPE_DEFAULT);
2211:             Phone phone = PhoneFactory.getPhone(slotIndex);
2212:             return phone == null ? TelephonyManager.CALL_STATE_IDLE :
2213:                     PhoneConstantConversions.convertCallState(phone.getState());
2228:             final Phone phone = getPhone(subId);
2229:             if (phone != null) {
2230:                 return PhoneConstantConversions.convertDataState(phone.getDataConnectionState());
2249:             final Phone phone = getPhone(subId);
2250:             if (phone != null) {
2251:                 return DefaultPhoneNotifier.convertDataActivityState(phone.getDataActivityState());
2280:                 return (getDefaultPhone().getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA)
2301:             if (phoneId == SubscriptionManager.INVALID_PHONE_INDEX) {
2302:                 // Get default phone in this case.
2303:                 phoneId = SubscriptionManager.DEFAULT_PHONE_INDEX;
2306:             Phone phone = PhoneFactory.getPhone(phoneId);
2307:             if (phone == null) return "";
2308:             ServiceStateTracker sst = phone.getServiceStateTracker();
2313:             EmergencyNumberTracker ent = phone.getEmergencyNumberTracker();
2332:             final Phone phone = getPhone(subId);
2333:             if (phone != null) {
2334:                 phone.enableLocationUpdates();
2353:             final Phone phone = getPhone(subId);
2354:             if (phone != null) {
2355:                 phone.disableLocationUpdates();
2414:         for (Phone phone : PhoneFactory.getPhones()) {
2415:             List<CellInfo> info = phone.getAllCellInfo();
2454:             for (Phone phone : PhoneFactory.getPhones()) {
2456:                         CMD_GET_ALL_CELL_INFO, null, phone, workSource);
2507:         final Phone phone = getPhoneFromSubId(subId);
2508:         if (phone == null) throw new IllegalArgumentException("Invalid Subscription Id: " + subId);
2510:         sendRequestAsync(CMD_REQUEST_CELL_INFO_UPDATE, cb, phone, workSource);
2528:         Phone phone = PhoneFactory.getPhone(slotIndex);
2529:         if (phone == null) {
2532:         int subId = phone.getSubId();
2540:             return phone.getImei();
2548:         Phone phone = PhoneFactory.getPhone(slotIndex);
2550:         if (phone != null) {
2551:             String imei = phone.getImei();
2559:         Phone phone = PhoneFactory.getPhone(slotIndex);
2560:         if (phone == null) {
2564:         int subId = phone.getSubId();
2572:             return phone.getMeid();
2580:         Phone phone = PhoneFactory.getPhone(slotIndex);
2582:         if (phone != null) {
2583:             String meid = phone.getMeid();
2592:         Phone phone = PhoneFactory.getPhone(slotIndex);
2593:         if (phone == null) {
2596:         int subId = phone.getSubId();
2605:             return phone.getDeviceSvn();
2615:             final Phone phone = getPhone(subId);
2616:             return phone == null ? TelephonyManager.UNKNOWN_CARRIER_ID : phone.getCarrierId();
2626:             final Phone phone = getPhone(subId);
2627:             return phone == null ? null : phone.getCarrierName();
2637:             final Phone phone = getPhone(subId);
2638:             return phone == null ? TelephonyManager.UNKNOWN_CARRIER_ID
2639:                     : phone.getSpecificCarrierId();
2649:             final Phone phone = getPhone(subId);
2650:             return phone == null ? null : phone.getSpecificCarrierName();
2661:         final Phone phone = PhoneFactory.getPhone(slotIndex);
2662:         if (phone == null) {
2667:             return CarrierResolver.getCarrierIdFromMccMnc(phone.getContext(), mccmnc);
2678:      * Make sure the caller has the MODIFY_PHONE_STATE permission.
2683:         mApp.enforceCallingOrSelfPermission(android.Manifest.permission.MODIFY_PHONE_STATE, null);
2703:      * Make sure the caller has the CALL_PHONE permission.
2708:         mApp.enforceCallingOrSelfPermission(android.Manifest.permission.CALL_PHONE, null);
2744:             final Phone phone = PhoneFactory.getPhone(slotIndex);
2745:             if (phone == null) {
2746:                 return PhoneConstants.PHONE_TYPE_NONE;
2748:                 return phone.getPhoneType();
2775:             final Phone phone = getPhone(subId);
2776:             if (phone != null) {
2777:                 return phone.getCdmaEriIconIndex();
2808:             final Phone phone = getPhone(subId);
2809:             if (phone != null) {
2810:                 return phone.getCdmaEriIconMode();
2839:             final Phone phone = getPhone(subId);
2840:             if (phone != null) {
2841:                 return phone.getCdmaEriText();
2860:             final Phone phone = getPhone(subId);
2861:             if (phone != null && phone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA) {
2862:                 return phone.getLine1Number();
2864:                 loge("getCdmaMdn: no phone found. Invalid subId: " + subId);
2882:             final Phone phone = getPhone(subId);
2883:             if (phone != null && phone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA) {
2884:                 return phone.getCdmaMin();
2896:         if (mApp.checkCallingOrSelfPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
2898:             throw new SecurityException("Caller must hold the MODIFY_PHONE_STATE permission");
3062:             final Phone phone = getPhone(subId);
3063:             if (phone != null) {
3064:                 phone.setVoiceActivationState(activationState);
3083:             final Phone phone = getPhone(subId);
3084:             if (phone != null) {
3085:                 phone.setDataActivationState(activationState);
3101:         final Phone phone = getPhone(subId);
3104:             if (phone != null) {
3105:                 return phone.getVoiceActivationState();
3121:         final Phone phone = getPhone(subId);
3124:             if (phone != null) {
3125:                 return phone.getDataActivationState();
3147:             final Phone phone = getPhone(subId);
3148:             if (phone != null) {
3149:                 return phone.getVoiceMessageCount();
3166:             final Phone phone = getPhone(subId);
3167:             return (phone == null ? false : phone.isConcurrentVoiceAndDataAllowed());
3180:         final Phone defaultPhone = getDefaultPhone();
3218:             for (Phone phone : PhoneFactory.getPhones()) {
3219:                 if (phone.isInEmergencySmsMode()) {
3230:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3257:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3295:             Phone phone = getPhone(subId);
3296:             if (phone == null) {
3301:             phone.getImsRegistrationState(regState -> {
3328:             Phone phone = getPhone(subId);
3329:             if (phone == null) {
3334:             phone.getImsRegistrationTech(regTech -> {
3353:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3379:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3430:             Phone phone = getPhone(subId);
3431:             if (phone == null) return false;
3432:             return phone.isImsCapabilityAvailable(capability, regTech);
3480:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3517:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3551:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3586:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3638:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3720:      * Requires carrier privileges or READ_PRECISE_PHONE_STATE permission.
3787:         Phone phone = getPhone(subId);
3788:         if (phone == null) {
3789:             loge("phone instance null for subid " + subId);
3793:             if (!doesImsCapabilityRequireProvisioning(phone.getContext(), subId, capability)) {
3797:             if (!doesRcsCapabilityRequireProvisioning(phone.getContext(), subId, capability)) {
4231:             final Phone phone = getPhone(subId);
4232:             if (phone != null) {
4233:                 return phone.getServiceState().getDataNetworkType();
4265:             final Phone phone = getPhone(subId);
4266:             if (phone != null) {
4267:                 return phone.getServiceState().getDataNetworkType();
4290:             final Phone phone = getPhone(subId);
4291:             if (phone != null) {
4292:                 return phone.getServiceState().getVoiceNetworkType();
4317:             final Phone phone = PhoneFactory.getPhone(slotIndex);
4318:             if (phone != null) {
4319:                 return phone.getIccCard().hasIccCard();
4334:      * @return {@link Phone#LTE_ON_CDMA_UNKNOWN}, {@link Phone#LTE_ON_CDMA_FALSE}
4335:      * or {@link Phone#LTE_ON_CDMA_TRUE}
4354:             final Phone phone = getPhone(subId);
4355:             if (phone == null) {
4358:                 return phone.getLteOnCdmaMode();
4422:                     + " does not correspond to an active phone");
4453:     private IccOpenLogicalChannelResponse iccOpenLogicalChannelWithPermission(Phone phone,
4470:                     CMD_OPEN_CHANNEL, new Pair<String, Integer>(aid, p2), phone,
4495:     private boolean iccCloseLogicalChannelWithPermission(Phone phone, int channel) {
4501:             Boolean success = (Boolean) sendRequest(CMD_CLOSE_CHANNEL, channel, phone,
4538:     private String iccTransmitApduLogicalChannelWithPermission(Phone phone, int channel, int cla,
4547:                     new IccAPDUArgument(channel, cla, command, p1, p2, p3, data), phone,
4594:     private String iccTransmitApduBasicChannelWithPermission(Phone phone, String callingPackage,
4612:                     new IccAPDUArgument(0, cla, command, p1, p2, p3, data), phone,
4846:         Phone phone = PhoneFactory.getPhone(slotIndex);
4847:         if (phone != null) {
4849:                     mApp, phone.getSubId(), "resetModemConfig");
4872:         Phone phone = PhoneFactory.getPhone(slotIndex);
4873:         if (phone != null) {
4875:                     mApp, phone.getSubId(), "rebootModem");
4891:         final Phone defaultPhone = getDefaultPhone();
5416:         final Phone defaultPhone = getDefaultPhone();
5534:         final Phone phone = getPhone(subId);
5536:             if (phone != null) {
5537:                 return phone.hasMatchedTetherApnSetting();
5561:             Phone phone = PhoneFactory.getPhone(phoneId);
5562:             if (phone != null) {
5564:                 phone.getDataEnabledSettings().setUserDataEnabled(enable);
5566:                 loge("setUserDataEnabled: no phone found. Invalid subId=" + subId);
5584:         final Phone phone = getPhone(subId);
5586:             if (phone != null) {
5591:                 phone.setAlwaysReportSignalStrength(isEnable);
5593:                 loge("setAlwaysReportSignalStrength: no phone found for subId="
5622:      * Accepts either ACCESS_NETWORK_STATE, MODIFY_PHONE_STATE or carrier privileges.
5640:             Phone phone = PhoneFactory.getPhone(phoneId);
5641:             if (phone != null) {
5642:                 boolean retVal = phone.isUserDataEnabled();
5646:                 if (DBG) loge("isUserDataEnabled: no phone subId=" + subId + " retVal=false");
5669:             Phone phone = PhoneFactory.getPhone(phoneId);
5670:             if (phone != null) {
5671:                 boolean retVal = phone.getDataEnabledSettings().isDataEnabled();
5675:                 if (DBG) loge("isDataEnabled: no phone subId=" + subId + " retVal=false");
5684:             Phone phone) {
5690:         PackageManager pkgMgr = phone.getContext().getPackageManager();
5695:             SubscriptionInfo subInfo = subController.getSubscriptionInfo(phone.getSubId());
5697:                     phone.getContext().getSystemService(Context.TELEPHONY_SUBSCRIPTION_SERVICE);
5709:     private int getCarrierPrivilegeStatusFromCarrierConfigRules(int privilegeFromSim, Phone phone,
5718:             SubscriptionInfo subInfo = subController.getSubscriptionInfo(phone.getSubId());
5720:                     phone.getContext().getSystemService(Context.TELEPHONY_SUBSCRIPTION_SERVICE);
5730:         final Phone phone = getPhone(subId);
5731:         if (phone == null) {
5735:         UiccCard card = UiccController.getInstance().getUiccCard(phone.getPhoneId());
5743:                 phone.getContext().getPackageManager()), Binder.getCallingUid(), phone);
5749:         final Phone phone = getPhone(subId);
5750:         if (phone == null) {
5755:                 UiccController.getInstance().getUiccProfileForPhone(phone.getPhoneId());
5762:                         phone.getContext().getPackageManager(), uid), uid, phone);
5867:         final Phone phone = getPhone(subId);
5868:         UiccCard card = phone == null ? null : phone.getUiccCard();
5890:             final Phone phone = getPhone(subId);
5891:             if (phone == null) {
5894:             final String subscriberId = phone.getSubscriberId();
6117:             final Phone phone = getPhone(subId);
6118:             return phone == null ? false : phone.setOperatorBrandOverride(brand);
6133:             final Phone phone = getPhone(subId);
6134:             if (phone == null) {
6137:             return phone.setRoamingOverride(gsmRoamingList, gsmNonRoamingList, cdmaRoamingList,
6188:         Phone phone = PhoneFactory.getPhone(phoneId);
6190:         if (phone == null) {
6197:                             mApp, phone.getSubId(), "getRadioAccessFamily");
6207:         final Phone defaultPhone = getDefaultPhone();
6221:         final Phone defaultPhone = getDefaultPhone();
6275:                     .getBoolean(CarrierConfigManager.KEY_WORLD_PHONE_BOOL);
6306:         final Phone phone = getPhone(subscriptionId);
6307:         if (phone == null) {
6308:             loge("isRttSupported: no Phone found. Invalid subId:" + subscriptionId);
6315:                     phone.getContext().getResources().getBoolean(R.bool.config_support_rtt);
6348:      * Returns the unique device ID of phone, for example, the IMEI for
6352:      *   {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
6356:         final Phone phone = PhoneFactory.getPhone(0);
6357:         if (phone == null) {
6360:         int subId = phone.getSubId();
6368:             return phone.getDeviceId();
6381:         Phone phone = getPhone(subId);
6382:         if (phone != null) {
6383:             return phone.isImsRegistered();
6404:             throw new SecurityException("Requires READ_PHONE_STATE permission.");
6418:             Phone phone = getPhone(subscriptionId);
6419:             if (phone == null) {
6422:             return PhoneUtils.makePstnPhoneAccountHandle(phone);
6434:             Phone phone = getPhone(subId);
6435:             if (phone != null) {
6436:                 return phone.isWifiCallingEnabled();
6451:             Phone phone = getPhone(subId);
6452:             if (phone != null) {
6453:                 return phone.isVideoEnabled();
6469:             Phone phone = getPhone(subId);
6470:             if (phone != null) {
6471:                 return phone.getImsRegistrationTech();
6529:         final Phone phone = getPhone(subId);
6530:         if (phone == null) {
6537:                     phone.getContext().getOpPackageName(), null);
6546:             final Locale localeFromDefaultSim = phone.getLocaleFromSimAndCarrierPrefs();
6674:             final Phone phone = getPhone(subId);
6675:             if (phone == null) {
6679:             ServiceState ss = phone.getServiceState();
6692:      * Returns the URI for the per-account voicemail ringtone set in Phone settings.
6703:             Phone phone = PhoneUtils.getPhoneForPhoneAccountHandle(accountHandle);
6704:             if (phone == null) {
6705:                 phone = getDefaultPhone();
6708:             return VoicemailNotificationSettingsUtil.getRingtoneUri(phone.getContext());
6718:      * has permission {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}.
6728:         final Phone defaultPhone = getDefaultPhone();
6739:             Phone phone = PhoneUtils.getPhoneForPhoneAccountHandle(phoneAccountHandle);
6740:             if (phone == null) {
6741:                 phone = defaultPhone;
6743:             VoicemailNotificationSettingsUtil.setRingtoneUri(phone.getContext(), uri);
6750:      * Returns whether vibration is set for voicemail notification in Phone settings.
6760:             Phone phone = PhoneUtils.getPhoneForPhoneAccountHandle(accountHandle);
6761:             if (phone == null) {
6762:                 phone = getDefaultPhone();
6765:             return VoicemailNotificationSettingsUtil.isVibrationEnabled(phone.getContext());
6775:      * has permission {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}.
6785:         final Phone defaultPhone = getDefaultPhone();
6796:             Phone phone = PhoneUtils.getPhoneForPhoneAccountHandle(phoneAccountHandle);
6797:             if (phone == null) {
6798:                 phone = defaultPhone;
6800:             VoicemailNotificationSettingsUtil.setVibrationEnabled(phone.getContext(), enabled);
6807:      * Make sure either called from same process as self (phone) or IPC caller has read privilege.
6812:         mApp.enforceCallingOrSelfPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE,
6817:      * Make sure either called from same process as self (phone) or IPC caller has send SMS
6860:         Phone phone = getPhone(subId);
6864:             if (phone == null) {
6869:                 aid = UiccController.getInstance().getUiccCard(phone.getPhoneId())
6889:         Phone phone = getPhone(subId);
6893:             if (phone == null) {
6898:                 esn = phone.getEsn();
6917:         Phone phone = getPhone(subId);
6921:             if (phone == null) {
6926:                 cdmaPrlVersion = phone.getCdmaPrlVersion();
7020:         final Phone phone = getPhone(subId);
7023:         if (phone == null) {
7028:             phone.carrierActionSetMeteredApnsEnabled(enabled);
7045:         final Phone phone = getPhone(subId);
7048:         if (phone == null) {
7053:             phone.carrierActionSetRadioEnabled(enabled);
7073:         final Phone phone = getPhone(subId);
7076:         if (phone == null) {
7081:             phone.carrierActionReportDefaultNetworkStatus(report);
7097:         final Phone phone = getPhone(subId);
7098:         if (phone == null) {
7103:             phone.carrierActionResetAll();
7110:      * Called when "adb shell dumpsys phone" is invoked. Dump is also automatically invoked when a
7117:             writer.println("Permission Denial: can't dump Phone from pid="
7147:             Phone phone = getPhone(subId);
7148:             if (phone != null) {
7149:                 phone.getDataEnabledSettings().setPolicyDataEnabled(enabled);
7168:         Phone phone = getPhone(subId);
7172:             if (phone != null) {
7173:                 return phone.getClientRequestStats();
7200:         Phone phone = PhoneFactory.getPhone(slotIndex);
7206:             if (phone != null) {
7207:                 phone.setSimPowerState(state, workSource);
7229:      * Check if phone is in emergency callback mode
7230:      * @return true if phone is in emergency callback mode
7236:         final Phone phone = getPhone(subId);
7240:             if (phone != null) {
7241:                 return phone.isInEcm();
7261:             Phone p = getPhone(subId);
7281:         Phone phone = PhoneFactory.getPhone(slotIndex);
7282:         if (phone != null) {
7283:             if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp, phone.getSubId(),
7290:                 return phone.getRadioPowerState();
7303:      * {@link android.Manifest.permission#READ_PHONE_STATE} or that the calling app has carrier
7318:             Phone phone = getPhone(subId);
7319:             isEnabled =  phone != null ? phone.getDataRoamingEnabled() : false;
7334:      * {@link android.Manifest.permission#MODIFY_PHONE_STATE} or that the calling app has carrier
7347:             Phone phone = getPhone(subId);
7348:             if (phone != null) {
7349:                 phone.setDataRoamingEnabled(isEnabled);
7365:             Phone phone = getPhone(subId);
7366:             if (phone != null) {
7367:                 isAllowed = phone.isCspPlmnEnabled();
7391:             // even without READ_PRIVILEGED_PHONE_STATE, we allow the call to continue if the caller
7528:      * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}.
7537:             Phone phone = getPhone(subId);
7538:             if (phone == null) {
7541:             UiccCard uiccCard = phone.getUiccCard();
7578:      * not set, return {@link Phone#PREFERRED_NT_MODE}.
7586:         return Phone.PREFERRED_NT_MODE;
7596:             final Phone phone = getPhone(subId);
7597:             if (phone == null) {
7601:             phone.setCarrierTestOverride(mccmnc, imsi, iccid, gid1, gid2, plmn, spn,
7614:             final Phone phone = getPhone(subId);
7615:             if (phone == null) {
7619:             return phone.getCarrierIdListVersion();
7688:             throw new SecurityException("Requires READ_PHONE_STATE permission.");
7693:             for (Phone phone: PhoneFactory.getPhones()) {
7694:                 if (phone.getEmergencyNumberTracker() != null
7695:                         && phone.getEmergencyNumberTracker().getEmergencyNumberList() != null) {
7697:                             phone.getSubId(),
7698:                             phone.getEmergencyNumberTracker().getEmergencyNumberList());
7709:         final Phone defaultPhone = getDefaultPhone();
7717:             for (Phone phone: PhoneFactory.getPhones()) {
7718:                 if (phone.getEmergencyNumberTracker() != null
7719:                         && phone.getEmergencyNumberTracker() != null) {
7720:                     if (phone.getEmergencyNumberTracker().isEmergencyNumber(
7742:             for (Phone phone: PhoneFactory.getPhones()) {
7743:                 EmergencyNumberTracker tracker = phone.getEmergencyNumberTracker();
7764:             for (Phone phone: PhoneFactory.getPhones()) {
7765:                 EmergencyNumberTracker tracker = phone.getEmergencyNumberTracker();
7784:             final Phone phone = getPhone(subId);
7785:             if (phone == null) {
7789:             return phone.getEmergencyNumberDbVersion();
7801:             for (Phone phone: PhoneFactory.getPhones()) {
7802:                 EmergencyNumberTracker tracker = phone.getEmergencyNumberTracker();
7818:             for (Phone phone: PhoneFactory.getPhones()) {
7819:                 EmergencyNumberTracker tracker = phone.getEmergencyNumberTracker();
7835:             for (Phone phone: PhoneFactory.getPhones()) {
7836:                 EmergencyNumberTracker tracker = phone.getEmergencyNumberTracker();
7849:         Phone phone = getPhone(subId);
7850:         if (phone == null) {
7856:                     .getUiccProfileForPhone(phone.getPhoneId());
7875:             Phone phone = PhoneFactory.getPhone(slotIndex);
7876:             if (phone == null) {
7879:                 return (Boolean) sendRequest(CMD_REQUEST_ENABLE_MODEM, enable, phone, null);
7892:         Phone phone = PhoneFactory.getPhone(slotIndex);
7893:         if (phone == null) return false;
7896:                 mApp, phone.getSubId(), callingPackage, callingFeatureId,
7898:             throw new SecurityException("Requires READ_PHONE_STATE permission.");
7904:                 return mPhoneConfigurationManager.getPhoneStatusFromCache(phone.getPhoneId());
7906:                 return (Boolean) sendRequest(CMD_GET_MODEM_STATUS, null, phone, null);
7974:      * Note: Switch from multi-sim to single-sim is only possible with MODIFY_PHONE_STATE
7975:      * permission, but the other way around is possible with either MODIFY_PHONE_STATE
8004:         Phone phone = getPhone(subId);
8005:         if (phone == null) {
8010:             UiccCard uiccCard = phone.getUiccCard();
8080:         Phone phone = getDefaultPhone();
8081:         if (phone == null) return -1;
8082:         HalVersion hv = phone.getHalVersion();
8112:         enforceReadPrivilegedPermission("Needs READ_PRIVILEGED_PHONE_STATE for "
8118:             Phone phone = getPhone(subId);
8119:             if (phone == null) return false;
8121:             boolean isMetered = ApnSettingUtils.isMeteredApnType(apnType, phone);
8122:             return !isMetered || phone.getDataEnabledSettings().isDataEnabled(apnType);
8135:             Phone phone = getPhone(subId);
8136:             if (phone == null) return true; // By default return true.
8138:             return ApnSettingUtils.isMeteredApnType(apnType, phone);
8150:             Phone phone = getPhone(subscriptionId);
8151:             if (phone == null) {
8171:             sendRequestAsync(CMD_SET_SYSTEM_SELECTION_CHANNELS, argument, phone, null);
8241:             Phone phone = getPhone(subId);
8242:             if (phone == null) return false;
8244:             return phone.getDataEnabledSettings().setAllowDataDuringVoiceCall(allow);
8257:             Phone phone = getPhone(subId);
8258:             if (phone == null) return false;
8260:             return phone.getDataEnabledSettings().isDataAllowedInVoiceCall();
8273:             Phone phone = getPhone(subId);
8274:             if (phone == null) return false;
8276:             return phone.getDataEnabledSettings().setAlwaysAllowMmsData(alwaysAllow);
8294:             for (Phone phone : PhoneFactory.getPhones()) {
8295:                 Phone defaultPhone = phone.getImsPhone();
8296:                 if (defaultPhone != null && defaultPhone.getPhoneType() == PHONE_TYPE_IMS) {
8341:             Phone phone = getPhone(subId);
8342:             if (phone != null && phone.getIccCard() != null) {
8343:                 return phone.getIccCard().getIccLockEnabled();
8363:         Phone phone = getPhone(subId);
8364:         if (phone == null) {
8371:                     new Pair<Boolean, String>(enabled, password), phone, null);
8393:         Phone phone = getPhone(subId);
8394:         if (phone == null) {
8401:                     new Pair<String, String>(oldPassword, newPassword), phone, null);
22: import static com.android.internal.telephony.PhoneConstants.SUBSCRIPTION_KEY;
65: import android.telecom.PhoneAccount;
66: import android.telecom.PhoneAccountHandle;
85: import android.telephony.PhoneCapability;
86: import android.telephony.PhoneNumberRange;
144: import com.android.internal.telephony.PhoneConfigurationManager;
145: import com.android.internal.telephony.PhoneConstantConversions;
146: import com.android.internal.telephony.PhoneConstants;
147: import com.android.internal.telephony.PhoneFactory;
160: import com.android.internal.telephony.imsphone.ImsPhone;
161: import com.android.internal.telephony.imsphone.ImsPhoneCallTracker;
200:     private static final String LOG_TAG = "PhoneInterfaceManager";
201:     private static final boolean DBG = (PhoneGlobals.DBG_LEVEL >= 2);
298:     private static PhoneInterfaceManager sInstance;
300:     private PhoneGlobals mApp;
691:                     defaultPhone.nvReadItem((Integer) request.argument, onCompleted,
718:                     defaultPhone.nvWriteItem(idValue.first, idValue.second, onCompleted,
729:                     defaultPhone.nvWriteCdmaPrl((byte[]) request.argument, onCompleted);
739:                     defaultPhone.resetModemConfig(onCompleted);
785:                     defaultPhone.invokeOemRilRequestRaw((byte[]) request.argument, onCompleted);
1023:                     if (defaultPhone != null) {
1024:                         defaultPhone.getModemActivityInfo(onCompleted, request.workSource);
1087:                     defaultPhone.setAllowedCarriers(argument, onCompleted, request.workSource);
1115:                     defaultPhone.getAllowedCarriers(onCompleted, request.workSource);
1321:                     defaultPhone.rebootModem(onCompleted);
1331:                     PhoneConfigurationManager.getInstance()
1341:                         mPhoneConfigurationManager.addToPhoneStatusCache(phoneId, msg.arg1 == 1);
1352:                     PhoneConfigurationManager.getInstance()
1440:                     defaultPhone.eraseModemConfig(onCompleted);
1625:      * Initialize the singleton PhoneInterfaceManager instance.
1626:      * This is only done once, at startup, from PhoneApp.onCreate().
1628:     /* package */ static PhoneInterfaceManager init(PhoneGlobals app) {
1629:         synchronized (PhoneInterfaceManager.class) {
1631:                 sInstance = new PhoneInterfaceManager(app);
1643:         mCM = PhoneGlobals.getInstance().mCM;
1644:         mImsResolver = PhoneGlobals.getInstance().getImsResolver();
1652:         mPhoneConfigurationManager = PhoneConfigurationManager.getInstance();
1659:         return (thePhone != null) ? thePhone : PhoneFactory.getDefaultPhone();
1678:                 ? getDefaultPhone() : getPhone(subId);
1689:         return PhoneFactory.getPhone(mSubscriptionController.getPhoneId(subId));
1707:         PackageManager pm = getDefaultPhone().getContext().getPackageManager();
1734:             PhoneConstants.State state = mCM.getState(subId);
1735:             if (state != PhoneConstants.State.OFFHOOK && state != PhoneConstants.State.RINGING) {
1794:         return (resultArray[0] == PhoneConstants.PIN_RESULT_SUCCESS) ? true : false;
1799:         return (resultArray[0] == PhoneConstants.PIN_RESULT_SUCCESS) ? true : false;
1807:             final UnlockSim checkSimPin = new UnlockSim(getPhone(subId).getIccCard());
1820:             final UnlockSim checkSimPuk = new UnlockSim(getPhone(subId).getIccCard());
1837:         private int mResult = PhoneConstants.PIN_GENERAL_FAILURE;
1867:                                             mResult = PhoneConstants.PIN_PASSWORD_INCORRECT;
1872:                                             mResult = PhoneConstants.PIN_OPERATION_ABORTED;
1874:                                             mResult = PhoneConstants.PIN_GENERAL_FAILURE;
1877:                                         mResult = PhoneConstants.PIN_RESULT_SUCCESS;
2052:             logv(TelephonyManager.getDefault().getPhoneCount() + " Phones are shutdown.");
2087:             if (defaultPhone != null) {
2088:                 defaultPhone.setRadioPower(turnOn);
2232:                 return PhoneConstantConversions.convertDataState(
2233:                         PhoneConstants.DataState.DISCONNECTED);
2305:             final int subId = mSubscriptionController.getSubIdUsingPhoneId(phoneId);
2520:             getDefaultPhone().setCellInfoListRate(rateInMillis, workSource);
2724:         Log.d(LOG_TAG, "[PhoneIntfMgr] " + msg);
2728:         Log.v(LOG_TAG, "[PhoneIntfMgr] " + msg);
2732:         Log.e(LOG_TAG, "[PhoneIntfMgr] " + msg);
2894:     public void requestNumberVerification(PhoneNumberRange range, long timeoutMillis,
2923:             return getDefaultPhone().needsOtaServiceProvisioning();
2958:             PhoneAccountHandle phoneAccountHandle = PhoneAccountHandleConverter.fromSubId(subId);
2959:             if (phoneAccountHandle == null) {
2962:             return VisualVoicemailSettingsUtil.dump(mApp, phoneAccountHandle);
3047:         SmsController smsController = PhoneFactory.getSmsController();
3182:         TelecomManager tm = defaultPhone.getContext().getSystemService(TelecomManager.class);
3191:             defaultPhone.sendDialerSpecialCode(inputCode);
3246:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3270:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone.
3366:         // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3393:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone.
3409:         // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3488:         // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3506:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3526:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3541:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3560:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3576:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3595:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3611:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3627:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3647:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3663:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3678:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3694:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3710:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3729:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3748:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3766:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3811:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3841:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3874:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
3933:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
4102:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
4127:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
4153:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
4179:             // TODO: Refactor to remove ImsManager dependence and query through ImsPhone directly.
4349:             return PhoneConstants.LTE_ON_CDMA_UNKNOWN;
4356:                 return PhoneConstants.LTE_ON_CDMA_UNKNOWN;
4419:         int phoneId = UiccController.getInstance().getPhoneIdFromSlotId(slotIndex);
4420:         if (phoneId == -1) {
4424:         return PhoneFactory.getPhone(phoneId);
4459:                 ComponentInfo bestComponent = EuiccConnector.findBestComponent(getDefaultPhone()
4601:                 ComponentInfo bestComponent = EuiccConnector.findBestComponent(getDefaultPhone()
4892:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp, defaultPhone.getSubId(),
4899:             return defaultPhone.getPcscfAddress(apnType);
5150:             getDefaultPhone().setImsRegistrationState(registered);
5356:                     request, messenger, binder, getPhone(subId),
5417:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp, defaultPhone.getSubId(),
5425:             return PhoneFactory.calculatePreferredNetworkType(defaultPhone.getContext(), 0);
5559:             int phoneId = mSubscriptionController.getPhoneId(subId);
5560:             if (DBG) log("setUserDataEnabled: subId=" + subId + " phoneId=" + phoneId);
5638:             int phoneId = mSubscriptionController.getPhoneId(subId);
5639:             if (DBG) log("isUserDataEnabled: subId=" + subId + " phoneId=" + phoneId);
5667:             int phoneId = mSubscriptionController.getPhoneId(subId);
5668:             if (DBG) log("isDataEnabled: subId=" + subId + " phoneId=" + phoneId);
5771:         int phoneId = SubscriptionManager.getPhoneId(subId);
5772:         UiccCard card = UiccController.getInstance().getUiccCard(phoneId);
5779:             getPhone(phoneId), pkgName);
5796:                 getPhone(i), pkgName);
5807:         if (!SubscriptionManager.isValidPhoneId(phoneId)) {
5808:             loge("phoneId " + phoneId + " is not valid.");
5811:         UiccCard card = UiccController.getInstance().getUiccCard(phoneId);
5813:             loge("getCarrierPackageNamesForIntentAndPhone: No UICC");
5820:     public List<String> getPackagesWithCarrierPrivileges(int phoneId) {
5824:         UiccCard card = UiccController.getInstance().getUiccCard(phoneId);
6187:     public int getRadioAccessFamily(int phoneId, String callingPackage) {
6198:             raf = ProxyController.getInstance().getRadioAccessFamily(phoneId);
6212:             ImsManager.getInstance(defaultPhone.getContext(),
6213:                     defaultPhone.getPhoneId()).setVtSetting(enable);
6222:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp, defaultPhone.getSubId(),
6234:                     ImsManager.getInstance(defaultPhone.getContext(), defaultPhone.getPhoneId());
6349:      * GSM and the MEID for CDMA phones. Return null if device ID is not available.
6393:             return PhoneUtils.getSubIdForPhoneAccount(phoneAccount);
6401:             PhoneAccountHandle phoneAccountHandle, String callingPackage, String callingFeatureId) {
6408:             return PhoneUtils.getSubIdForPhoneAccountHandle(phoneAccountHandle);
6502:             cleanUpSmsRawTable(getDefaultPhone().getContext());
6513:               sendEraseModemConfig(getDefaultPhone());
6694:      * @param accountHandle The handle for the {@link PhoneAccount} for which to retrieve the
6697:      * PhoneAccount.
6700:     public Uri getVoicemailRingtoneUri(PhoneAccountHandle accountHandle) {
6720:      * @param phoneAccountHandle The handle for the {@link PhoneAccount} for which to set the
6723:      * PhoneAccount.
6727:             PhoneAccountHandle phoneAccountHandle, Uri uri) {
6730:         TelecomManager tm = defaultPhone.getContext().getSystemService(TelecomManager.class);
6733:                     mApp, PhoneUtils.getSubIdForPhoneAccountHandle(phoneAccountHandle),
6752:      * @param accountHandle The handle for the {@link PhoneAccount} for which to retrieve the
6754:      * @return {@code true} if the vibration is set for this PhoneAccount, {@code false} otherwise.
6757:     public boolean isVoicemailVibrationEnabled(PhoneAccountHandle accountHandle) {
6777:      * @param phoneAccountHandle The handle for the {@link PhoneAccount} for which to set the
6780:      * specific PhoneAccount.
6784:             PhoneAccountHandle phoneAccountHandle, boolean enabled) {
6787:         TelecomManager tm = defaultPhone.getContext().getSystemService(TelecomManager.class);
6790:                     mApp, PhoneUtils.getSubIdForPhoneAccountHandle(phoneAccountHandle),
7131:         (new TelephonyShellCommand(this, getDefaultPhone().getContext()))
7393:             if (checkCarrierPrivilegesForPackageAnyPhone(callingPackage)
7582:         int phoneId = mSubscriptionController.getPhoneId(subId);
7583:         if (phoneId >= 0 && phoneId < list.size() && list.get(phoneId) != null) {
7584:             return list.get(phoneId);
7713:                             mApp, defaultPhone.getSubId(), "isEmergencyNumber(Potential)");
7931:                 getDefaultPhone().getSubId(), callingPackage, callingFeatureId,
7954:         PhoneCapability staticCapability =
8060:             int phoneCount = TelephonyManager.getDefault().getPhoneCount();
8062:             int[] logicalSlotsMapping = new int[phoneCount];
8194:         SmsPermissions permissions = new SmsPermissions(getDefaultPhone(), mApp,
8215:             return SubscriptionManager.getResourcesForSubId(getDefaultPhone().getContext(), subId)
8227:             return SubscriptionManager.getResourcesForSubId(getDefaultPhone().getContext(), subId)
8297:                     ImsPhone imsPhone = (ImsPhone) defaultPhone;
8299:                             (ImsPhoneCallTracker) imsPhone.getCallTracker();
8301:                     Rlog.i(LOG_TAG, "setCepEnabled isCepEnabled=" + isCepEnabled + ", for imsPhone "
8302:                             + imsPhone.getMsisdn());
133: import com.android.internal.telephony.DefaultPhoneNotifier;
474:                             getPhoneFromRequest(request).handlePinMmi((String) request.argument)
749:                     getPhoneFromRequest(request).getPreferredNetworkType(onCompleted);
775:                     getPhoneFromRequest(request).setPreferredNetworkType(networkType, onCompleted);
799:                     getPhoneFromRequest(request).setVoiceMailNumber(tagNum.first, tagNum.second,
811:                     getPhoneFromRequest(request).setNetworkSelectionModeAutomatic(onCompleted);
821:                     getPhoneFromRequest(request).getAvailableNetworks(onCompleted);
828:                     getPhoneFromRequest(request).getCallForwardingOption(
885:                     getPhoneFromRequest(request).setCallForwardingOption(
907:                     getPhoneFromRequest(request).getCallWaiting(onCompleted);
951:                     getPhoneFromRequest(request).setCallWaiting(isEnable, onCompleted);
1003:                     getPhoneFromRequest(request).selectNetworkManually(selArg.operatorInfo,
1198:                     getPhoneFromRequest(request).getNetworkSelectionMode(onCompleted);
1219:                     getPhoneFromRequest(request).queryCdmaRoamingPreference(onCompleted);
1235:                     getPhoneFromRequest(request).setCdmaRoamingPreference(mode, onCompleted);
1247:                     getPhoneFromRequest(request).setCdmaSubscription(subscriptionMode, onCompleted);
1362:                         mPhoneConfigurationManager.addToPhoneStatusCache(id,
1450:                     getPhoneFromRequest(request).getIccCard().changeIccLockPassword(
1468:                     getPhoneFromRequest(request).getIccCard().setIccLockEnabled(
1672:             return getPhoneFromSubId(request.subId);
1973:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
2048:             for (int i = 0; i < TelephonyManager.getDefault().getPhoneCount(); i++) {
2065:             for (int i = 0; i < TelephonyManager.getDefault().getPhoneCount(); i++) {
2067:                 shutdownRadioUsingPhoneId(i);
2597:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
2737:         return getActivePhoneTypeForSlot(getSlotForDefaultSubscription());
2767:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
2800:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
2831:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
2972:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
3140:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
3200:                     .enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3237:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3263:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3320:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3360:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3385:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3485:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3522:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3556:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3591:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3643:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3725:         TelephonyPermissions.enforeceCallingOrSelfReadPrecisePhoneStatePermissionOrCarrierPrivilege(
3807:         checkModifyPhoneStatePermission(subId, "setRcsProvisioningStatusForCapability");
3871:         checkModifyPhoneStatePermission(subId, "setImsProvisioningStatusForCapability");
4223:                 && !TelephonyPermissions.checkCallingOrSelfReadPhoneStateNoThrow(
4257:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
4282:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
4374:         return mSubscriptionController.getPhoneId(getDefaultSubscription());
4436:         return iccOpenLogicalChannelWithPermission(getPhoneFromSubId(subId), callingPackage, aid,
4449:         return iccOpenLogicalChannelWithPermission(getPhoneFromSlotIdOrThrowException(slotIndex),
4484:         return iccCloseLogicalChannelWithPermission(getPhoneFromSubId(subId), channel);
4491:         return iccCloseLogicalChannelWithPermission(getPhoneFromSlotIdOrThrowException(slotIndex),
4520:         return iccTransmitApduLogicalChannelWithPermission(getPhoneFromSubId(subId), channel, cla,
4534:                 getPhoneFromSlotIdOrThrowException(slotIndex), channel, cla, command, p1, p2, p3,
4573:         return iccTransmitApduBasicChannelWithPermission(getPhoneFromSubId(subId), callingPackage,
4589:                 getPhoneFromSlotIdOrThrowException(slotIndex), callingPackage, cla, command, p1,
4674:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
4712:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp, subId, callingPackage,
5093:                 .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
5440:                 .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
5489:                 .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
5787:         for (int i = 0; i < TelephonyManager.getDefault().getPhoneCount(); i++) {
5851:         enforceReadPrivilegedPermission("getPackagesWithCarrierPrivilegesForAllPhones");
5857:             for (int i = 0; i < TelephonyManager.getDefault().getPhoneCount(); i++) {
5937:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneNumber(
5964:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
5987:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
6196:                     .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
6246:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
6265:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
6402:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp, getDefaultSubscription(),
6403:                 callingPackage, callingFeatureId, "getSubIdForPhoneAccountHandle")) {
6638:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
7164:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
7321:             TelephonyPermissions.enforeceCallingOrSelfReadPhoneStatePermissionOrCarrierPrivilege(
7359:                 .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
7492:                         slot.getPhoneId(),
7628:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
7636:             return mPhoneConfigurationManager.getNumberOfModemsWithSimultaneousDataConnections();
7645:                 .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
7685:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
7712:                     .enforeceCallingOrSelfReadPrivilegedPhoneStatePermissionOrCarrierPrivilege(
7895:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
7930:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp,
7955:                 mPhoneConfigurationManager.getStaticPhoneCapability();
7995:             mPhoneConfigurationManager.switchMultiSimConfig(numOfSims);
8035:         if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
8042:             return mPhoneConfigurationManager.isRebootRequiredForModemConfigChange();
8051:         metrics.updateEnabledModemBitmap((1 << TelephonyManager.from(mApp).getPhoneCount()) - 1);
8065:                 if (SubscriptionManager.isValidPhoneId(slotInfos[i].getLogicalSlotIdx())) {
8180:                 SubscriptionManager.getPhoneId(subId), UiccController.APP_FAM_3GPP);
8298:                     ImsPhoneCallTracker imsPhoneCallTracker =
8300:                     imsPhoneCallTracker.setConferenceEventPackageEnabled(isCepEnabled);
android.googlesource.com/platform/superproject:frameworks/opt/telephony/src/java/com/android/internal/telephony/Phone.java: [ master, ]
117: public abstract class Phone extends Handler implements PhoneInternalInterface {
501:     protected Phone(String name, PhoneNotifier notifier, Context context, CommandsInterface ci,
518:     protected Phone(String name, PhoneNotifier notifier, Context context, CommandsInterface ci,
329:     protected Phone mImsPhone = null;
597:     public void createImsPhone() {
3519:     public Phone getImsPhone() {
4167:     public Phone getDefaultPhone() {
194:     protected static final int EVENT_UPDATE_PHONE_OBJECT            = 42;
295:     protected boolean mIsPhoneInEcmState = false;
326:     protected int mPhoneId;
441:     public String getPhoneName() {
445:     protected void setPhoneName(String name) {
1779:     public void updatePhoneObject(int voiceRadioTech) {
2630:     public abstract int getPhoneType();
3642:     public int getPhoneId() {
3650:     public int getVoicePhoneServiceState() {
107:  * A base implementation for the com.android.internal.telephony.Phone interface.
109:  * Note that implementations of Phone.java are expected to be used
118:     private static final String LOG_TAG = "Phone";
243:      * This method is invoked when the Phone exits Emergency Callback Mode.
293:     // Keep track of whether or not the phone is in Emergency Callback Mode for Phone and
436:      * Returns a string identifier for this phone interface for parties
437:      *  outside the phone app process.
492:      * Constructs a Phone in normal (non-unit test) mode.
503:         this(name, notifier, context, ci, unitTestMode, SubscriptionManager.DEFAULT_PHONE_INDEX,
508:      * Constructs a Phone in normal (non-unit test) mode.
516:      * @param phoneId the phone-id of this phone.
544:         * (i.e. voice) phone calls over the telephony network, and is allowed
571:         if (getPhoneType() == PhoneConstants.PHONE_TYPE_IMS) {
586:         if (getPhoneType() != PhoneConstants.PHONE_TYPE_SIP) {
598:         if (getPhoneType() == PhoneConstants.PHONE_TYPE_SIP) {
602:         synchronized(Phone.lockForRadioTechnologyChange) {
665:         // messages to be handled whether or not the phone is being destroyed
667:         // resources of the phone being destroyed
787:         Phone imsPhone = mImsPhone;
826:      * Gets the context for the phone, as set at initialization time.
882:      * Subclasses of Phone probably want to replace this with a
908:      * Subclasses of Phone probably want to replace this with a
932:      * Subclasses of Phone probably want to replace this with a
944:      * Notify the phone that an SMS has been sent. This will be used determine if the SMS was sent
958:      * Determine if the Phone has recently sent an emergency SMS and is still in the interval of
999:     protected void migrateFrom(Phone from) {
1012:         // The emergency state of IMS phone will be cleared in ImsPhone#notifySrvccState after
1075:      *   Connection.getCall() == Phone.getRingingCall()
1095:      * Notifies when phone's video capabilities changes <p>
1100:      *  AsyncResult.result = true if phone supports video calling <p>
1239:      * Example: If Phone.dial is called with "*#31#", then the app will
1551:      * For unit tests; don't send notifications to "Phone"
1568:      * Subclasses of Phone probably want to replace this with a
1673:         // no need for regular phone
1677:      * Subclasses of Phone probably want to replace this with a
1688:      * If this is a simulated phone interface, returns a SimulatedRadioControl.
1702:      * the thread that originally obtained this Phone instance.
1707:                     "com.android.internal.telephony.Phone must be used from within one thread");
1739:      * If the phone has an active call and call waiting occurs,
1740:      * then the phone state is RINGING not OFFHOOK
1749:      * Retrieves the IccFileHandler of the Phone instance
1768:      * Retrieves the Handler of the Phone instance
1775:      * Update the phone object if the voice radio technology has changed
1783:     * Retrieves the ServiceStateTracker of the phone instance.
1791:      * Retrieves the EmergencyNumberTracker of the phone instance.
1813:      * Retrieves the DeviceStateMonitor of the phone instance.
1820:      * Retrieves the DisplayInfoController of the phone instance.
1868:      * Returns the ICC card interface for this phone, or null
1874:         //throw new Exception("getIccCard Shouldn't be called from Phone");
2053:         if (getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA) {
2221:      * - {@link com.android.internal.telephony.Phone#TTY_MODE_OFF}
2222:      * - {@link com.android.internal.telephony.Phone#TTY_MODE_FULL}
2223:      * - {@link com.android.internal.telephony.Phone#TTY_MODE_HCO}
2224:      * - {@link com.android.internal.telephony.Phone#TTY_MODE_VCO}
2235:      * - {@link com.android.internal.telephony.Phone#TTY_MODE_OFF}
2236:      * - {@link com.android.internal.telephony.Phone#TTY_MODE_FULL}
2237:      * - {@link com.android.internal.telephony.Phone#TTY_MODE_HCO}
2238:      * - {@link com.android.internal.telephony.Phone#TTY_MODE_VCO}
2535:     // This property is used to handle phone process crashes, and is the same for CDMA and IMS
2542:      * @return {@code true} if we are in emergency call back mode. This is a period where the phone
2562:      * @return true if this Phone is in an emergency call that caused emergency callback mode to be
2570:      * Set whether or not this Phone has an active emergency call that was placed during emergency
2626:      * Return a numerical identifier for the phone radio interface.
2627:      * @return PHONE_TYPE_XXX as defined above.
2640:     /** sets the voice mail count of the phone and notifies listeners. */
3322:      * Subclasses of Phone probably want to replace this with a
3340:      * Notify registrants if phone is video capable.
3472:         Rlog.e(LOG_TAG, "Error! This function should never be executed, inactive Phone.");
3485:      * Gets the Uicc card corresponding to this phone.
3486:      * @return the UiccCard object corresponding to the phone ID.
3516:      * Return an instance of a IMS phone
3639:      * Returns the phone id.
3651:         Phone imsPhone = mImsPhone;
3725:         Phone imsPhone = mImsPhone;
3744:         Phone imsPhone = mImsPhone;
3758:         Phone imsPhone = mImsPhone;
3772:         Phone imsPhone = mImsPhone;
3782:      * @return the IMS MmTel Registration technology for this Phone, defined in
3786:         Phone imsPhone = mImsPhone;
3796:      * Get the IMS MmTel Registration technology for this Phone, defined in
3800:         Phone imsPhone = mImsPhone;
3809:      * Asynchronously get the IMS MmTel Registration state for this Phone.
3812:         Phone imsPhone = mImsPhone;
3870:      *  Set phone radio capability
3872:      *  @param rc the phone radio capability defined in
3881:      *  Get phone radio access family
3901:      *  Get phone radio capability
3915:      *  @param rc the phone radio capability currently in effect for this phone.
3948:      * Registers the handler when phone radio  capability is changed.
3959:      * Unregister for notifications when phone radio type and access technology is changed.
3994:      * Determines if video calling is enabled for the phone.
4000:         Phone imsPhone = mImsPhone;
4122:     public static void checkWfcWifiOnlyModeBeforeDial(Phone imsPhone, int phoneId, Context context)
4162:      * This function returns the parent phone of the current phone. It is applicable
4163:      * only for IMS phone (function is overridden by ImsPhone). For others the phone
4201:      * none of the phone is in service, and one of them has the capability to make the emergency
4208:         for (Phone phone : PhoneFactory.getPhones()) {
4209:             if (phone != null) {
4210:                 ServiceState ss = phone.getServiceStateTracker().getServiceState();
4211:                 // One of the phone is in service, hence the device is not emergency call only.
4282:     /** Returns the {@link VoiceCallSessionStats} for this phone ID. */
4287:     /** Sets the {@link VoiceCallSessionStats} mock for this phone ID during unit testing. */
4294:         pw.println("Phone: subId=" + getSubId());
4469:         pw.println("Phone Local Log: ");
51: import android.telephony.PhoneStateListener;
80: import com.android.internal.telephony.imsphone.ImsPhoneCall;
111:  * originally called PhoneFactory to obtain the interface.
416:      * PhoneNotifier is an abstraction for all system-wide
421:     protected PhoneNotifier mNotifier;
450:      * Retrieves Nai for phones. Returns null if Nai is not set.
519:                     boolean unitTestMode, int phoneId,
521:         mPhoneId = phoneId;
560:          * By default old phones won't have the property set but do generate
594:      * Start setup of ImsPhone, which will start trying to connect to the ImsResolver. Will not be
603:             if (mImsPhone == null) {
604:                 mImsPhone = PhoneFactory.makeImsPhone(mNotifier, this);
605:                 CallManager.getInstance().registerPhone(mImsPhone);
606:                 mImsPhone.registerForSilentRedial(
681:                     PhoneConstants.State state = getState();
683:                             && ((state == PhoneConstants.State.RINGING) ||
684:                                     (state == PhoneConstants.State.IDLE))) {
695:                 if (getState() == PhoneConstants.State.RINGING) {
713:                         if (mImsPhone != null) {
715:                             mImsPhone.notifyRedialConnectionChanged(cn);
719:                         if (mImsPhone != null) {
720:                             mImsPhone.notifyRedialConnectionChanged(null);
794:                     if (imsPhone != null) {
795:                         conn = imsPhone.getHandoverConnection();
796:                         migrateFrom(imsPhone);
798:                         Rlog.d(LOG_TAG, "HANDOVER_STARTED: mImsPhone null");
803:                     if (imsPhone != null) {
804:                         imsPhone.notifySrvccState(srvccState);
806:                         Rlog.d(LOG_TAG, "HANDOVER_COMPLETED: mImsPhone null");
859:      * {@link PhoneConstants.State} which can be obtained using the {@link PhoneStateListener}
1029:             // Since CallManager has already registered with both CS and IMS phones,
1746:     public abstract PhoneConstants.State getState();
1944:      * Sets the minimum time in milli-seconds between {@link PhoneStateListener#onCellInfoChanged
1945:      * PhoneStateListener.onCellInfoChanged} will be invoked.
1960:      * available on this interface. Use PhoneStateNotifier or similar instead.
2048:      * available on this interface. Use PhoneStateNotifier or similar instead.
2090:      * interface. Use <code>PhoneStateNotifier</code> or an equivalent.
2460:     public PhoneConstants.DataState getDataConnectionState(String apnType) {
2461:         return PhoneConstants.DataState.DISCONNECTED;
2536:     // phones
2616:         if (mImsPhone != null) {
2617:             isPresent = isVideoCallOrConference(mImsPhone.getForegroundCall()) ||
2618:                     isVideoCallOrConference(mImsPhone.getBackgroundCall()) ||
2619:                     isVideoCallOrConference(mImsPhone.getRingingCall());
2761:      * Retrieves the MIN for CDMA phones.
2777:      *  Retrieves PRL Version for CDMA phones
3416:      * Retrieves the MSISDN from the UICC. For GSM/UMTS phones, this is equivalent to
3417:      * {@link #getLine1Number()}. For CDMA phones, {@link #getLine1Number()} returns
3418:      * the MDN, so this method is provided to return the MSISDN on CDMA/LTE phones.
3426:      * Retrieves the EF_PNN from the UICC For GSM/UMTS phones.
3435:      * {@link android.telephony.PhoneStateListener} instead.
3438:     public PhoneConstants.DataState getDataConnectionState() {
3439:         return getDataConnectionState(PhoneConstants.APN_TYPE_DEFAULT);
3456:      * @return {@link PhoneConstants#LTE_ON_CDMA_UNKNOWN}, {@link PhoneConstants#LTE_ON_CDMA_FALSE}
3457:      * or {@link PhoneConstants#LTE_ON_CDMA_TRUE}
3471:         // This function should be overridden by class GsmCdmaPhone.
3520:         return mImsPhone;
3586:      * Return if UT capability of ImsPhone is enabled or not
3590:         if (mImsPhone != null) {
3591:             return mImsPhone.isUtEnabled();
3610:         // dialInternal shall be overriden by GsmCdmaPhone
3615:      * This function is for CSFB SS. GsmCdmaPhone overrides this function.
3647:      * Return the service state of mImsPhone if it is STATE_IN_SERVICE
3652:         if (imsPhone != null
3653:                 && imsPhone.getServiceState().getState() == ServiceState.STATE_IN_SERVICE) {
3727:         if (imsPhone != null) {
3728:             isImsRegistered = imsPhone.isImsRegistered();
3746:         if (imsPhone != null) {
3747:             isWifiCallingEnabled = imsPhone.isWifiCallingEnabled();
3760:         if (imsPhone != null) {
3761:             isAvailable = imsPhone.isImsCapabilityAvailable(capability, regTech);
3774:         if (imsPhone != null) {
3775:             isVolteEnabled = imsPhone.isVolteEnabled();
3788:         if (imsPhone != null) {
3789:             regTech = imsPhone.getImsRegistrationTech();
3801:         if (imsPhone != null) {
3802:             imsPhone.getImsRegistrationTech(callback);
3813:         if (imsPhone != null) {
3814:             imsPhone.getImsRegistrationState(callback);
3931:         int type = PhoneFactory.calculatePreferredNetworkType(mContext, getSubId());
3942:             int type = PhoneFactory.calculatePreferredNetworkType(mContext, getSubId());
3986:         if (mImsPhone == null) {
3990:         return mImsPhone.isImsAvailable();
4001:         if (imsPhone != null) {
4002:             return imsPhone.isVideoEnabled();
4124:         if (imsPhone == null || !imsPhone.isWifiCallingEnabled()) {
4125:             ImsManager imsManager = ImsManager.getInstance(context, phoneId);
4333:         if (mImsPhone != null) {
4335:                 mImsPhone.dump(fd, pw, args);
417:      * state change notification. DefaultPhoneNotifier is
494:      * @param notifier An instance of DefaultPhoneNotifier,
510:      * @param notifier An instance of DefaultPhoneNotifier,
2417:         // This function is added to send the notification to DefaultPhoneNotifier.
2547:         return mIsPhoneInEcmState;
2558:         mIsPhoneInEcmState = isInEcm;
2602:         if (call instanceof ImsPhoneCall) {
2603:             ImsPhoneCall imsPhoneCall = (ImsPhoneCall) call;
2604:             ImsCall imsCall = imsPhoneCall.getImsCall();
2658:                 mPhoneId, UiccController.APP_FAM_3GPP);
3392:      * A fucntion of type getPhoneProp(propType) where propType is an
3490:         return mUiccController.getUiccCard(mPhoneId);
3635:         return SubscriptionController.getInstance().getSubIdUsingPhoneId(mPhoneId);
3643:         return mPhoneId;
3973:         ImsManager imsManager = ImsManager.getInstance(mContext, mPhoneId);
4295:         pw.println(" mPhoneId=" + mPhoneId);
4322:         pw.println(" getPhoneName()=" + getPhoneName());
4323:         pw.println(" getPhoneType()=" + getPhoneType());
android.googlesource.com/platform/frameworks/opt/telephony:src/java/com/android/internal/telephony/Phone.java: [ master, ] Duplicate result
chromium.googlesource.com/android_tools:sdk/sources/android-25/com/android/internal/telephony/Phone.java: [ master, ]
88: public abstract class Phone extends Handler implements PhoneInternalInterface {
410:     protected Phone(String name, PhoneNotifier notifier, Context context, CommandsInterface ci,
427:     protected Phone(String name, PhoneNotifier notifier, Context context, CommandsInterface ci,
256:     protected Phone mImsPhone = null;
2823:     public Phone getImsPhone() {
2837:     private void updateImsPhone() {
3308:     public Phone getDefaultPhone() {
184:     protected static final int EVENT_UPDATE_PHONE_OBJECT            = 42;
253:     protected int mPhoneId;
341:     public String getPhoneName() {
345:     protected void setPhoneName(String name) {
1508:     public void updatePhoneObject(int voiceRadioTech) {
2098:     public abstract int getPhoneType();
2886:     public int getPhoneId() {
2894:     public int getVoicePhoneServiceState() {
78:  * A base implementation for the com.android.internal.telephony.Phone interface.
80:  * Note that implementations of Phone.java are expected to be used
89:     private static final String LOG_TAG = "Phone";
97:             if (intent.hasExtra(ImsManager.EXTRA_PHONE_ID)) {
98:                 int extraPhoneId = intent.getIntExtra(ImsManager.EXTRA_PHONE_ID,
99:                         SubscriptionManager.INVALID_PHONE_INDEX);
101:                 if (extraPhoneId == SubscriptionManager.INVALID_PHONE_INDEX ||
107:             synchronized (Phone.lockForRadioTechnologyChange) {
337:      * Returns a string identifier for this phone interface for parties
338:      *  outside the phone app process.
401:      * Constructs a Phone in normal (non-unit test) mode.
412:         this(name, notifier, context, ci, unitTestMode, SubscriptionManager.DEFAULT_PHONE_INDEX,
417:      * Constructs a Phone in normal (non-unit test) mode.
425:      * @param phoneId the phone-id of this phone.
451:         * (i.e. voice) phone calls over the telephony network, and is allowed
477:         if (getPhoneType() == PhoneConstants.PHONE_TYPE_IMS) {
504:         if (getPhoneType() != PhoneConstants.PHONE_TYPE_SIP) {
516:         if (getPhoneType() == PhoneConstants.PHONE_TYPE_SIP) {
520:         synchronized(Phone.lockForRadioTechnologyChange) {
549:         // messages to be handled whether or not the phone is being destroyed
551:         // resources of the phone being destroyed
657:         Phone imsPhone = mImsPhone;
697:      * Gets the context for the phone, as set at initialization time.
750:      * Subclasses of Phone probably want to replace this with a
776:      * Subclasses of Phone probably want to replace this with a
787:     protected void migrateFrom(Phone from) {
852:      *   Connection.getCall() == Phone.getRingingCall()
870:      * Notifies when phone's video capabilities changes <p>
875:      *  AsyncResult.result = true if phone supports video calling <p>
1010:      * Example: If Phone.dial is called with "*#31#", then the app will
1303:      * For unit tests; don't send notifications to "Phone"
1320:      * Subclasses of Phone probably want to replace this with a
1405:         // no need for regular phone
1409:      * Subclasses of Phone probably want to replace this with a
1420:      * If this is a simulated phone interface, returns a SimulatedRadioControl.
1434:      * the thread that originally obtained this Phone instance.
1439:                     "com.android.internal.telephony.Phone must be used from within one thread");
1470:      * If the phone has an active call and call waiting occurs,
1471:      * then the phone state is RINGING not OFFHOOK
1479:      * Retrieves the IccFileHandler of the Phone instance
1497:      * Retrieves the Handler of the Phone instance
1504:      * Update the phone object if the voice radio technology has changed
1512:     * Retrieves the ServiceStateTracker of the phone instance.
1541:      * Returns the ICC card interface for this phone, or null
1546:         //throw new Exception("getIccCard Shouldn't be called from Phone");
1717:         if (getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA) {
1850:      * - {@link com.android.internal.telephony.Phone#TTY_MODE_OFF}
1851:      * - {@link com.android.internal.telephony.Phone#TTY_MODE_FULL}
1852:      * - {@link com.android.internal.telephony.Phone#TTY_MODE_HCO}
1853:      * - {@link com.android.internal.telephony.Phone#TTY_MODE_VCO}
1864:      * - {@link com.android.internal.telephony.Phone#TTY_MODE_OFF}
1865:      * - {@link com.android.internal.telephony.Phone#TTY_MODE_FULL}
1866:      * - {@link com.android.internal.telephony.Phone#TTY_MODE_HCO}
1867:      * - {@link com.android.internal.telephony.Phone#TTY_MODE_VCO}
2058:      * @return {@code true} if we are in emergency call back mode. This is a period where the phone
2095:      * Return a numerical identifier for the phone radio interface.
2096:      * @return PHONE_TYPE_XXX as defined above.
2108:     /** sets the voice mail count of the phone and notifies listeners. */
2577:      *  @return The string array will always return at least one entry, Phone.APN_TYPE_DEFAULT.
2655:      * Subclasses of Phone probably want to replace this with a
2673:      * Notify registrants if phone is video capable.
2786:         Rlog.e(LOG_TAG, "Error! This function should never be executed, inactive Phone.");
2799:      * Gets the Uicc card corresponding to this phone.
2800:      * @return the UiccCard object corresponding to the phone ID.
2821:      * Return an instance of a IMS phone
2884:      * Returns the phone id.
2895:         Phone imsPhone = mImsPhone;
2969:         Phone imsPhone = mImsPhone;
2987:         Phone imsPhone = mImsPhone;
3000:         Phone imsPhone = mImsPhone;
3052:      *  Set phone radio capability
3054:      *  @param rc the phone radio capability defined in
3063:      *  Get phone radio access family
3083:      *  Get phone radio capability
3097:      *  @param rc the phone radio capability currently in effect for this phone.
3128:      * Registers the handler when phone radio  capability is changed.
3139:      * Unregister for notifications when phone radio type and access technology is changed.
3163:      * Determines if video calling is enabled for the phone.
3168:         Phone imsPhone = mImsPhone;
3268:     public static void checkWfcWifiOnlyModeBeforeDial(Phone imsPhone, Context context)
3303:      * This function returns the parent phone of the current phone. It is applicable
3304:      * only for IMS phone (function is overridden by ImsPhone). For others the phone
3335:         pw.println("Phone: subId=" + getSubId());
44: import android.telephony.PhoneStateListener;
82:  * originally called PhoneFactory to obtain the interface.
110:                     updateImsPhone();
114:                     updateImsPhone();
322:      * PhoneNotifier is an abstraction for all system-wide
326:     protected PhoneNotifier mNotifier;
350:      * Retrieves Nai for phones. Returns null if Nai is not set.
428:                     boolean unitTestMode, int phoneId,
430:         mPhoneId = phoneId;
465:          * By default old phones won't have the property set but do generate
532:                 updateImsPhone();
565:                     PhoneConstants.State state = getState();
567:                             && ((state == PhoneConstants.State.RINGING) ||
568:                                     (state == PhoneConstants.State.IDLE))) {
579:                 if (getState() == PhoneConstants.State.RINGING) {
664:                     if (imsPhone != null) {
665:                         conn = imsPhone.getHandoverConnection();
666:                         migrateFrom(imsPhone);
668:                         Rlog.d(LOG_TAG, "HANDOVER_STARTED: mImsPhone null");
673:                     if (imsPhone != null) {
674:                         imsPhone.notifySrvccState(srvccState);
676:                         Rlog.d(LOG_TAG, "HANDOVER_COMPLETED: mImsPhone null");
729:      * {@link PhoneConstants.State} which can be obtained using the {@link PhoneStateListener}
808:             // Since CallManager has already registered with both CS and IMS phones,
1476:     public abstract PhoneConstants.State getState();
1621:      * Sets the minimum time in milli-seconds between {@link PhoneStateListener#onCellInfoChanged
1622:      * PhoneStateListener.onCellInfoChanged} will be invoked.
1636:      * available on this interface. Use PhoneStateNotifier or similar instead.
1712:      * available on this interface. Use PhoneStateNotifier or similar instead.
1747:      * interface. Use <code>PhoneStateNotifier</code> or an equivalent.
2019:             PhoneConstants.DataState state) {
2085:         if (mImsPhone != null) {
2086:             isVideoCallActive = isVideoCall(mImsPhone.getForegroundCall()) ||
2087:                     isVideoCall(mImsPhone.getBackgroundCall()) ||
2088:                     isVideoCall(mImsPhone.getRingingCall());
2195:      * Retrieves the MIN for CDMA phones.
2211:      *  Retrieves PRL Version for CDMA phones
2623:         return isDataConnectivityPossible(PhoneConstants.APN_TYPE_DEFAULT);
2736:      * Retrieves the MSISDN from the UICC. For GSM/UMTS phones, this is equivalent to
2737:      * {@link #getLine1Number()}. For CDMA phones, {@link #getLine1Number()} returns
2738:      * the MDN, so this method is provided to return the MSISDN on CDMA/LTE phones.
2747:      * {@link android.telephony.PhoneStateListener} instead.
2749:     public PhoneConstants.DataState getDataConnectionState() {
2750:         return getDataConnectionState(PhoneConstants.APN_TYPE_DEFAULT);
2770:      * @return {@link PhoneConstants#LTE_ON_CDMA_UNKNOWN}, {@link PhoneConstants#LTE_ON_CDMA_FALSE}
2771:      * or {@link PhoneConstants#LTE_ON_CDMA_TRUE}
2785:         // This function should be overridden by class GsmCdmaPhone.
2824:         return mImsPhone;
2828:      * Return if UT capability of ImsPhone is enabled or not
2838:         Rlog.d(LOG_TAG, "updateImsPhone"
2841:         if (mImsServiceReady && (mImsPhone == null)) {
2842:             mImsPhone = PhoneFactory.makeImsPhone(mNotifier, this);
2843:             CallManager.getInstance().registerPhone(mImsPhone);
2844:             mImsPhone.registerForSilentRedial(
2846:         } else if (!mImsServiceReady && (mImsPhone != null)) {
2847:             CallManager.getInstance().unregisterPhone(mImsPhone);
2848:             mImsPhone.unregisterForSilentRedial(this);
2850:             mImsPhone.dispose();
2851:             // Potential GC issue if someone keeps a reference to ImsPhone.
2854:             //mImsPhone.removeReferences();
2855:             mImsPhone = null;
2872:         // dialInternal shall be overriden by GsmCdmaPhone
2891:      * Return the service state of mImsPhone if it is STATE_IN_SERVICE
2896:         if (imsPhone != null
2897:                 && imsPhone.getServiceState().getState() == ServiceState.STATE_IN_SERVICE) {
2971:         if (imsPhone != null) {
2972:             isImsRegistered = imsPhone.isImsRegistered();
2989:         if (imsPhone != null) {
2990:             isWifiCallingEnabled = imsPhone.isWifiCallingEnabled();
3002:         if (imsPhone != null) {
3003:             isVolteEnabled = imsPhone.isVolteEnabled();
3111:         int type = PhoneFactory.calculatePreferredNetworkType(mContext, getSubId());
3122:             int type = PhoneFactory.calculatePreferredNetworkType(mContext, getSubId());
3169:         if ((imsPhone != null)
3170:                 && (imsPhone.getServiceState().getState() == ServiceState.STATE_IN_SERVICE)) {
3171:             return imsPhone.isVideoEnabled();
3270:         if (imsPhone == null || !imsPhone.isWifiCallingEnabled()) {
3313:         if (mImsPhone == null) return 0;
3314:         return mImsPhone.getVtDataUsage();
3373:         if (mImsPhone != null) {
3375:                 mImsPhone.dump(fd, pw, args);
100:                 Rlog.d(LOG_TAG, "mImsIntentReceiver: extraPhoneId = " + extraPhoneId);
102:                         extraPhoneId != getPhoneId()) {
111:                     ImsManager.updateImsServiceConfig(mContext, mPhoneId, false);
323:      * state change notification. DefaultPhoneNotifier is
403:      * @param notifier An instance of DefaultPhoneNotifier,
419:      * @param notifier An instance of DefaultPhoneNotifier,
529:             ImsManager imsManager = ImsManager.getInstance(mContext, getPhoneId());
533:                 ImsManager.updateImsServiceConfig(mContext, mPhoneId, false);
1294:         editor.putInt(CLIR_KEY + getPhoneId(), commandInterfaceCLIRMode);
2014:         // This function is added to send the notification to DefaultPhoneNotifier.
2714:      * A fucntion of type getPhoneProp(propType) where propType is an
2803:         return mUiccController.getUiccCard(mPhoneId);
2880:         return SubscriptionController.getInstance().getSubIdUsingPhoneId(mPhoneId);
2887:         return mPhoneId;
3336:         pw.println(" mPhoneId=" + mPhoneId);
3364:         pw.println(" getPhoneName()=" + getPhoneName());
3365:         pw.println(" getPhoneType()=" + getPhoneType());
chromium.googlesource.com/arc/arc:third_party/android/frameworks/opt/telephony/src/java/com/android/internal/telephony/Phone.java: [ master, ]
47: public interface Phone {
50:     static final boolean DEBUG_PHONE = true;
1815:     public Phone getImsPhone();
1822:     public ImsPhone relinquishOwnershipOfImsPhone();
1828:     public void acquireOwnershipOfImsPhone(ImsPhone imsPhone);
262:     String getPhoneName();
268:     int getPhoneType();
1417:     public PhoneSubInfo getPhoneSubInfo();
1422:     public IccPhoneBookInterfaceManager getIccPhoneBookInterfaceManager();
1750:     void updatePhoneObject(int voiceRadioTech);
1798:     public int getPhoneId();
1834:     int getVoicePhoneServiceState();
41:  * Internal interface used to control the phone; SDK developers cannot
122:     // Note NT_* substitute RILConstants.NETWORK_MODE_* above the Phone
228:      * Gets the context for the phone, as set at initialization time.
248:      * If the phone has an active call and call waiting occurs,
249:      * then the phone state is RINGING not OFFHOOK
258:      * Returns a string identifier for this phone interface for parties
259:      *  outside the phone app process.
265:      * Return a numerical identifier for the phone radio interface.
266:      * @return PHONE_TYPE_XXX as defined above.
273:      *  @return The string array will always return at least one entry, Phone.APN_TYPE_DEFAULT.
354:      *   Connection.getCall() == Phone.getRingingCall()
450:      * Example: If Phone.dial is called with "*#31#", then the app will
649:      * Returns the ICC card interface for this phone, or null
689:      * Whether or not the phone can conference in the current phone
691:      * @return true if the phone can conference; false otherwise.
723:      * Whether or not the phone can do explicit call transfer in the current
724:      * phone state--that is, one call holding and one call active.
725:      * @return true if the phone can do explicit call transfer; false otherwise.
755:      * of this phone. It is never null.<p>
772:      * of this phone object . It is never null.<p>
789:      * of this phone. It is never null.<p>
918:      * Get the line 1 phone number (MSISDN). For CDMA phones, the MDN is returned
921:      * @return phone number. May return null if not
934:      * Sets the MSISDN phone number in the SIM card.
936:      * @param alphaTag the alpha tag associated with the MSISDN phone number
938:      * @param number the new MSISDN phone number to be set on the SIM.
944:      * Get the voice mail access phone number. Typically dialed when the
945:      * user holds the "1" key in the phone app. May return null if not
1006:      * @param dialingNumber is the target phone number to forward calls to
1189:      * as a change notifcation, although presently phone state changed is not
1261:      * For unit tests; don't send notifications to "Phone"
1331:      * If this is a simulated phone interface, returns a SimulatedRadioControl.
1415:      * Retrieves the PhoneSubInfo of the Phone
1420:      * Retrieves the IccPhoneBookInterfaceManager of the Phone
1428:      * - {@link com.android.internal.telephony.Phone#TTY_MODE_OFF}
1429:      * - {@link com.android.internal.telephony.Phone#TTY_MODE_FULL}
1430:      * - {@link com.android.internal.telephony.Phone#TTY_MODE_HCO}
1431:      * - {@link com.android.internal.telephony.Phone#TTY_MODE_VCO}
1729:      * Gets the Uicc card corresponding to this phone.
1730:      * @return the UiccCard object corresponding to the phone ID.
1746:      * Update the phone object if the voice radio technology has changed
1796:      * Returns the phone id.
1812:      * Return the ImsPhone phone co-managed with this phone
1813:      * @return an instance of an ImsPhone phone
1819:      * the phone.
1820:      * @return the instance of the ImsPhone phone previously owned
26: import android.telephony.PhoneStateListener;
30: import com.android.internal.telephony.imsphone.ImsPhone;
36: import com.android.internal.telephony.PhoneConstants.*; // ????
194:      * Sets the minimum time in milli-seconds between {@link PhoneStateListener#onCellInfoChanged
195:      * PhoneStateListener.onCellInfoChanged} will be invoked.
208:      * {@link android.telephony.PhoneStateListener} instead.
215:      * {@link android.telephony.PhoneStateListener} instead.
296:      * interface. Use <code>PhoneStateNotifier</code> or an equivalent.
330:      * {@link PhoneConstants.State} which can be obtained using the {@link PhoneStateListener}
803:      * assigned) until PhoneStateChanged notification has occurred.
818:      * PhoneStateChanged notification has occurred.
903:      * available on this interface. Use PhoneStateNotifier or similar instead.
911:      * available on this interface. Use PhoneStateNotifier or similar instead.
919:      * and {@link #getMsisdn()} will return the MSISDN on CDMA/LTE phones.<p>
1175:      * Mutes or unmutes the microphone for the active call. The microphone
1179:      * @param muted true to mute the microphone,
1180:      * false to activate the microphone.
1348:      * Retrieves the unique device ID, e.g., IMEI for GSM phones and MEID for CDMA phones.
1354:      * for GSM phones.
1359:      * Retrieves the unique subscriber ID, e.g., IMSI for GSM phones.
1364:      * Retrieves the Group Identifier Level1 for GSM phones.
1376:      * Retrieves the MIN for CDMA phones.
1388:      *  Retrieves PRL Version for CDMA phones
1393:      * Retrieves the ESN for CDMA phones.
1398:      * Retrieves MEID for CDMA phones.
1403:      * Retrieves the MSISDN from the UICC. For GSM/UMTS phones, this is equivalent to
1404:      * {@link #getLine1Number()}. For CDMA phones, {@link #getLine1Number()} returns
1405:      * the MDN, so this method is provided to return the MSISDN on CDMA/LTE phones.
1410:      * Retrieves IMEI for phones. Returns null if IMEI is not set.
1690:      * @return {@link PhoneConstants#LTE_ON_CDMA_UNKNOWN}, {@link PhoneConstants#LTE_ON_CDMA_FALSE}
1691:      * or {@link PhoneConstants#LTE_ON_CDMA_TRUE}
1818:      * Release the local instance of the ImsPhone and disconnect from
1825:      * Take ownership and wire-up the input ImsPhone
1826:      * @param imsPhone ImsPhone to be used.
1831:      * Return the service state of mImsPhone if it is STATE_IN_SERVICE
1697:      * A fucntion of type getPhoneProp(propType) where propType is an
github.com/angular/angular.io:public/docs/_examples/upgrade-phonecat-3-router/ts/app/core/phone/phone.service.ts: [ master, ]
18: export class Phone {
11: export interface PhoneData {
30: angular.module('core.phone')
31:   .factory('phone', downgradeInjectable(Phone));
20:   query(): Observable<PhoneData[]> {
21:     return this.http.get(`phones/phones.json`)
24:   get(id: string): Observable<PhoneData> {
25:     return this.http.get(`phones/${id}.json`)
github.com/angular/angular.io:public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/core/phone/phone.service.ts: [ master, ]
24: export class Phone {
14: export interface PhoneData {
40: angular.module('core.phone')
41:   .factory('phone', downgradeInjectable(Phone));
13: // #docregion phonedata-interface
19: // #enddocregion phonedata-interface
27:   query(): Observable<PhoneData[]> {
28:     return this.http.get(`phones/phones.json`)
31:   get(id: string): Observable<PhoneData> {
32:     return this.http.get(`phones/${id}.json`)
github.com/angular/angular-cn:public/docs/_examples/upgrade-phonecat-3-router/ts/app/core/phone/phone.service.ts: [ master, ] Duplicate result
github.com/angular/angular-cn:public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/core/phone/phone.service.ts: [ master, ] Duplicate result
github.com/angular/angular.io:public/docs/_examples/upgrade-phonecat-4-final/ts/app/core/phone/phone.service.ts: [ master, ]
15: export class Phone {
8: export interface PhoneData {
17:   query(): Observable<PhoneData[]> {
18:     return this.http.get(`phones/phones.json`)
21:   get(id: string): Observable<PhoneData> {
22:     return this.http.get(`phones/${id}.json`)
github.com/angular/angular-cn:public/docs/_examples/upgrade-phonecat-4-final/ts/app/core/phone/phone.service.ts: [ master, ] Duplicate result
github.com/angular/angular-ko:public/docs/_examples/upgrade-phonecat-3-router/ts/app/core/phone/phone.service.ts: [ master, ] Duplicate result
github.com/angular/angular-ko:public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/core/phone/phone.service.ts: [ master, ] Duplicate result
github.com/apache/struts-examples:json-customize/src/main/java/org/demo/Phone.java: [ master, ]
3: public class Phone {
github.com/angular/angular-ko:public/docs/_examples/upgrade-phonecat-4-final/ts/app/core/phone/phone.service.ts: [ master, ] Duplicate result
github.com/angular/angular-fr:public/docs/_examples/upgrade-phonecat-3-final/ts/app/core/phone/phone.service.ts: [ master, ]
19: export class Phone {
9: export interface PhoneData {
8: // #docregion phonedata-interface
14: // #enddocregion phonedata-interface
22:   query(): Observable<PhoneData[]> {
23:     return this.http.get(`phones/phones.json`)
26:   get(id: string): Observable<PhoneData> {
27:     return this.http.get(`phones/${id}.json`)
github.com/angular/angular-fr:public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/core/phone/phone.service.ts: [ master, ] Duplicate result
github.com/angular/angular-es:public/docs/_examples/upgrade-phonecat-3-final/ts/app/core/phone/phone.service.ts: [ master, ] Duplicate result
github.com/angular/angular-pt:public/docs/_examples/upgrade-phonecat-3-final/ts/app/core/phone/phone.service.ts: [ master, ] Duplicate result
github.com/angular/angular-es:public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/core/phone/phone.service.ts: [ master, ] Duplicate result
github.com/angular/angular-pt:public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/core/phone/phone.service.ts: [ master, ] Duplicate result
github.com/apache/dubbo-samples:java/dubbo-samples-compatible/src/main/java/org/apache/dubbo/samples/basic/api/Phone.java: [ master, ]
23: public class Phone implements Serializable {
46:         return "Phone{" +
github.com/angular/angular:aio/content/examples/upgrade-phonecat-2-hybrid/app/core/phone/phone.service.ts: [ master, ]
22: export class Phone {
12: export interface PhoneData {
36: angular.module('core.phone')
37:   .factory('phone', downgradeInjectable(Phone));
11: // #docregion phonedata-interface
17: // #enddocregion phonedata-interface
25:   query(): Observable<PhoneData[]> {
26:     return this.http.get<PhoneData[]>(`phones/phones.json`);
28:   get(id: string): Observable<PhoneData> {
29:     return this.http.get<PhoneData>(`phones/${id}.json`);
github.com/angular/angular:aio/content/examples/upgrade-phonecat-3-final/app/core/phone/phone.service.ts: [ master, ]
13: export class Phone {
6: export interface PhoneData {
15:   query(): Observable<PhoneData[]> {
16:     return this.http.get<PhoneData[]>(`phones/phones.json`);
18:   get(id: string): Observable<PhoneData> {
19:     return this.http.get<PhoneData>(`phones/${id}.json`);
github.com/googleapis/google-cloud-php:Talent/src/V4beta1/Phone.php: [ master, ]
16: class Phone extends \Google\Protobuf\Internal\Message
14:  * Generated from protobuf message <code>google.cloud.talent.v4beta1.Phone</code>
19:      * The usage of the phone. For example, SCHOOL, WORK, PERSONAL.
25:      * The phone type. For example, LANDLINE, MOBILE, FAX.
27:      * Generated from protobuf field <code>.google.cloud.talent.v4beta1.Phone.PhoneType type = 2;</code>
31:      * Phone number.
32:      * Any phone formats are supported and only exact matches are performed on
33:      * searches. For example, if a phone number in profile is provided in the
34:      * format of "(xxx)xxx-xxxx", in profile searches the same phone format
56:      *           The usage of the phone. For example, SCHOOL, WORK, PERSONAL.
58:      *           The phone type. For example, LANDLINE, MOBILE, FAX.
60:      *           Phone number.
61:      *           Any phone formats are supported and only exact matches are performed on
62:      *           searches. For example, if a phone number in profile is provided in the
63:      *           format of "(xxx)xxx-xxxx", in profile searches the same phone format
77:      * The usage of the phone. For example, SCHOOL, WORK, PERSONAL.
88:      * The usage of the phone. For example, SCHOOL, WORK, PERSONAL.
103:      * The phone type. For example, LANDLINE, MOBILE, FAX.
105:      * Generated from protobuf field <code>.google.cloud.talent.v4beta1.Phone.PhoneType type = 2;</code>
114:      * The phone type. For example, LANDLINE, MOBILE, FAX.
116:      * Generated from protobuf field <code>.google.cloud.talent.v4beta1.Phone.PhoneType type = 2;</code>
122:         GPBUtil::checkEnum($var, \Google\Cloud\Talent\V4beta1\Phone_PhoneType::class);
129:      * Phone number.
130:      * Any phone formats are supported and only exact matches are performed on
131:      * searches. For example, if a phone number in profile is provided in the
132:      * format of "(xxx)xxx-xxxx", in profile searches the same phone format
145:      * Phone number.
146:      * Any phone formats are supported and only exact matches are performed on
147:      * searches. For example, if a phone number in profile is provided in the
148:      * format of "(xxx)xxx-xxxx", in profile searches the same phone format
12:  * Resource that represents a person's telephone number.
android.googlesource.com/platform/packages/apps/Bluetooth:src/com/android/bluetooth/pbapclient/PhonebookEntry.java: [ master, ]
80:     public static class Phone {
27: public class PhonebookEntry {
119:     public PhonebookEntry() {
124:     public PhonebookEntry(VCardEntry v) {
170:     public List<Phone> phones;
86:             if (!(o instanceof Phone)) {
90:             Phone p = (Phone) o;
103:             sb.append(" Phone: { number: ");
121:         phones = new ArrayList<Phone>();
126:         phones = new ArrayList<Phone>();
141:             Phone phone = new Phone();
142:             phone.type = p.getType();
143:             phone.number = p.getNumber();
144:             phones.add(phone);
113:         if (object instanceof PhonebookEntry) {