dial
is not appropriate).
*
* @param dialString the MMI command to be executed.
* @return true if MMI command is executed.
*/
@UnsupportedAppUsage
boolean handlePinMmi(String dialString);
/**
* Handles USSD commands.
*
* @param subId The subscription to use.
* @param ussdRequest the USSD command to be executed.
* @param wrappedCallback receives a callback result.
*/
void handleUssdRequest(int subId, String ussdRequest, in ResultReceiver wrappedCallback);
/**
* Handles PIN MMI commands (PIN/PIN2/PUK/PUK2), which are initiated
* without SEND (so dial
is not appropriate) for
* a particular subId.
* @param dialString the MMI command to be executed.
* @param subId user preferred subId.
* @return true if MMI command is executed.
*/
@UnsupportedAppUsage
boolean handlePinMmiForSubscriber(int subId, String dialString);
/**
* Toggles the radio on or off.
*/
@UnsupportedAppUsage
void toggleRadioOnOff();
/**
* Toggles the radio on or off on particular subId.
* @param subId user preferred subId.
*/
void toggleRadioOnOffForSubscriber(int subId);
/**
* Set the radio to on or off
*/
@UnsupportedAppUsage
boolean setRadio(boolean turnOn);
/**
* Set the radio to on or off on particular subId.
* @param subId user preferred subId.
*/
boolean setRadioForSubscriber(int subId, boolean turnOn);
/**
* Set the radio to on or off unconditionally
*/
boolean setRadioPower(boolean turnOn);
/**
* Request to update location information in service state
*/
@UnsupportedAppUsage
void updateServiceLocation();
/**
* Request to update location information for a subscrition in service state
* @param subId user preferred subId.
*/
void updateServiceLocationForSubscriber(int subId);
/**
* Enable location update notifications.
*/
@UnsupportedAppUsage
void enableLocationUpdates();
/**
* Enable location update notifications.
* @param subId user preferred subId.
*/
void enableLocationUpdatesForSubscriber(int subId);
/**
* Disable location update notifications.
*/
@UnsupportedAppUsage
void disableLocationUpdates();
/**
* Disable location update notifications.
* @param subId user preferred subId.
*/
void disableLocationUpdatesForSubscriber(int subId);
/**
* Allow mobile data connections.
*/
@UnsupportedAppUsage
boolean enableDataConnectivity();
/**
* Disallow mobile data connections.
*/
@UnsupportedAppUsage
boolean disableDataConnectivity();
/**
* Report whether data connectivity is possible.
*/
boolean isDataConnectivityPossible(int subId);
Bundle getCellLocation(String callingPkg);
/**
* Returns the ISO country code equivalent of the current registered
* operator's MCC (Mobile Country Code).
* @see android.telephony.TelephonyManager#getNetworkCountryIso
*/
String getNetworkCountryIsoForPhone(int phoneId);
/**
* Returns the neighboring cell information of the device.
*/
ListRequires Permission: * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE} or that the calling * app has carrier privileges (see {@link #hasCarrierPrivileges}). * * @param slotIndex - device slot. * @return {@code true} on success; {@code false} on any failure. */ boolean resetModemConfig(int slotIndex); /** * Generate a radio modem reset. Used for device configuration by some CDMA operators. * Different than {@link #setRadioPower(boolean)}, modem reboot will power down sim card. * *
Requires Permission:
* {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE} or that the calling
* app has carrier privileges (see {@link #hasCarrierPrivileges}).
*
* @param slotIndex - device slot.
* @return {@code true} on success; {@code false} on any failure.
*/
boolean rebootModem(int slotIndex);
/*
* Get the calculated preferred network type.
* Used for device configuration by some CDMA operators.
* @param callingPackage The package making the call.
*
* @return the calculated preferred network type, defined in RILConstants.java.
*/
int getCalculatedPreferredNetworkType(String callingPackage);
/*
* Get the preferred network type.
* Used for device configuration by some CDMA operators.
*
* @param subId the id of the subscription to query.
* @return the preferred network type, defined in RILConstants.java.
*/
int getPreferredNetworkType(int subId);
/**
* Check whether DUN APN is required for tethering with subId.
*
* @param subId the id of the subscription to require tethering.
* @return {@code true} if DUN APN is required for tethering.
* @hide
*/
boolean getTetherApnRequiredForSubscriber(int subId);
/**
* Enables framework IMS and triggers IMS Registration.
*/
void enableIms(int slotId);
/**
* Disables framework IMS and triggers IMS deregistration.
*/
void disableIms(int slotId);
/**
* Get IImsMmTelFeature binder from ImsResolver that corresponds to the subId and MMTel feature
* as well as registering the MmTelFeature for callbacks using the IImsServiceFeatureCallback
* interface.
*/
IImsMmTelFeature getMmTelFeatureAndListen(int slotId, in IImsServiceFeatureCallback callback);
/**
* Get IImsRcsFeature binder from ImsResolver that corresponds to the subId and RCS feature
* as well as registering the RcsFeature for callbacks using the IImsServiceFeatureCallback
* interface.
*/
IImsRcsFeature getRcsFeatureAndListen(int slotId, in IImsServiceFeatureCallback callback);
/**
* Returns the IImsRegistration associated with the slot and feature specified.
*/
IImsRegistration getImsRegistration(int slotId, int feature);
/**
* Returns the IImsConfig associated with the slot and feature specified.
*/
IImsConfig getImsConfig(int slotId, int feature);
/**
* @return true if the ImsService to bind to for the slot id specified was set, false otherwise.
*/
boolean setImsService(int slotId, boolean isCarrierImsService, String packageName);
/**
* @return the package name of the carrier/device ImsService associated with this slot.
*/
String getImsService(int slotId, boolean isCarrierImsService);
/**
* Set the network selection mode to automatic.
*
* @param subId the id of the subscription to update.
*/
void setNetworkSelectionModeAutomatic(int subId);
/**
* Perform a radio scan and return the list of avialble networks.
*
* @param subId the id of the subscription.
* @return CellNetworkScanResult containing status of scan and networks.
*/
CellNetworkScanResult getCellNetworkScanResults(int subId, String callingPackage);
/**
* Perform a radio network scan and return the id of this scan.
*
* @param subId the id of the subscription.
* @param request Defines all the configs for network scan.
* @param messenger Callback messages will be sent using this messenger.
* @param binder the binder object instantiated in TelephonyManager.
* @param callingPackage the calling package
* @return An id for this scan.
*/
int requestNetworkScan(int subId, in NetworkScanRequest request, in Messenger messenger,
in IBinder binder, in String callingPackage);
/**
* Stop an existing radio network scan.
*
* @param subId the id of the subscription.
* @param scanId The id of the scan that is going to be stopped.
*/
void stopNetworkScan(int subId, int scanId);
/**
* Ask the radio to connect to the input network and change selection mode to manual.
*
* @param subId the id of the subscription.
* @param operatorInfo the operator inforamtion, included the PLMN, long name and short name of
* the operator to attach to.
* @param persistSelection whether the selection will persist until reboot. If true, only allows
* attaching to the selected PLMN until reboot; otherwise, attach to the chosen PLMN and resume
* normal network selection next time.
* @return {@code true} on success; {@code true} on any failure.
*/
boolean setNetworkSelectionModeManual(
int subId, in OperatorInfo operatorInfo, boolean persisSelection);
/**
* Set the preferred network type.
* Used for device configuration by some CDMA operators.
*
* @param subId the id of the subscription to update.
* @param networkType the preferred network type, defined in RILConstants.java.
* @return true on success; false on any failure.
*/
boolean setPreferredNetworkType(int subId, int networkType);
/**
* User enable/disable Mobile Data.
*
* @param enable true to turn on, else false
*/
void setUserDataEnabled(int subId, boolean enable);
/**
* Get the user enabled state of Mobile Data.
*
* TODO: remove and use isUserDataEnabled.
* This can't be removed now because some vendor codes
* calls through ITelephony directly while they should
* use TelephonyManager.
*
* @return true on enabled
*/
@UnsupportedAppUsage
boolean getDataEnabled(int subId);
/**
* Get the user enabled state of Mobile Data.
*
* @return true on enabled
*/
boolean isUserDataEnabled(int subId);
/**
* Get the overall enabled state of Mobile Data.
*
* @return true on enabled
*/
boolean isDataEnabled(int subId);
/**
* Checks if manual network selection is allowed.
*
* @return {@code true} if manual network selection is allowed, otherwise return {@code false}.
*/
boolean isManualNetworkSelectionAllowed(int subId);
/**
* Get P-CSCF address from PCO after data connection is established or modified.
* @param apnType the apnType, "ims" for IMS APN, "emergency" for EMERGENCY APN
* @param callingPackage The package making the call.
*/
String[] getPcscfAddress(String apnType, String callingPackage);
/**
* Set IMS registration state
*/
void setImsRegistrationState(boolean registered);
/**
* Return MDN string for CDMA phone.
* @param subId user preferred subId.
*/
String getCdmaMdn(int subId);
/**
* Return MIN string for CDMA phone.
* @param subId user preferred subId.
*/
String getCdmaMin(int subId);
/**
* Request that the next incoming call from a number matching {@code range} be intercepted.
* @param range The range of phone numbers the caller expects a phone call from.
* @param timeoutMillis The amount of time to wait for such a call, or
* {@link #MAX_NUMBER_VERIFICATION_TIMEOUT_MILLIS}, whichever is lesser.
* @param callback the callback aidl
* @param callingPackage the calling package name.
*/
void requestNumberVerification(in PhoneNumberRange range, long timeoutMillis,
in INumberVerificationCallback callback, String callingPackage);
/**
* Has the calling application been granted special privileges by the carrier.
*
* If any of the packages in the calling UID has carrier privileges, the
* call will return true. This access is granted by the owner of the UICC
* card and does not depend on the registered carrier.
*
* TODO: Add a link to documentation.
*
* @param subId The subscription to use.
* @return carrier privilege status defined in TelephonyManager.
*/
int getCarrierPrivilegeStatus(int subId);
/**
* Similar to above, but check for the given uid.
*/
int getCarrierPrivilegeStatusForUid(int subId, int uid);
/**
* Similar to above, but check for the package whose name is pkgName.
*/
int checkCarrierPrivilegesForPackage(int subId, String pkgName);
/**
* Similar to above, but check across all phones.
*/
int checkCarrierPrivilegesForPackageAnyPhone(String pkgName);
/**
* Returns list of the package names of the carrier apps that should handle the input intent
* and have carrier privileges for the given phoneId.
*
* @param intent Intent that will be sent.
* @param phoneId The phoneId on which the carrier app has carrier privileges.
* @return list of carrier app package names that can handle the intent on phoneId.
* Returns null if there is an error and an empty list if there
* are no matching packages.
*/
List
* The returned set of subscriber IDs will include the subscriber ID corresponding to this
* TelephonyManager's subId.
*
* @hide
*/
String[] getMergedSubscriberIds(int subId, String callingPackage);
/**
* Override the operator branding for the current ICCID.
*
* Once set, whenever the SIM is present in the device, the service
* provider name (SPN) and the operator name will both be replaced by the
* brand value input. To unset the value, the same function should be
* called with a null brand value.
*
* Requires Permission:
* {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}
* or has to be carrier app - see #hasCarrierPrivileges.
*
* @param subId The subscription to use.
* @param brand The brand name to display/set.
* @return true if the operation was executed correctly.
*/
boolean setOperatorBrandOverride(int subId, String brand);
/**
* Override the roaming indicator for the current ICCID.
*
* Using this call, the carrier app (see #hasCarrierPrivileges) can override
* the platform's notion of a network operator being considered roaming or not.
* The change only affects the ICCID that was active when this call was made.
*
* If null is passed as any of the input, the corresponding value is deleted.
*
* Requires that the caller have carrier privilege. See #hasCarrierPrivileges.
*
* @param subId for which the roaming overrides apply.
* @param gsmRoamingList - List of MCCMNCs to be considered roaming for 3GPP RATs.
* @param gsmNonRoamingList - List of MCCMNCs to be considered not roaming for 3GPP RATs.
* @param cdmaRoamingList - List of SIDs to be considered roaming for 3GPP2 RATs.
* @param cdmaNonRoamingList - List of SIDs to be considered not roaming for 3GPP2 RATs.
* @return true if the operation was executed correctly.
*/
boolean setRoamingOverride(int subId, in List Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
*/
String getDeviceId(String callingPackage);
/**
* Returns the IMEI for the given slot.
*
* @param slotIndex - device slot.
* @param callingPackage The package making the call.
* Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
*/
String getImeiForSlot(int slotIndex, String callingPackage);
/**
* Returns the Type Allocation Code from the IMEI for the given slot.
*
* @param slotIndex - Which slot to retrieve the Type Allocation Code from.
*/
String getTypeAllocationCodeForSlot(int slotIndex);
/**
* Returns the MEID for the given slot.
*
* @param slotIndex - device slot.
* @param callingPackage The package making the call.
* Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
*/
String getMeidForSlot(int slotIndex, String callingPackage);
/**
* Returns the Manufacturer Code from the MEID for the given slot.
*
* @param slotIndex - Which slot to retrieve the Manufacturer Code from.
*/
String getManufacturerCodeForSlot(int slotIndex);
/**
* Returns the device software version.
*
* @param slotIndex - device slot.
* @param callingPackage The package making the call.
* Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
*/
String getDeviceSoftwareVersionForSlot(int slotIndex, String callingPackage);
/**
* Returns the subscription ID associated with the specified PhoneAccount.
*/
int getSubIdForPhoneAccount(in PhoneAccount phoneAccount);
/**
* Returns the PhoneAccountHandle associated with a subscription ID.
*/
PhoneAccountHandle getPhoneAccountHandleForSubscriptionId(int subscriptionId);
void factoryReset(int subId);
/**
* Returns users's current locale based on the SIM.
*
* The returned string will be a well formed BCP-47 language tag, or {@code null}
* if no locale could be derived.
*/
String getSimLocaleForSubscriber(int subId);
/**
* Requests the modem activity info asynchronously.
* The implementor is expected to reply with the
* {@link android.telephony.ModemActivityInfo} object placed into the Bundle with the key
* {@link android.telephony.TelephonyManager#MODEM_ACTIVITY_RESULT_KEY}.
* The result code is ignored.
*/
oneway void requestModemActivityInfo(in ResultReceiver result);
/**
* Get the service state on specified subscription
* @param subId Subscription id
* @param callingPackage The package making the call
* @return Service state on specified subscription.
*/
ServiceState getServiceStateForSubscriber(int subId, String callingPackage);
/**
* Returns the URI for the per-account voicemail ringtone set in Phone settings.
*
* @param accountHandle The handle for the {@link PhoneAccount} for which to retrieve the
* voicemail ringtone.
* @return The URI for the ringtone to play when receiving a voicemail from a specific
* PhoneAccount.
*/
Uri getVoicemailRingtoneUri(in PhoneAccountHandle accountHandle);
/**
* Sets the per-account voicemail ringtone.
*
* Requires that the calling app is the default dialer, or has carrier privileges, or
* has permission {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}.
*
* @param phoneAccountHandle The handle for the {@link PhoneAccount} for which to set the
* voicemail ringtone.
* @param uri The URI for the ringtone to play when receiving a voicemail from a specific
* PhoneAccount.
*/
void setVoicemailRingtoneUri(String callingPackage,
in PhoneAccountHandle phoneAccountHandle, in Uri uri);
/**
* Returns whether vibration is set for voicemail notification in Phone settings.
*
* @param accountHandle The handle for the {@link PhoneAccount} for which to retrieve the
* voicemail vibration setting.
* @return {@code true} if the vibration is set for this PhoneAccount, {@code false} otherwise.
*/
boolean isVoicemailVibrationEnabled(in PhoneAccountHandle accountHandle);
/**
* Sets the per-account preference whether vibration is enabled for voicemail notifications.
*
* Requires that the calling app is the default dialer, or has carrier privileges, or
* has permission {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}.
*
* @param phoneAccountHandle The handle for the {@link PhoneAccount} for which to set the
* voicemail vibration setting.
* @param enabled Whether to enable or disable vibration for voicemail notifications from a
* specific PhoneAccount.
*/
void setVoicemailVibrationEnabled(String callingPackage,
in PhoneAccountHandle phoneAccountHandle, boolean enabled);
/**
* Returns a list of packages that have carrier privileges for the specific phone.
*/
List Requires system privileges. In the future we may add this to carrier APIs.
*
* @return {@link #SET_CARRIER_RESTRICTION_SUCCESS} in case of success.
* {@link #SET_CARRIER_RESTRICTION_NOT_SUPPORTED} if the modem does not support the
* configuration. {@link #SET_CARRIER_RESTRICTION_ERROR} in all other error cases.
*/
int setAllowedCarriers(in CarrierRestrictionRules carrierRestrictionRules);
/**
* Get the allowed carrier list and the excluded carrier list indicating the priority between
* the two lists.
*
* Requires system privileges. In the future we may add this to carrier APIs.
*
* @return {@link CarrierRestrictionRules}; empty lists mean all carriers are allowed. It
* returns null in case of error.
*/
CarrierRestrictionRules getAllowedCarriers();
/**
* Returns carrier id of the given subscription.
* To recognize carrier as a first class identity, assign each carrier with a canonical
* integer a.k.a carrier id.
*
* @param subId The subscription id
* @return Carrier id of given subscription id. return {@link #UNKNOWN_CARRIER_ID} if
* subscription is unavailable or carrier cannot be identified.
* @throws IllegalStateException if telephony service is unavailable.
* @hide
*/
int getSubscriptionCarrierId(int subId);
/**
* Returns carrier name of the given subscription.
* Carrier name is a user-facing name of carrier id {@link #getSimCarrierId(int)},
* usually the brand name of the subsidiary (e.g. T-Mobile). Each carrier could configure
* multiple {@link #getSimOperatorName() SPN} but should have a single carrier name.
* Carrier name is not canonical identity, use {@link #getSimCarrierId(int)} instead.
* Returned carrier name is unlocalized.
*
* @return Carrier name of given subscription id. return {@code null} if subscription is
* unavailable or carrier cannot be identified.
* @throws IllegalStateException if telephony service is unavailable.
* @hide
*/
String getSubscriptionCarrierName(int subId);
/**
* Returns fine-grained carrier id of the current subscription.
*
* The specific carrier id can be used to further differentiate a carrier by different
* networks, by prepaid v.s.postpaid or even by 4G v.s.3G plan. Each carrier has a unique
* carrier id {@link #getSimCarrierId()} but can have multiple precise carrier id. e.g,
* {@link #getSimCarrierId()} will always return Tracfone (id 2022) for a Tracfone SIM, while
* {@link #getSimPreciseCarrierId()} can return Tracfone AT&T or Tracfone T-Mobile based on the
* current underlying network.
*
* For carriers without any fine-grained carrier ids, return {@link #getSimCarrierId()}
*
* @return Returns fine-grained carrier id of the current subscription.
* Return {@link #UNKNOWN_CARRIER_ID} if the subscription is unavailable or the carrier cannot
* be identified.
* @hide
*/
int getSubscriptionSpecificCarrierId(int subId);
/**
* Similar like {@link #getSimCarrierIdName()}, returns user-facing name of the
* specific carrier id {@link #getSimSpecificCarrierId()}
*
* The returned name is unlocalized.
*
* @return user-facing name of the subscription specific carrier id. Return {@code null} if the
* subscription is unavailable or the carrier cannot be identified.
* @hide
*/
String getSubscriptionSpecificCarrierName(int subId);
/**
* Returns carrier id based on MCCMNC only. This will return a MNO carrier id used for fallback
* check when exact carrier id {@link #getSimCarrierId()} configurations are not found
*
* @param isSubscriptionMccMnc. If {@true} it means this is a query for subscription mccmnc
* {@false} otherwise.
*
* @return carrier id from passing mccmnc.
* @hide
*/
int getCarrierIdFromMccMnc(int slotIndex, String mccmnc, boolean isSubscriptionMccMnc);
/**
* Action set from carrier signalling broadcast receivers to enable/disable metered apns
* Permissions android.Manifest.permission.MODIFY_PHONE_STATE is required
* @param subId the subscription ID that this action applies to.
* @param enabled control enable or disable metered apns.
* @hide
*/
void carrierActionSetMeteredApnsEnabled(int subId, boolean visible);
/**
* Action set from carrier signalling broadcast receivers to enable/disable radio
* Permissions android.Manifest.permission.MODIFY_PHONE_STATE is required
* @param subId the subscription ID that this action applies to.
* @param enabled control enable or disable radio.
* @hide
*/
void carrierActionSetRadioEnabled(int subId, boolean enabled);
/**
* Action set from carrier signalling broadcast receivers to start/stop reporting default
* network conditions.
* Permissions android.Manifest.permission.MODIFY_PHONE_STATE is required
* @param subId the subscription ID that this action applies to.
* @param report control start/stop reporting default network events.
* @hide
*/
void carrierActionReportDefaultNetworkStatus(int subId, boolean report);
/**
* Action set from carrier signalling broadcast receivers to reset all carrier actions.
* Permissions android.Manifest.permission.MODIFY_PHONE_STATE is required
* @param subId the subscription ID that this action applies to.
* @hide
*/
void carrierActionResetAll(int subId);
/**
* Get aggregated video call data usage since boot.
* Permissions android.Manifest.permission.READ_NETWORK_USAGE_HISTORY is required.
*
* @param perUidStats True if requesting data usage per uid, otherwise overall usage.
* @return Snapshot of video call data usage
* @hide
*/
NetworkStats getVtDataUsage(int subId, boolean perUidStats);
/**
* Policy control of data connection. Usually used when data limit is passed.
* @param enabled True if enabling the data, otherwise disabling.
* @param subId Subscription index
* @hide
*/
void setPolicyDataEnabled(boolean enabled, int subId);
/**
* Get Client request stats which will contain statistical information
* on each request made by client.
* @param callingPackage package making the call.
* @param subId Subscription index
* @hide
*/
List Requires that the calling app has READ_PRIVILEGED_PHONE_STATE or READ_PHONE_STATE
*
* @param subId subscription ID used for authentication
* @param appType the icc application type, like {@link #APPTYPE_USIM}
*/
String[] getForbiddenPlmns(int subId, int appType, String callingPackage);
/**
* Check if phone is in emergency callback mode
* @return true if phone is in emergency callback mode
* @param subId the subscription ID that this action applies to.
* @hide
*/
boolean getEmergencyCallbackMode(int subId);
/**
* Get the most recently available signal strength information.
*
* Get the most recent SignalStrength information reported by the modem. Due
* to power saving this information may not always be current.
* @param subId Subscription index
* @return the most recent cached signal strength info from the modem
* @hide
*/
SignalStrength getSignalStrength(int subId);
/**
* Get the card ID of the default eUICC card. If there is no eUICC, returns
* {@link #INVALID_CARD_ID}.
*
* @param subId subscription ID used for authentication
* @param callingPackage package making the call
* @return card ID of the default eUICC card.
*/
int getCardIdForDefaultEuicc(int subId, String callingPackage);
/**
* Gets information about currently inserted UICCs and eUICCs.
*
* Requires that the calling app has carrier privileges (see {@link #hasCarrierPrivileges}).
*
* If the caller has carrier priviliges on any active subscription, then they have permission to
* get simple information like the card ID ({@link UiccCardInfo#getCardId()}), whether the card
* is an eUICC ({@link UiccCardInfo#isEuicc()}), and the slot index where the card is inserted
* ({@link UiccCardInfo#getSlotIndex()}).
*
* To get private information such as the EID ({@link UiccCardInfo#getEid()}) or ICCID
* ({@link UiccCardInfo#getIccId()}), the caller must have carrier priviliges on that specific
* UICC or eUICC card.
*
* See {@link UiccCardInfo} for more details on the kind of information available.
*
* @param callingPackage package making the call, used to evaluate carrier privileges
* @return a list of UiccCardInfo objects, representing information on the currently inserted
* UICCs and eUICCs. Each UiccCardInfo in the list will have private information filtered out if
* the caller does not have adequate permissions for that card.
*/
List