Fields Summary |
---|
private static final String | TAG |
private static com.android.internal.telephony.ITelephonyRegistry | sRegistry |
private final android.content.Context | mContext |
private SubscriptionManager | mSubscriptionManager |
private static String | multiSimConfig |
private static TelephonyManager | sInstance |
public static final String | ACTION_PHONE_STATE_CHANGEDBroadcast intent action indicating that the call state (cellular)
on the device has changed.
The {@link #EXTRA_STATE} extra indicates the new call state.
If the new state is RINGING, a second extra
{@link #EXTRA_INCOMING_NUMBER} provides the incoming phone number as
a String.
Requires the READ_PHONE_STATE permission.
This was a {@link android.content.Context#sendStickyBroadcast sticky}
broadcast in version 1.0, but it is no longer sticky.
Instead, use {@link #getCallState} to synchronously query the current call state. |
public static final String | ACTION_RESPOND_VIA_MESSAGEThe Phone app sends this intent when a user opts to respond-via-message during an incoming
call. By default, the device's default SMS app consumes this message and sends a text message
to the caller. A third party app can also provide this functionality by consuming this Intent
with a {@link android.app.Service} and sending the message using its own messaging system.
The intent contains a URI (available from {@link android.content.Intent#getData})
describing the recipient, using either the {@code sms:}, {@code smsto:}, {@code mms:},
or {@code mmsto:} URI schema. Each of these URI schema carry the recipient information the
same way: the path part of the URI contains the recipient's phone number or a comma-separated
set of phone numbers if there are multiple recipients. For example, {@code
smsto:2065551234}.
The intent may also contain extras for the message text (in {@link
android.content.Intent#EXTRA_TEXT}) and a message subject
(in {@link android.content.Intent#EXTRA_SUBJECT}).
Note:
The intent-filter that consumes this Intent needs to be in a {@link android.app.Service}
that requires the
permission {@link android.Manifest.permission#SEND_RESPOND_VIA_MESSAGE}.
For example, the service that receives this intent can be declared in the manifest file
with an intent filter like this:
<!-- Service that delivers SMS messages received from the phone "quick response" -->
<service android:name=".HeadlessSmsSendService"
android:permission="android.permission.SEND_RESPOND_VIA_MESSAGE"
android:exported="true" >
<intent-filter>
<action android:name="android.intent.action.RESPOND_VIA_MESSAGE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="sms" />
<data android:scheme="smsto" />
<data android:scheme="mms" />
<data android:scheme="mmsto" />
</intent-filter>
</service>
Output: nothing. |
public static final String | EXTRA_STATEThe lookup key used with the {@link #ACTION_PHONE_STATE_CHANGED} broadcast
for a String containing the new call state. |
public static final String | EXTRA_STATE_IDLEValue used with {@link #EXTRA_STATE} corresponding to
{@link #CALL_STATE_IDLE}. |
public static final String | EXTRA_STATE_RINGINGValue used with {@link #EXTRA_STATE} corresponding to
{@link #CALL_STATE_RINGING}. |
public static final String | EXTRA_STATE_OFFHOOKValue used with {@link #EXTRA_STATE} corresponding to
{@link #CALL_STATE_OFFHOOK}. |
public static final String | EXTRA_INCOMING_NUMBERThe lookup key used with the {@link #ACTION_PHONE_STATE_CHANGED} broadcast
for a String containing the incoming phone number.
Only valid when the new call state is RINGING.
Retrieve with
{@link android.content.Intent#getStringExtra(String)}. |
public static final String | ACTION_PRECISE_CALL_STATE_CHANGEDBroadcast intent action indicating that a precise call state
(cellular) on the device has changed.
The {@link #EXTRA_RINGING_CALL_STATE} extra indicates the ringing call state.
The {@link #EXTRA_FOREGROUND_CALL_STATE} extra indicates the foreground call state.
The {@link #EXTRA_BACKGROUND_CALL_STATE} extra indicates the background call state.
The {@link #EXTRA_DISCONNECT_CAUSE} extra indicates the disconnect cause.
The {@link #EXTRA_PRECISE_DISCONNECT_CAUSE} extra indicates the precise disconnect cause.
Requires the READ_PRECISE_PHONE_STATE permission. |
public static final String | EXTRA_RINGING_CALL_STATEThe lookup key used with the {@link #ACTION_PRECISE_CALL_STATE_CHANGED} broadcast
for an integer containing the state of the current ringing call. |
public static final String | EXTRA_FOREGROUND_CALL_STATEThe lookup key used with the {@link #ACTION_PRECISE_CALL_STATE_CHANGED} broadcast
for an integer containing the state of the current foreground call. |
public static final String | EXTRA_BACKGROUND_CALL_STATEThe lookup key used with the {@link #ACTION_PRECISE_CALL_STATE_CHANGED} broadcast
for an integer containing the state of the current background call. |
public static final String | EXTRA_DISCONNECT_CAUSEThe lookup key used with the {@link #ACTION_PRECISE_CALL_STATE_CHANGED} broadcast
for an integer containing the disconnect cause. |
public static final String | EXTRA_PRECISE_DISCONNECT_CAUSEThe lookup key used with the {@link #ACTION_PRECISE_CALL_STATE_CHANGED} broadcast
for an integer containing the disconnect cause provided by the RIL. |
public static final String | ACTION_PRECISE_DATA_CONNECTION_STATE_CHANGEDBroadcast intent action indicating a data connection has changed,
providing precise information about the connection.
The {@link #EXTRA_DATA_STATE} extra indicates the connection state.
The {@link #EXTRA_DATA_NETWORK_TYPE} extra indicates the connection network type.
The {@link #EXTRA_DATA_APN_TYPE} extra indicates the APN type.
The {@link #EXTRA_DATA_APN} extra indicates the APN.
The {@link #EXTRA_DATA_CHANGE_REASON} extra indicates the connection change reason.
The {@link #EXTRA_DATA_IFACE_PROPERTIES} extra indicates the connection interface.
The {@link #EXTRA_DATA_FAILURE_CAUSE} extra indicates the connection fail cause.
Requires the READ_PRECISE_PHONE_STATE permission. |
public static final String | EXTRA_DATA_STATEThe lookup key used with the {@link #ACTION_PRECISE_DATA_CONNECTION_STATE_CHANGED} broadcast
for an integer containing the state of the current data connection. |
public static final String | EXTRA_DATA_NETWORK_TYPEThe lookup key used with the {@link #ACTION_PRECISE_DATA_CONNECTION_STATE_CHANGED} broadcast
for an integer containing the network type. |
public static final String | EXTRA_DATA_APN_TYPEThe lookup key used with the {@link #ACTION_PRECISE_DATA_CONNECTION_STATE_CHANGED} broadcast
for an String containing the data APN type.
Retrieve with
{@link android.content.Intent#getStringExtra(String name)}. |
public static final String | EXTRA_DATA_APNThe lookup key used with the {@link #ACTION_PRECISE_DATA_CONNECTION_STATE_CHANGED} broadcast
for an String containing the data APN.
Retrieve with
{@link android.content.Intent#getStringExtra(String name)}. |
public static final String | EXTRA_DATA_CHANGE_REASONThe lookup key used with the {@link #ACTION_PRECISE_DATA_CONNECTION_STATE_CHANGED} broadcast
for an String representation of the change reason.
Retrieve with
{@link android.content.Intent#getStringExtra(String name)}. |
public static final String | EXTRA_DATA_LINK_PROPERTIES_KEYThe lookup key used with the {@link #ACTION_PRECISE_DATA_CONNECTION_STATE_CHANGED} broadcast
for an String representation of the data interface.
Retrieve with
{@link android.content.Intent#getParcelableExtra(String name)}. |
public static final String | EXTRA_DATA_FAILURE_CAUSEThe lookup key used with the {@link #ACTION_PRECISE_DATA_CONNECTION_STATE_CHANGED} broadcast
for the data connection fail cause.
Retrieve with
{@link android.content.Intent#getStringExtra(String name)}. |
public static final int | PHONE_TYPE_NONENo phone radio. |
public static final int | PHONE_TYPE_GSMPhone radio is GSM. |
public static final int | PHONE_TYPE_CDMAPhone radio is CDMA. |
public static final int | PHONE_TYPE_SIPPhone is via SIP. |
private static final String | sKernelCmdLineKernel command line |
private static final Pattern | sProductTypePatternPattern for selecting the product type from the kernel command line |
private static final String | sLteOnCdmaProductTypeThe ProductType used for LTE on CDMA devices |
public static final int | NETWORK_TYPE_UNKNOWNNetwork type is unknown |
public static final int | NETWORK_TYPE_GPRSCurrent network is GPRS |
public static final int | NETWORK_TYPE_EDGECurrent network is EDGE |
public static final int | NETWORK_TYPE_UMTSCurrent network is UMTS |
public static final int | NETWORK_TYPE_CDMACurrent network is CDMA: Either IS95A or IS95B |
public static final int | NETWORK_TYPE_EVDO_0Current network is EVDO revision 0 |
public static final int | NETWORK_TYPE_EVDO_ACurrent network is EVDO revision A |
public static final int | NETWORK_TYPE_1xRTTCurrent network is 1xRTT |
public static final int | NETWORK_TYPE_HSDPACurrent network is HSDPA |
public static final int | NETWORK_TYPE_HSUPACurrent network is HSUPA |
public static final int | NETWORK_TYPE_HSPACurrent network is HSPA |
public static final int | NETWORK_TYPE_IDENCurrent network is iDen |
public static final int | NETWORK_TYPE_EVDO_BCurrent network is EVDO revision B |
public static final int | NETWORK_TYPE_LTECurrent network is LTE |
public static final int | NETWORK_TYPE_EHRPDCurrent network is eHRPD |
public static final int | NETWORK_TYPE_HSPAPCurrent network is HSPA+ |
public static final int | NETWORK_TYPE_GSMCurrent network is GSM {@hide} |
public static final int | NETWORK_CLASS_UNKNOWNUnknown network class. {@hide} |
public static final int | NETWORK_CLASS_2_GClass of broadly defined "2G" networks. {@hide} |
public static final int | NETWORK_CLASS_3_GClass of broadly defined "3G" networks. {@hide} |
public static final int | NETWORK_CLASS_4_GClass of broadly defined "4G" networks. {@hide} |
public static final int | SIM_STATE_UNKNOWNSIM card state: Unknown. Signifies that the SIM is in transition
between states. For example, when the user inputs the SIM pin
under PIN_REQUIRED state, a query for sim status returns
this state before turning to SIM_STATE_READY.
These are the ordinal value of IccCardConstants.State. |
public static final int | SIM_STATE_ABSENTSIM card state: no SIM card is available in the device |
public static final int | SIM_STATE_PIN_REQUIREDSIM card state: Locked: requires the user's SIM PIN to unlock |
public static final int | SIM_STATE_PUK_REQUIREDSIM card state: Locked: requires the user's SIM PUK to unlock |
public static final int | SIM_STATE_NETWORK_LOCKEDSIM card state: Locked: requires a network PIN to unlock |
public static final int | SIM_STATE_READYSIM card state: Ready |
public static final int | SIM_STATE_NOT_READYSIM card state: SIM Card is NOT READY |
public static final int | SIM_STATE_PERM_DISABLEDSIM card state: SIM Card Error, permanently disabled |
public static final int | SIM_STATE_CARD_IO_ERRORSIM card state: SIM Card Error, present but faulty |
public static final int | CALL_STATE_IDLEDevice call state: No activity. |
public static final int | CALL_STATE_RINGINGDevice call state: Ringing. A new call arrived and is
ringing or waiting. In the latter case, another call is
already active. |
public static final int | CALL_STATE_OFFHOOKDevice call state: Off-hook. At least one call exists
that is dialing, active, or on hold, and no calls are ringing
or waiting. |
public static final int | DATA_ACTIVITY_NONEData connection activity: No traffic. |
public static final int | DATA_ACTIVITY_INData connection activity: Currently receiving IP PPP traffic. |
public static final int | DATA_ACTIVITY_OUTData connection activity: Currently sending IP PPP traffic. |
public static final int | DATA_ACTIVITY_INOUTData connection activity: Currently both sending and receiving
IP PPP traffic. |
public static final int | DATA_ACTIVITY_DORMANTData connection is active, but physical link is down |
public static final int | DATA_UNKNOWNData connection state: Unknown. Used before we know the state. |
public static final int | DATA_DISCONNECTEDData connection state: Disconnected. IP traffic not available. |
public static final int | DATA_CONNECTINGData connection state: Currently setting up a data connection. |
public static final int | DATA_CONNECTEDData connection state: Connected. IP traffic should be available. |
public static final int | DATA_SUSPENDEDData connection state: Suspended. The connection is up, but IP
traffic is temporarily unavailable. For example, in a 2G network,
data activity may be suspended when a voice call arrives. |
public static final int | CARRIER_PRIVILEGE_STATUS_HAS_ACCESS |
public static final int | CARRIER_PRIVILEGE_STATUS_NO_ACCESS |
public static final int | CARRIER_PRIVILEGE_STATUS_RULES_NOT_LOADED |
public static final int | CARRIER_PRIVILEGE_STATUS_ERROR_LOADING_RULES |
Methods Summary |
---|
public void | answerRingingCall()
try {
getITelephony().answerRingingCall();
} catch (RemoteException e) {
Log.e(TAG, "Error calling ITelephony#answerRingingCall", e);
}
|
public void | call(java.lang.String callingPackage, java.lang.String number)
try {
getITelephony().call(callingPackage, number);
} catch (RemoteException e) {
Log.e(TAG, "Error calling ITelephony#call", e);
}
|
public int | checkCarrierPrivilegesForPackage(java.lang.String pkgname)
try {
return getITelephony().checkCarrierPrivilegesForPackage(pkgname);
} catch (RemoteException ex) {
Rlog.e(TAG, "checkCarrierPrivilegesForPackage RemoteException", ex);
} catch (NullPointerException ex) {
Rlog.e(TAG, "checkCarrierPrivilegesForPackage NPE", ex);
}
return CARRIER_PRIVILEGE_STATUS_NO_ACCESS;
|
public void | dial(java.lang.String number)
try {
getITelephony().dial(number);
} catch (RemoteException e) {
Log.e(TAG, "Error calling ITelephony#dial", e);
}
|
public boolean | disableDataConnectivity()
try {
return getITelephony().disableDataConnectivity();
} catch (RemoteException e) {
Log.e(TAG, "Error calling ITelephony#disableDataConnectivity", e);
}
return false;
|
public void | disableLocationUpdates()Disables location update notifications. {@link PhoneStateListener#onCellLocationChanged
PhoneStateListener.onCellLocationChanged} will be called on location updates.
Requires Permission: {@link android.Manifest.permission#CONTROL_LOCATION_UPDATES
CONTROL_LOCATION_UPDATES}
disableLocationUpdates(getDefaultSubscription());
|
public void | disableLocationUpdates(int subId)
try {
getITelephony().disableLocationUpdatesForSubscriber(subId);
} catch (RemoteException ex) {
} catch (NullPointerException ex) {
}
|
public boolean | enableDataConnectivity()
try {
return getITelephony().enableDataConnectivity();
} catch (RemoteException e) {
Log.e(TAG, "Error calling ITelephony#enableDataConnectivity", e);
}
return false;
|
public void | enableLocationUpdates()Enables location update notifications. {@link PhoneStateListener#onCellLocationChanged
PhoneStateListener.onCellLocationChanged} will be called on location updates.
Requires Permission: {@link android.Manifest.permission#CONTROL_LOCATION_UPDATES
CONTROL_LOCATION_UPDATES}
enableLocationUpdates(getDefaultSubscription());
|
public void | enableLocationUpdates(int subId)
try {
getITelephony().enableLocationUpdatesForSubscriber(subId);
} catch (RemoteException ex) {
} catch (NullPointerException ex) {
}
|
public void | enableVideoCalling(boolean enable)
try {
getITelephony().enableVideoCalling(enable);
} catch (RemoteException e) {
Log.e(TAG, "Error calling ITelephony#enableVideoCalling", e);
}
|
public boolean | endCall()
try {
return getITelephony().endCall();
} catch (RemoteException e) {
Log.e(TAG, "Error calling ITelephony#endCall", e);
}
return false;
|
public static android.telephony.TelephonyManager | from(android.content.Context context){@hide}
return (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
|
public java.util.List | getAllCellInfo()Returns all observed cell information from all radios on the
device including the primary and neighboring cells. This does
not cause or change the rate of PhoneStateListner#onCellInfoChanged.
The list can include one or more of {@link android.telephony.CellInfoGsm CellInfoGsm},
{@link android.telephony.CellInfoCdma CellInfoCdma},
{@link android.telephony.CellInfoLte CellInfoLte} and
{@link android.telephony.CellInfoWcdma CellInfoCdma} in any combination.
Specifically on devices with multiple radios it is typical to see instances of
one or more of any these in the list. In addition 0, 1 or more CellInfo
objects may return isRegistered() true.
This is preferred over using getCellLocation although for older
devices this may return null in which case getCellLocation should
be called.
try {
return getITelephony().getAllCellInfo();
} catch (RemoteException ex) {
return null;
} catch (NullPointerException ex) {
return null;
}
|
public int | getCallState()Returns a constant indicating the call state (cellular) on the device.
try {
return getTelecomService().getCallState();
} catch (RemoteException | NullPointerException e) {
return CALL_STATE_IDLE;
}
|
public int | getCallState(int subId){@hide}
try {
return getITelephony().getCallStateForSubscriber(subId);
} catch (RemoteException ex) {
// the phone process is restarting.
return CALL_STATE_IDLE;
} catch (NullPointerException ex) {
// the phone process is restarting.
return CALL_STATE_IDLE;
}
|
public java.util.List | getCarrierPackageNamesForIntent(android.content.Intent intent)
try {
return getITelephony().getCarrierPackageNamesForIntent(intent);
} catch (RemoteException ex) {
Rlog.e(TAG, "getCarrierPackageNamesForIntent RemoteException", ex);
} catch (NullPointerException ex) {
Rlog.e(TAG, "getCarrierPackageNamesForIntent NPE", ex);
}
return null;
|
public int | getCdmaEriIconIndex()Returns the CDMA ERI icon index to display
return getCdmaEriIconIndex(getDefaultSubscription());
|
public int | getCdmaEriIconIndex(int subId){@hide}
try {
return getITelephony().getCdmaEriIconIndexForSubscriber(subId);
} catch (RemoteException ex) {
// the phone process is restarting.
return -1;
} catch (NullPointerException ex) {
return -1;
}
|
public int | getCdmaEriIconMode()Returns the CDMA ERI icon mode,
0 - ON
1 - FLASHING
return getCdmaEriIconMode(getDefaultSubscription());
|
public int | getCdmaEriIconMode(int subId){@hide}
try {
return getITelephony().getCdmaEriIconModeForSubscriber(subId);
} catch (RemoteException ex) {
// the phone process is restarting.
return -1;
} catch (NullPointerException ex) {
return -1;
}
|
public java.lang.String | getCdmaEriText()Returns the CDMA ERI text,
return getCdmaEriText(getDefaultSubscription());
|
public java.lang.String | getCdmaEriText(int subId){@hide}
try {
return getITelephony().getCdmaEriTextForSubscriber(subId);
} catch (RemoteException ex) {
// the phone process is restarting.
return null;
} catch (NullPointerException ex) {
return null;
}
|
public java.lang.String | getCdmaMdn()
return getCdmaMdn(getDefaultSubscription());
|
public java.lang.String | getCdmaMdn(int subId)
try {
return getITelephony().getCdmaMdn(subId);
} catch (RemoteException ex) {
return null;
} catch (NullPointerException ex) {
return null;
}
|
public java.lang.String | getCdmaMin()
return getCdmaMin(getDefaultSubscription());
|
public java.lang.String | getCdmaMin(int subId)
try {
return getITelephony().getCdmaMin(subId);
} catch (RemoteException ex) {
return null;
} catch (NullPointerException ex) {
return null;
}
|
public CellLocation | getCellLocation()Returns the current location of the device.
If there is only one radio in the device and that radio has an LTE connection,
this method will return null. The implementation must not to try add LTE
identifiers into the existing cdma/gsm classes.
In the future this call will be deprecated.
try {
Bundle bundle = getITelephony().getCellLocation();
if (bundle.isEmpty()) return null;
CellLocation cl = CellLocation.newFromBundle(bundle);
if (cl.isEmpty())
return null;
return cl;
} catch (RemoteException ex) {
return null;
} catch (NullPointerException ex) {
return null;
}
|
public java.lang.String | getCompleteVoiceMailNumber()Returns the complete voice mail number. Return null if it is unavailable.
Requires Permission:
{@link android.Manifest.permission#CALL_PRIVILEGED CALL_PRIVILEGED}
return getCompleteVoiceMailNumber(getDefaultSubscription());
|
public java.lang.String | getCompleteVoiceMailNumber(int subId){@hide}
try {
return getSubscriberInfo().getCompleteVoiceMailNumberForSubscriber(subId);
} catch (RemoteException ex) {
return null;
} catch (NullPointerException ex) {
// This could happen before phone restarts due to crashing
return null;
}
|
public int | getCurrentPhoneType()Returns the current phone type.
TODO: This is a last minute change and hence hidden.
return getCurrentPhoneType(getDefaultSubscription());
|
public int | getCurrentPhoneType(int subId){@hide}
int phoneId = SubscriptionManager.getPhoneId(subId);
try{
ITelephony telephony = getITelephony();
if (telephony != null) {
return telephony.getActivePhoneTypeForSubscriber(subId);
} else {
// This can happen when the ITelephony interface is not up yet.
return getPhoneTypeFromProperty(phoneId);
}
} catch (RemoteException ex) {
// This shouldn't happen in the normal case, as a backup we
// read from the system property.
return getPhoneTypeFromProperty(phoneId);
} catch (NullPointerException ex) {
// This shouldn't happen in the normal case, as a backup we
// read from the system property.
return getPhoneTypeFromProperty(phoneId);
}
|
public int | getDataActivity()Returns a constant indicating the type of activity on a data connection
(cellular).
try {
return getITelephony().getDataActivity();
} catch (RemoteException ex) {
// the phone process is restarting.
return DATA_ACTIVITY_NONE;
} catch (NullPointerException ex) {
// the phone process is restarting.
return DATA_ACTIVITY_NONE;
}
|
public boolean | getDataEnabled()
return getDataEnabled(SubscriptionManager.getDefaultDataSubId());
|
public boolean | getDataEnabled(int subId)
boolean retVal = false;
try {
retVal = getITelephony().getDataEnabled(subId);
} catch (RemoteException e) {
Log.e(TAG, "Error calling ITelephony#getDataEnabled", e);
} catch (NullPointerException e) {
}
Log.d(TAG, "getDataEnabled: retVal=" + retVal);
return retVal;
|
public int | getDataNetworkType()Returns a constant indicating the radio technology (network type)
currently in use on the device for data transmission.
return getDataNetworkType(getDefaultSubscription());
|
public int | getDataNetworkType(int subId){@hide}
try{
ITelephony telephony = getITelephony();
if (telephony != null) {
return telephony.getDataNetworkTypeForSubscriber(subId);
} else {
// This can happen when the ITelephony interface is not up yet.
return NETWORK_TYPE_UNKNOWN;
}
} catch(RemoteException ex) {
// This shouldn't happen in the normal case
return NETWORK_TYPE_UNKNOWN;
} catch (NullPointerException ex) {
// This could happen before phone restarts due to crashing
return NETWORK_TYPE_UNKNOWN;
}
|
public int | getDataState()Returns a constant indicating the current data connection state
(cellular).
try {
return getITelephony().getDataState();
} catch (RemoteException ex) {
// the phone process is restarting.
return DATA_DISCONNECTED;
} catch (NullPointerException ex) {
return DATA_DISCONNECTED;
}
|
public static android.telephony.TelephonyManager | getDefault()
return sInstance;
|
private static int | getDefaultPhone()Returns Default phone.
return SubscriptionManager.getPhoneId(SubscriptionManager.getDefaultSubId());
|
public int | getDefaultSim(){@hide}
return SubscriptionManager.getSlotId(SubscriptionManager.getDefaultSubId());
|
private static int | getDefaultSubscription()Returns Default subscription.
return SubscriptionManager.getDefaultSubId();
|
public java.lang.String | getDeviceId()Returns the unique device ID, for example, the IMEI for GSM and the MEID
or ESN for CDMA phones. Return null if device ID is not available.
Requires Permission:
{@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
try {
return getITelephony().getDeviceId();
} catch (RemoteException ex) {
return null;
} catch (NullPointerException ex) {
return null;
}
|
public java.lang.String | getDeviceId(int slotId){@hide}
// FIXME this assumes phoneId == slotId
try {
return getSubscriberInfo().getDeviceIdForPhone(slotId);
} catch (RemoteException ex) {
return null;
} catch (NullPointerException ex) {
return null;
}
|
public java.lang.String | getDeviceSoftwareVersion()Returns the software version number for the device, for example,
the IMEI/SV for GSM phones. Return null if the software version is
not available.
Requires Permission:
{@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
//
//
// Device Info
//
//
return getDeviceSoftwareVersion(getDefaultSim());
|
public java.lang.String | getDeviceSoftwareVersion(int slotId){@hide}
// FIXME methods taking slot id should not use subscription, instead us Uicc directly
int[] subId = SubscriptionManager.getSubId(slotId);
if (subId == null || subId.length == 0) {
return null;
}
try {
return getSubscriberInfo().getDeviceSvnUsingSubId(subId[0]);
} catch (RemoteException ex) {
return null;
} catch (NullPointerException ex) {
return null;
}
|
public java.lang.String | getGroupIdLevel1()Returns the Group Identifier Level1 for a GSM phone.
Return null if it is unavailable.
Requires Permission:
{@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
try {
return getSubscriberInfo().getGroupIdLevel1();
} catch (RemoteException ex) {
return null;
} catch (NullPointerException ex) {
// This could happen before phone restarts due to crashing
return null;
}
|
public java.lang.String | getGroupIdLevel1(int subId){@hide}
try {
return getSubscriberInfo().getGroupIdLevel1ForSubscriber(subId);
} catch (RemoteException ex) {
return null;
} catch (NullPointerException ex) {
// This could happen before phone restarts due to crashing
return null;
}
|
private com.android.internal.telephony.ITelephony | getITelephony()
return ITelephony.Stub.asInterface(ServiceManager.getService(Context.TELEPHONY_SERVICE));
|
public java.lang.String | getIccSimChallengeResponse(int subId, int appType, java.lang.String data)Returns the response of SIM Authentication through RIL.
Returns null if the Authentication hasn't been successful
try {
return getSubscriberInfo().getIccSimChallengeResponse(subId, appType, data);
} catch (RemoteException ex) {
return null;
} catch (NullPointerException ex) {
// This could happen before phone starts
return null;
}
|
public java.lang.String | getIccSimChallengeResponse(int appType, java.lang.String data)Returns the response of SIM Authentication through RIL for the default subscription.
Returns null if the Authentication hasn't been successful
return getIccSimChallengeResponse(getDefaultSubscription(), appType, data);
|
public java.lang.String | getImei(){@hide}
return getImei(getDefaultSim());
|
public java.lang.String | getImei(int slotId){@hide}
int[] subId = SubscriptionManager.getSubId(slotId);
try {
return getSubscriberInfo().getImeiForSubscriber(subId[0]);
} catch (RemoteException ex) {
return null;
} catch (NullPointerException ex) {
return null;
}
|
public static int | getIntAtIndex(android.content.ContentResolver cr, java.lang.String name, int index)Convenience function for retrieving a value from the secure settings
value list as an integer. Note that internally setting values are
always stored as strings; this function converts the string to an
integer for you.
This version does not take a default value. If the setting has not
been set, or the string value is not a number,
it throws {@link SettingNotFoundException}.
String v = android.provider.Settings.Global.getString(cr, name);
if (v != null) {
String valArray[] = v.split(",");
if ((index >= 0) && (index < valArray.length) && (valArray[index] != null)) {
try {
return Integer.parseInt(valArray[index]);
} catch (NumberFormatException e) {
//Log.e(TAG, "Exception while parsing Integer: ", e);
}
}
}
throw new android.provider.Settings.SettingNotFoundException(name);
|
public static int | getIntWithSubId(android.content.ContentResolver cr, java.lang.String name, int subId, int def)This function retrieves value for setting "name+subId", and if that is not found
retrieves value for setting "name", and if that is not found uses def as default
return Settings.Global.getInt(cr, name + subId, Settings.Global.getInt(cr, name, def));
|
public static int | getIntWithSubId(android.content.ContentResolver cr, java.lang.String name, int subId)This function retrieves value for setting "name+subId", and if that is not found
retrieves value for setting "name", and if that is not found throws
SettingNotFoundException
try {
return Settings.Global.getInt(cr, name + subId);
} catch (SettingNotFoundException e) {
try {
int val = Settings.Global.getInt(cr, name);
Settings.Global.putInt(cr, name + subId, val);
/* We are now moving from 'setting' to 'setting+subId', and using the value stored
* for 'setting' as default. Reset the default (since it may have a user set
* value). */
int default_val = val;
if (name.equals(Settings.Global.MOBILE_DATA)) {
default_val = "true".equalsIgnoreCase(
SystemProperties.get("ro.com.android.mobiledata", "true")) ? 1 : 0;
} else if (name.equals(Settings.Global.DATA_ROAMING)) {
default_val = "true".equalsIgnoreCase(
SystemProperties.get("ro.com.android.dataroaming", "false")) ? 1 : 0;
}
if (default_val != val) {
Settings.Global.putInt(cr, name, default_val);
}
return val;
} catch (SettingNotFoundException exc) {
throw new SettingNotFoundException(name);
}
}
|
public java.lang.String | getIsimChallengeResponse(java.lang.String nonce)Returns the response of ISIM Authetification through RIL.
Returns null if the Authentification hasn't been successed or isn't present iphonesubinfo.
try {
return getSubscriberInfo().getIsimChallengeResponse(nonce);
} catch (RemoteException ex) {
return null;
} catch (NullPointerException ex) {
// This could happen before phone restarts due to crashing
return null;
}
|
public java.lang.String | getIsimDomain()Returns the IMS home network domain name that was loaded from the ISIM.
try {
return getSubscriberInfo().getIsimDomain();
} catch (RemoteException ex) {
return null;
} catch (NullPointerException ex) {
// This could happen before phone restarts due to crashing
return null;
}
|
public java.lang.String | getIsimImpi()Returns the IMS private user identity (IMPI) that was loaded from the ISIM.
try {
return getSubscriberInfo().getIsimImpi();
} catch (RemoteException ex) {
return null;
} catch (NullPointerException ex) {
// This could happen before phone restarts due to crashing
return null;
}
|
public java.lang.String[] | getIsimImpu()Returns the IMS public user identities (IMPU) that were loaded from the ISIM.
try {
return getSubscriberInfo().getIsimImpu();
} catch (RemoteException ex) {
return null;
} catch (NullPointerException ex) {
// This could happen before phone restarts due to crashing
return null;
}
|
public java.lang.String | getIsimIst()Returns the IMS Service Table (IST) that was loaded from the ISIM.
try {
return getSubscriberInfo().getIsimIst();
} catch (RemoteException ex) {
return null;
} catch (NullPointerException ex) {
// This could happen before phone restarts due to crashing
return null;
}
|
public java.lang.String[] | getIsimPcscf()Returns the IMS Proxy Call Session Control Function(PCSCF) that were loaded from the ISIM.
try {
return getSubscriberInfo().getIsimPcscf();
} catch (RemoteException ex) {
return null;
} catch (NullPointerException ex) {
// This could happen before phone restarts due to crashing
return null;
}
|
public java.lang.String | getLine1AlphaTag()Returns the alphabetic identifier associated with the line 1 number.
Return null if it is unavailable.
Requires Permission:
{@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
return getLine1AlphaTagForSubscriber(getDefaultSubscription());
|
public java.lang.String | getLine1AlphaTagForSubscriber(int subId){@hide}
String alphaTag = null;
try {
alphaTag = getITelephony().getLine1AlphaTagForDisplay(subId);
} catch (RemoteException ex) {
} catch (NullPointerException ex) {
}
if (alphaTag != null) {
return alphaTag;
}
try {
return getSubscriberInfo().getLine1AlphaTagForSubscriber(subId);
} catch (RemoteException ex) {
return null;
} catch (NullPointerException ex) {
// This could happen before phone restarts due to crashing
return null;
}
|
public java.lang.String | getLine1Number()Returns the phone number string for line 1, for example, the MSISDN
for a GSM phone. Return null if it is unavailable.
Requires Permission:
{@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
return getLine1NumberForSubscriber(getDefaultSubscription());
|
public java.lang.String | getLine1NumberForSubscriber(int subId){@hide}
String number = null;
try {
number = getITelephony().getLine1NumberForDisplay(subId);
} catch (RemoteException ex) {
} catch (NullPointerException ex) {
}
if (number != null) {
return number;
}
try {
return getSubscriberInfo().getLine1NumberForSubscriber(subId);
} catch (RemoteException ex) {
return null;
} catch (NullPointerException ex) {
// This could happen before phone restarts due to crashing
return null;
}
|
public int | getLteOnCdmaMode()Return if the current radio is LTE on CDMA. This
is a tri-state return value as for a period of time
the mode may be unknown.
return getLteOnCdmaMode(getDefaultSubscription());
|
public int | getLteOnCdmaMode(int subId){@hide}
try {
return getITelephony().getLteOnCdmaModeForSubscriber(subId);
} catch (RemoteException ex) {
// Assume no ICC card if remote exception which shouldn't happen
return PhoneConstants.LTE_ON_CDMA_UNKNOWN;
} catch (NullPointerException ex) {
// This could happen before phone restarts due to crashing
return PhoneConstants.LTE_ON_CDMA_UNKNOWN;
}
|
public static int | getLteOnCdmaModeStatic()Return if the current radio is LTE on CDMA. This
is a tri-state return value as for a period of time
the mode may be unknown.
int retVal;
int curVal;
String productType = "";
curVal = SystemProperties.getInt(TelephonyProperties.PROPERTY_LTE_ON_CDMA_DEVICE,
PhoneConstants.LTE_ON_CDMA_UNKNOWN);
retVal = curVal;
if (retVal == PhoneConstants.LTE_ON_CDMA_UNKNOWN) {
Matcher matcher = sProductTypePattern.matcher(sKernelCmdLine);
if (matcher.find()) {
productType = matcher.group(1);
if (sLteOnCdmaProductType.equals(productType)) {
retVal = PhoneConstants.LTE_ON_CDMA_TRUE;
} else {
retVal = PhoneConstants.LTE_ON_CDMA_FALSE;
}
} else {
retVal = PhoneConstants.LTE_ON_CDMA_FALSE;
}
}
Rlog.d(TAG, "getLteOnCdmaMode=" + retVal + " curVal=" + curVal +
" product_type='" + productType +
"' lteOnCdmaProductType='" + sLteOnCdmaProductType + "'");
return retVal;
|
public java.lang.String[] | getMergedSubscriberIds()Return the set of subscriber IDs that should be considered as "merged
together" for data usage purposes. This is commonly {@code null} to
indicate no merging is required. Any returned subscribers are sorted in a
deterministic order.
try {
return getITelephony().getMergedSubscriberIds();
} catch (RemoteException ex) {
} catch (NullPointerException ex) {
}
return null;
|
public java.lang.String | getMmsUAProfUrl()Returns the MMS user agent profile URL.
if (mContext == null) return null;
return mContext.getResources().getString(
com.android.internal.R.string.config_mms_user_agent_profile_url);
|
public java.lang.String | getMmsUserAgent()Returns the MMS user agent.
if (mContext == null) return null;
return mContext.getResources().getString(
com.android.internal.R.string.config_mms_user_agent);
|
public java.lang.String | getMsisdn()Returns the MSISDN string.
for a GSM phone. Return null if it is unavailable.
Requires Permission:
{@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
return getMsisdn(getDefaultSubscription());
|
public java.lang.String | getMsisdn(int subId){@hide}
try {
return getSubscriberInfo().getMsisdnForSubscriber(subId);
} catch (RemoteException ex) {
return null;
} catch (NullPointerException ex) {
// This could happen before phone restarts due to crashing
return null;
}
|
public android.telephony.TelephonyManager$MultiSimVariants | getMultiSimConfiguration(){@hide}
String mSimConfig =
SystemProperties.get(TelephonyProperties.PROPERTY_MULTI_SIM_CONFIG);
if (mSimConfig.equals("dsds")) {
return MultiSimVariants.DSDS;
} else if (mSimConfig.equals("dsda")) {
return MultiSimVariants.DSDA;
} else if (mSimConfig.equals("tsts")) {
return MultiSimVariants.TSTS;
} else {
return MultiSimVariants.UNKNOWN;
}
|
public java.lang.String | getNai(){@hide}
return getNai(getDefaultSim());
|
public java.lang.String | getNai(int slotId){@hide}
int[] subId = SubscriptionManager.getSubId(slotId);
try {
String nai = getSubscriberInfo().getNaiForSubscriber(subId[0]);
if (Log.isLoggable(TAG, Log.VERBOSE)) {
Rlog.v(TAG, "Nai = " + nai);
}
return nai;
} catch (RemoteException ex) {
return null;
} catch (NullPointerException ex) {
return null;
}
|
public java.util.List | getNeighboringCellInfo()Returns the neighboring cell information of the device. The getAllCellInfo is preferred
and use this only if getAllCellInfo return nulls or an empty list.
In the future this call will be deprecated.
try {
return getITelephony().getNeighboringCellInfo(mContext.getOpPackageName());
} catch (RemoteException ex) {
return null;
} catch (NullPointerException ex) {
return null;
}
|
public static int | getNetworkClass(int networkType)Return general class of network type, such as "3G" or "4G". In cases
where classification is contentious, this method is conservative.
switch (networkType) {
case NETWORK_TYPE_GPRS:
case NETWORK_TYPE_GSM:
case NETWORK_TYPE_EDGE:
case NETWORK_TYPE_CDMA:
case NETWORK_TYPE_1xRTT:
case NETWORK_TYPE_IDEN:
return NETWORK_CLASS_2_G;
case NETWORK_TYPE_UMTS:
case NETWORK_TYPE_EVDO_0:
case NETWORK_TYPE_EVDO_A:
case NETWORK_TYPE_HSDPA:
case NETWORK_TYPE_HSUPA:
case NETWORK_TYPE_HSPA:
case NETWORK_TYPE_EVDO_B:
case NETWORK_TYPE_EHRPD:
case NETWORK_TYPE_HSPAP:
return NETWORK_CLASS_3_G;
case NETWORK_TYPE_LTE:
return NETWORK_CLASS_4_G;
default:
return NETWORK_CLASS_UNKNOWN;
}
|
public java.lang.String | getNetworkCountryIso()Returns the ISO country code equivalent of the current registered
operator's MCC (Mobile Country Code).
Availability: Only when user is registered to a network. Result may be
unreliable on CDMA networks (use {@link #getPhoneType()} to determine if
on a CDMA network).
return getNetworkCountryIsoForPhone(getDefaultPhone());
|
public java.lang.String | getNetworkCountryIsoForPhone(int phoneId){@hide}
return getTelephonyProperty(phoneId, TelephonyProperties.PROPERTY_OPERATOR_ISO_COUNTRY, "");
|
public java.lang.String | getNetworkCountryIsoForSubscription(int subId){@hide}
int phoneId = SubscriptionManager.getPhoneId(subId);
return getNetworkCountryIsoForPhone(phoneId);
|
public java.lang.String | getNetworkOperator()Returns the numeric name (MCC+MNC) of current registered operator.
Availability: Only when user is registered to a network. Result may be
unreliable on CDMA networks (use {@link #getPhoneType()} to determine if
on a CDMA network).
return getNetworkOperatorForPhone(getDefaultPhone());
|
public java.lang.String | getNetworkOperatorForPhone(int phoneId)Returns the numeric name (MCC+MNC) of current registered operator
for a particular subscription.
Availability: Only when user is registered to a network. Result may be
unreliable on CDMA networks (use {@link #getPhoneType()} to determine if
on a CDMA network).
return getTelephonyProperty(phoneId, TelephonyProperties.PROPERTY_OPERATOR_NUMERIC, "");
|
public java.lang.String | getNetworkOperatorForSubscription(int subId){@hide}
int phoneId = SubscriptionManager.getPhoneId(subId);
return getNetworkOperatorForPhone(phoneId);
|
public java.lang.String | getNetworkOperatorName()Returns the alphabetic name of current registered operator.
Availability: Only when user is registered to a network. Result may be
unreliable on CDMA networks (use {@link #getPhoneType()} to determine if
on a CDMA network).
return getNetworkOperatorName(getDefaultSubscription());
|
public java.lang.String | getNetworkOperatorName(int subId){@hide}
int phoneId = SubscriptionManager.getPhoneId(subId);
return getTelephonyProperty(phoneId, TelephonyProperties.PROPERTY_OPERATOR_ALPHA, "");
|
public int | getNetworkType()
return getDataNetworkType();
|
public int | getNetworkType(int subId){@hide}
try {
ITelephony telephony = getITelephony();
if (telephony != null) {
return telephony.getNetworkTypeForSubscriber(subId);
} else {
// This can happen when the ITelephony interface is not up yet.
return NETWORK_TYPE_UNKNOWN;
}
} catch(RemoteException ex) {
// This shouldn't happen in the normal case
return NETWORK_TYPE_UNKNOWN;
} catch (NullPointerException ex) {
// This could happen before phone restarts due to crashing
return NETWORK_TYPE_UNKNOWN;
}
|
public java.lang.String | getNetworkTypeName()Returns a string representation of the radio technology (network type)
currently in use on the device.
return getNetworkTypeName(getNetworkType());
|
public static java.lang.String | getNetworkTypeName(int type){@hide}
switch (type) {
case NETWORK_TYPE_GPRS:
return "GPRS";
case NETWORK_TYPE_EDGE:
return "EDGE";
case NETWORK_TYPE_UMTS:
return "UMTS";
case NETWORK_TYPE_HSDPA:
return "HSDPA";
case NETWORK_TYPE_HSUPA:
return "HSUPA";
case NETWORK_TYPE_HSPA:
return "HSPA";
case NETWORK_TYPE_CDMA:
return "CDMA";
case NETWORK_TYPE_EVDO_0:
return "CDMA - EvDo rev. 0";
case NETWORK_TYPE_EVDO_A:
return "CDMA - EvDo rev. A";
case NETWORK_TYPE_EVDO_B:
return "CDMA - EvDo rev. B";
case NETWORK_TYPE_1xRTT:
return "CDMA - 1xRTT";
case NETWORK_TYPE_LTE:
return "LTE";
case NETWORK_TYPE_EHRPD:
return "CDMA - eHRPD";
case NETWORK_TYPE_IDEN:
return "iDEN";
case NETWORK_TYPE_HSPAP:
return "HSPA+";
case NETWORK_TYPE_GSM:
return "GSM";
default:
return "UNKNOWN";
}
|
public java.lang.String | getOtaSpNumberSchema(java.lang.String defaultValue)Get OTASP number schema for the default phone.
int phoneId = getDefaultPhone();
return getOtaSpNumberSchemaForPhone(phoneId, defaultValue);
|
public java.lang.String | getOtaSpNumberSchemaForPhone(int phoneId, java.lang.String defaultValue)Get OTASP number schema by phone id.
if (SubscriptionManager.isValidPhoneId(phoneId)) {
return TelephonyManager.getTelephonyProperty(phoneId,
TelephonyProperties.PROPERTY_OTASP_NUM_SCHEMA, defaultValue);
}
return defaultValue;
|
public java.lang.String[] | getPcscfAddress(java.lang.String apnType)Get P-CSCF address from PCO after data connection is established or modified.
try {
return getITelephony().getPcscfAddress(apnType);
} catch (RemoteException e) {
return new String[0];
}
|
public int | getPhoneCount(){@hide}
int phoneCount = 1;
switch (getMultiSimConfiguration()) {
case UNKNOWN:
phoneCount = 1;
break;
case DSDS:
case DSDA:
phoneCount = PhoneConstants.MAX_PHONE_COUNT_DUAL_SIM;
break;
case TSTS:
phoneCount = PhoneConstants.MAX_PHONE_COUNT_TRI_SIM;
break;
}
return phoneCount;
|
public int | getPhoneType()Returns a constant indicating the device phone type. This
indicates the type of radio used to transmit voice calls.
if (!isVoiceCapable()) {
return PHONE_TYPE_NONE;
}
return getCurrentPhoneType();
|
public static int | getPhoneType(int networkMode)This function returns the type of the phone, depending
on the network mode.
switch(networkMode) {
case RILConstants.NETWORK_MODE_CDMA:
case RILConstants.NETWORK_MODE_CDMA_NO_EVDO:
case RILConstants.NETWORK_MODE_EVDO_NO_CDMA:
return PhoneConstants.PHONE_TYPE_CDMA;
case RILConstants.NETWORK_MODE_WCDMA_PREF:
case RILConstants.NETWORK_MODE_GSM_ONLY:
case RILConstants.NETWORK_MODE_WCDMA_ONLY:
case RILConstants.NETWORK_MODE_GSM_UMTS:
case RILConstants.NETWORK_MODE_LTE_GSM_WCDMA:
case RILConstants.NETWORK_MODE_LTE_WCDMA:
case RILConstants.NETWORK_MODE_LTE_CDMA_EVDO_GSM_WCDMA:
return PhoneConstants.PHONE_TYPE_GSM;
// Use CDMA Phone for the global mode including CDMA
case RILConstants.NETWORK_MODE_GLOBAL:
case RILConstants.NETWORK_MODE_LTE_CDMA_EVDO:
return PhoneConstants.PHONE_TYPE_CDMA;
case RILConstants.NETWORK_MODE_LTE_ONLY:
if (getLteOnCdmaModeStatic() == PhoneConstants.LTE_ON_CDMA_TRUE) {
return PhoneConstants.PHONE_TYPE_CDMA;
} else {
return PhoneConstants.PHONE_TYPE_GSM;
}
default:
return PhoneConstants.PHONE_TYPE_GSM;
}
|
private int | getPhoneTypeFromNetworkType()
return getPhoneTypeFromNetworkType(getDefaultPhone());
|
private int | getPhoneTypeFromNetworkType(int phoneId){@hide}
// When the system property CURRENT_ACTIVE_PHONE, has not been set,
// use the system property for default network type.
// This is a fail safe, and can only happen at first boot.
String mode = getTelephonyProperty(phoneId, "ro.telephony.default_network", null);
if (mode != null) {
return TelephonyManager.getPhoneType(Integer.parseInt(mode));
}
return TelephonyManager.PHONE_TYPE_NONE;
|
private int | getPhoneTypeFromProperty()
return getPhoneTypeFromProperty(getDefaultPhone());
|
private int | getPhoneTypeFromProperty(int phoneId){@hide}
String type = getTelephonyProperty(phoneId,
TelephonyProperties.CURRENT_ACTIVE_PHONE, null);
if (type == null || type.equals("")) {
return getPhoneTypeFromNetworkType(phoneId);
}
return Integer.parseInt(type);
|
public int | getPreferredNetworkType()Get the preferred network type.
Used for device configuration by some CDMA operators.
Requires Permission:
{@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}
Or the calling app has carrier privileges. @see #hasCarrierPrivileges
try {
return getITelephony().getPreferredNetworkType();
} catch (RemoteException ex) {
Rlog.e(TAG, "getPreferredNetworkType RemoteException", ex);
} catch (NullPointerException ex) {
Rlog.e(TAG, "getPreferredNetworkType NPE", ex);
}
return -1;
|
private static java.lang.String | getProcCmdLine()The contents of the /proc/cmdline file
String cmdline = "";
FileInputStream is = null;
try {
is = new FileInputStream("/proc/cmdline");
byte [] buffer = new byte[2048];
int count = is.read(buffer);
if (count > 0) {
cmdline = new String(buffer, 0, count);
}
} catch (IOException e) {
Rlog.d(TAG, "No /proc/cmdline exception=" + e);
} finally {
if (is != null) {
try {
is.close();
} catch (IOException e) {
}
}
}
Rlog.d(TAG, "/proc/cmdline=" + cmdline);
return cmdline;
|
public int | getSimCount()
// FIXME Need to get it from Telephony Dev Controller when that gets implemented!
// and then this method shouldn't be used at all!
if(isMultiSimEnabled()) {
return 2;
} else {
return 1;
}
|
public java.lang.String | getSimCountryIso()Returns the ISO country code equivalent for the SIM provider's country code.
return getSimCountryIsoForPhone(getDefaultPhone());
|
public java.lang.String | getSimCountryIso(int subId)Returns the ISO country code equivalent for the SIM provider's country code.
return getSimCountryIsoForSubscription(subId);
|
public java.lang.String | getSimCountryIsoForPhone(int phoneId)Returns the ISO country code equivalent for the SIM provider's country code.
return getTelephonyProperty(phoneId,
TelephonyProperties.PROPERTY_ICC_OPERATOR_ISO_COUNTRY, "");
|
public java.lang.String | getSimCountryIsoForSubscription(int subId)Returns the ISO country code equivalent for the SIM provider's country code.
int phoneId = SubscriptionManager.getPhoneId(subId);
return getSimCountryIsoForPhone(phoneId);
|
public java.lang.String | getSimOperator()Returns the MCC+MNC (mobile country code + mobile network code) of the
provider of the SIM. 5 or 6 decimal digits.
Availability: SIM state must be {@link #SIM_STATE_READY}
return getSimOperatorNumeric();
|
public java.lang.String | getSimOperator(int subId)Returns the MCC+MNC (mobile country code + mobile network code) of the
provider of the SIM. 5 or 6 decimal digits.
Availability: SIM state must be {@link #SIM_STATE_READY}
return getSimOperatorNumericForSubscription(subId);
|
public java.lang.String | getSimOperatorName()Returns the Service Provider Name (SPN).
Availability: SIM state must be {@link #SIM_STATE_READY}
return getSimOperatorNameForPhone(getDefaultPhone());
|
public java.lang.String | getSimOperatorNameForPhone(int phoneId)Returns the Service Provider Name (SPN).
return getTelephonyProperty(phoneId,
TelephonyProperties.PROPERTY_ICC_OPERATOR_ALPHA, "");
|
public java.lang.String | getSimOperatorNameForSubscription(int subId)Returns the Service Provider Name (SPN).
Availability: SIM state must be {@link #SIM_STATE_READY}
int phoneId = SubscriptionManager.getPhoneId(subId);
return getSimOperatorNameForPhone(phoneId);
|
public java.lang.String | getSimOperatorNumeric()Returns the MCC+MNC (mobile country code + mobile network code) of the
provider of the SIM. 5 or 6 decimal digits.
Availability: SIM state must be {@link #SIM_STATE_READY}
int subId = SubscriptionManager.getDefaultDataSubId();
if (!SubscriptionManager.isUsableSubIdValue(subId)) {
subId = SubscriptionManager.getDefaultSmsSubId();
if (!SubscriptionManager.isUsableSubIdValue(subId)) {
subId = SubscriptionManager.getDefaultVoiceSubId();
if (!SubscriptionManager.isUsableSubIdValue(subId)) {
subId = SubscriptionManager.getDefaultSubId();
}
}
}
Rlog.d(TAG, "getSimOperatorNumeric(): default subId=" + subId);
return getSimOperatorNumericForSubscription(subId);
|
public java.lang.String | getSimOperatorNumericForPhone(int phoneId)Returns the MCC+MNC (mobile country code + mobile network code) of the
provider of the SIM for a particular subscription. 5 or 6 decimal digits.
return getTelephonyProperty(phoneId,
TelephonyProperties.PROPERTY_ICC_OPERATOR_NUMERIC, "");
|
public java.lang.String | getSimOperatorNumericForSubscription(int subId)Returns the MCC+MNC (mobile country code + mobile network code) of the
provider of the SIM for a particular subscription. 5 or 6 decimal digits.
Availability: SIM state must be {@link #SIM_STATE_READY}
int phoneId = SubscriptionManager.getPhoneId(subId);
return getSimOperatorNumericForPhone(phoneId);
|
public java.lang.String | getSimSerialNumber()Returns the serial number of the SIM, if applicable. Return null if it is
unavailable.
Requires Permission:
{@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
return getSimSerialNumber(getDefaultSubscription());
|
public java.lang.String | getSimSerialNumber(int subId){@hide}
try {
return getSubscriberInfo().getIccSerialNumberForSubscriber(subId);
} catch (RemoteException ex) {
return null;
} catch (NullPointerException ex) {
// This could happen before phone restarts due to crashing
return null;
}
|
public int | getSimState()Returns a constant indicating the state of the default SIM card.
return getSimState(getDefaultSim());
|
public int | getSimState(int slotIdx){@hide}
int[] subId = SubscriptionManager.getSubId(slotIdx);
if (subId == null || subId.length == 0) {
Rlog.d(TAG, "getSimState:- empty subId return SIM_STATE_ABSENT");
return SIM_STATE_UNKNOWN;
}
int simState = SubscriptionManager.getSimStateForSubscriber(subId[0]);
Rlog.d(TAG, "getSimState: simState=" + simState + " slotIdx=" + slotIdx);
return simState;
|
public boolean | getSmsReceiveCapable(boolean defaultValue)Get SMS receive capable from system property for the default phone.
int phoneId = getDefaultPhone();
return getSmsReceiveCapableForPhone(phoneId, defaultValue);
|
public boolean | getSmsReceiveCapableForPhone(int phoneId, boolean defaultValue)Get SMS receive capable from system property by phone id.
if (SubscriptionManager.isValidPhoneId(phoneId)) {
return Boolean.valueOf(TelephonyManager.getTelephonyProperty(phoneId,
TelephonyProperties.PROPERTY_SMS_RECEIVE, String.valueOf(defaultValue)));
}
return defaultValue;
|
public boolean | getSmsSendCapable(boolean defaultValue)Get SMS send capable from system property for the default phone.
int phoneId = getDefaultPhone();
return getSmsSendCapableForPhone(phoneId, defaultValue);
|
public boolean | getSmsSendCapableForPhone(int phoneId, boolean defaultValue)Get SMS send capable from system property by phone id.
if (SubscriptionManager.isValidPhoneId(phoneId)) {
return Boolean.valueOf(TelephonyManager.getTelephonyProperty(phoneId,
TelephonyProperties.PROPERTY_SMS_SEND, String.valueOf(defaultValue)));
}
return defaultValue;
|
public java.lang.String | getSubscriberId()Returns the unique subscriber ID, for example, the IMSI for a GSM phone.
Return null if it is unavailable.
Requires Permission:
{@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
return getSubscriberId(getDefaultSubscription());
|
public java.lang.String | getSubscriberId(int subId){@hide}
try {
return getSubscriberInfo().getSubscriberIdForSubscriber(subId);
} catch (RemoteException ex) {
return null;
} catch (NullPointerException ex) {
// This could happen before phone restarts due to crashing
return null;
}
|
private com.android.internal.telephony.IPhoneSubInfo | getSubscriberInfo()
// get it each time because that process crashes a lot
return IPhoneSubInfo.Stub.asInterface(ServiceManager.getService("iphonesubinfo"));
|
private com.android.internal.telecom.ITelecomService | getTelecomService()
return ITelecomService.Stub.asInterface(ServiceManager.getService(Context.TELECOM_SERVICE));
|
public static java.lang.String | getTelephonyProperty(int phoneId, java.lang.String property, java.lang.String defaultVal)Gets the telephony property.
String propVal = null;
String prop = SystemProperties.get(property);
if ((prop != null) && (prop.length() > 0)) {
String values[] = prop.split(",");
if ((phoneId >= 0) && (phoneId < values.length) && (values[phoneId] != null)) {
propVal = values[phoneId];
}
}
Rlog.d(TAG, "getTelephonyProperty: return propVal='" + propVal + "' phoneId=" + phoneId
+ " property='" + property + "' defaultVal='" + defaultVal + "' prop=" + prop);
return propVal == null ? defaultVal : propVal;
|
public int | getTetherApnRequired()Check TETHER_DUN_REQUIRED and TETHER_DUN_APN settings, net.tethering.noprovisioning
SystemProperty, and config_tether_apndata to decide whether DUN APN is required for
tethering.
try {
return getITelephony().getTetherApnRequired();
} catch (RemoteException ex) {
Rlog.e(TAG, "hasMatchedTetherApnSetting RemoteException", ex);
} catch (NullPointerException ex) {
Rlog.e(TAG, "hasMatchedTetherApnSetting NPE", ex);
}
return 2;
|
public java.lang.String | getVoiceMailAlphaTag()Retrieves the alphabetic identifier associated with the voice
mail number.
Requires Permission:
{@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
return getVoiceMailAlphaTag(getDefaultSubscription());
|
public java.lang.String | getVoiceMailAlphaTag(int subId){@hide}
try {
return getSubscriberInfo().getVoiceMailAlphaTagForSubscriber(subId);
} catch (RemoteException ex) {
return null;
} catch (NullPointerException ex) {
// This could happen before phone restarts due to crashing
return null;
}
|
public java.lang.String | getVoiceMailNumber()Returns the voice mail number. Return null if it is unavailable.
Requires Permission:
{@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
return getVoiceMailNumber(getDefaultSubscription());
|
public java.lang.String | getVoiceMailNumber(int subId){@hide}
try {
return getSubscriberInfo().getVoiceMailNumberForSubscriber(subId);
} catch (RemoteException ex) {
return null;
} catch (NullPointerException ex) {
// This could happen before phone restarts due to crashing
return null;
}
|
public int | getVoiceMessageCount()Returns the voice mail count. Return 0 if unavailable.
Requires Permission:
{@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
return getVoiceMessageCount(getDefaultSubscription());
|
public int | getVoiceMessageCount(int subId){@hide}
try {
return getITelephony().getVoiceMessageCountForSubscriber(subId);
} catch (RemoteException ex) {
return 0;
} catch (NullPointerException ex) {
// This could happen before phone restarts due to crashing
return 0;
}
|
public int | getVoiceNetworkType()Returns the NETWORK_TYPE_xxxx for voice
return getVoiceNetworkType(getDefaultSubscription());
|
public int | getVoiceNetworkType(int subId){@hide}
try{
ITelephony telephony = getITelephony();
if (telephony != null) {
return telephony.getVoiceNetworkTypeForSubscriber(subId);
} else {
// This can happen when the ITelephony interface is not up yet.
return NETWORK_TYPE_UNKNOWN;
}
} catch(RemoteException ex) {
// This shouldn't happen in the normal case
return NETWORK_TYPE_UNKNOWN;
} catch (NullPointerException ex) {
// This could happen before phone restarts due to crashing
return NETWORK_TYPE_UNKNOWN;
}
|
public boolean | handlePinMmi(java.lang.String dialString)
try {
return getITelephony().handlePinMmi(dialString);
} catch (RemoteException e) {
Log.e(TAG, "Error calling ITelephony#handlePinMmi", e);
}
return false;
|
public boolean | handlePinMmiForSubscriber(int subId, java.lang.String dialString)
try {
return getITelephony().handlePinMmiForSubscriber(subId, dialString);
} catch (RemoteException e) {
Log.e(TAG, "Error calling ITelephony#handlePinMmi", e);
}
return false;
|
public boolean | hasCarrierPrivileges()Has the calling application been granted carrier 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.
try {
return getITelephony().getCarrierPrivilegeStatus() ==
CARRIER_PRIVILEGE_STATUS_HAS_ACCESS;
} catch (RemoteException ex) {
Rlog.e(TAG, "hasCarrierPrivileges RemoteException", ex);
} catch (NullPointerException ex) {
Rlog.e(TAG, "hasCarrierPrivileges NPE", ex);
}
return false;
|
public boolean | hasIccCard()
return hasIccCard(getDefaultSim());
|
public boolean | hasIccCard(int slotId){@hide}
try {
return getITelephony().hasIccCardUsingSlotId(slotId);
} catch (RemoteException ex) {
// Assume no ICC card if remote exception which shouldn't happen
return false;
} catch (NullPointerException ex) {
// This could happen before phone restarts due to crashing
return false;
}
|
public boolean | iccCloseLogicalChannel(int channel)Closes a previously opened logical channel to the ICC card.
Input parameters equivalent to TS 27.007 AT+CCHC command.
Requires Permission:
{@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}
Or the calling app has carrier privileges. @see #hasCarrierPrivileges
try {
return getITelephony().iccCloseLogicalChannel(channel);
} catch (RemoteException ex) {
} catch (NullPointerException ex) {
}
return false;
|
public byte[] | iccExchangeSimIO(int fileID, int command, int p1, int p2, int p3, java.lang.String filePath)Returns the response APDU for a command APDU sent through SIM_IO.
Requires Permission:
{@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}
Or the calling app has carrier privileges. @see #hasCarrierPrivileges
try {
return getITelephony().iccExchangeSimIO(fileID, command, p1, p2,
p3, filePath);
} catch (RemoteException ex) {
} catch (NullPointerException ex) {
}
return null;
|
public IccOpenLogicalChannelResponse | iccOpenLogicalChannel(java.lang.String AID)Opens a logical channel to the ICC card.
Input parameters equivalent to TS 27.007 AT+CCHO command.
Requires Permission:
{@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}
Or the calling app has carrier privileges. @see #hasCarrierPrivileges
try {
return getITelephony().iccOpenLogicalChannel(AID);
} catch (RemoteException ex) {
} catch (NullPointerException ex) {
}
return null;
|
public java.lang.String | iccTransmitApduBasicChannel(int cla, int instruction, int p1, int p2, int p3, java.lang.String data)Transmit an APDU to the ICC card over the basic channel.
Input parameters equivalent to TS 27.007 AT+CSIM command.
Requires Permission:
{@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}
Or the calling app has carrier privileges. @see #hasCarrierPrivileges
try {
return getITelephony().iccTransmitApduBasicChannel(cla,
instruction, p1, p2, p3, data);
} catch (RemoteException ex) {
} catch (NullPointerException ex) {
}
return "";
|
public java.lang.String | iccTransmitApduLogicalChannel(int channel, int cla, int instruction, int p1, int p2, int p3, java.lang.String data)Transmit an APDU to the ICC card over a logical channel.
Input parameters equivalent to TS 27.007 AT+CGLA command.
Requires Permission:
{@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}
Or the calling app has carrier privileges. @see #hasCarrierPrivileges
try {
return getITelephony().iccTransmitApduLogicalChannel(channel, cla,
instruction, p1, p2, p3, data);
} catch (RemoteException ex) {
} catch (NullPointerException ex) {
}
return "";
|
public int | invokeOemRilRequestRaw(byte[] oemReq, byte[] oemResp)Returns the result and response from RIL for oem request
try {
return getITelephony().invokeOemRilRequestRaw(oemReq, oemResp);
} catch (RemoteException ex) {
} catch (NullPointerException ex) {
}
return -1;
|
public boolean | isDataConnectivityPossible()
try {
return getITelephony().isDataConnectivityPossible();
} catch (RemoteException e) {
Log.e(TAG, "Error calling ITelephony#isDataConnectivityPossible", e);
}
return false;
|
public boolean | isIdle()
try {
return getITelephony().isIdle();
} catch (RemoteException e) {
Log.e(TAG, "Error calling ITelephony#isIdle", e);
}
return true;
|
public boolean | isImsRegistered()Returns the IMS Registration Status
try {
return getITelephony().isImsRegistered();
} catch (RemoteException ex) {
return false;
} catch (NullPointerException ex) {
return false;
}
|
public boolean | isMultiSimEnabled(){@hide}
return (multiSimConfig.equals("dsds") || multiSimConfig.equals("dsda") ||
multiSimConfig.equals("tsts"));
|
public boolean | isNetworkRoaming()Returns true if the device is considered roaming on the current
network, for GSM purposes.
Availability: Only when user registered to a network.
return isNetworkRoaming(getDefaultSubscription());
|
public boolean | isNetworkRoaming(int subId){@hide}
int phoneId = SubscriptionManager.getPhoneId(subId);
return Boolean.parseBoolean(getTelephonyProperty(phoneId,
TelephonyProperties.PROPERTY_OPERATOR_ISROAMING, null));
|
public boolean | isOffhook()
try {
return getITelephony().isOffhook();
} catch (RemoteException e) {
Log.e(TAG, "Error calling ITelephony#isOffhook", e);
}
return false;
|
public boolean | isRadioOn()
try {
return getITelephony().isRadioOn();
} catch (RemoteException e) {
Log.e(TAG, "Error calling ITelephony#isRadioOn", e);
}
return false;
|
public boolean | isRinging()
try {
return getITelephony().isRinging();
} catch (RemoteException e) {
Log.e(TAG, "Error calling ITelephony#isRinging", e);
}
return false;
|
public boolean | isSimPinEnabled()
try {
return getITelephony().isSimPinEnabled();
} catch (RemoteException e) {
Log.e(TAG, "Error calling ITelephony#isSimPinEnabled", e);
}
return false;
|
public boolean | isSmsCapable()
if (mContext == null) return true;
return mContext.getResources().getBoolean(
com.android.internal.R.bool.config_sms_capable);
|
public boolean | isVideoCallingEnabled()
try {
return getITelephony().isVideoCallingEnabled();
} catch (RemoteException e) {
Log.e(TAG, "Error calling ITelephony#isVideoCallingEnabled", e);
}
return false;
|
public boolean | isVoiceCapable()
if (mContext == null) return true;
return mContext.getResources().getBoolean(
com.android.internal.R.bool.config_voice_capable);
|
public void | listen(PhoneStateListener listener, int events)Registers a listener object to receive notification of changes
in specified telephony states.
To register a listener, pass a {@link PhoneStateListener}
and specify at least one telephony state of interest in
the events argument.
At registration, and when a specified telephony state
changes, the telephony manager invokes the appropriate
callback method on the listener object and passes the
current (updated) values.
To unregister a listener, pass the listener object and set the
events argument to
{@link PhoneStateListener#LISTEN_NONE LISTEN_NONE} (0).
String pkgForDebug = mContext != null ? mContext.getPackageName() : "<unknown>";
try {
Boolean notifyNow = (getITelephony() != null);
sRegistry.listenForSubscriber(listener.mSubId, pkgForDebug, listener.callback, events, notifyNow);
} catch (RemoteException ex) {
// system process dead
} catch (NullPointerException ex) {
// system process dead
}
|
public boolean | needsOtaServiceProvisioning()
try {
return getITelephony().needsOtaServiceProvisioning();
} catch (RemoteException e) {
Log.e(TAG, "Error calling ITelephony#needsOtaServiceProvisioning", e);
}
return false;
|
public java.lang.String | nvReadItem(int itemID)Read one of the NV items defined in com.android.internal.telephony.RadioNVItems.
Used for device configuration by some CDMA operators.
Requires Permission:
{@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}
Or the calling app has carrier privileges. @see #hasCarrierPrivileges
try {
return getITelephony().nvReadItem(itemID);
} catch (RemoteException ex) {
Rlog.e(TAG, "nvReadItem RemoteException", ex);
} catch (NullPointerException ex) {
Rlog.e(TAG, "nvReadItem NPE", ex);
}
return "";
|
public boolean | nvResetConfig(int resetType)Perform the specified type of NV config reset. The radio will be taken offline
and the device must be rebooted after the operation. Used for device
configuration by some CDMA operators.
Requires Permission:
{@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}
Or the calling app has carrier privileges. @see #hasCarrierPrivileges
try {
return getITelephony().nvResetConfig(resetType);
} catch (RemoteException ex) {
Rlog.e(TAG, "nvResetConfig RemoteException", ex);
} catch (NullPointerException ex) {
Rlog.e(TAG, "nvResetConfig NPE", ex);
}
return false;
|
public boolean | nvWriteCdmaPrl(byte[] preferredRoamingList)Update the CDMA Preferred Roaming List (PRL) in the radio NV storage.
Used for device configuration by some CDMA operators.
Requires Permission:
{@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}
Or the calling app has carrier privileges. @see #hasCarrierPrivileges
try {
return getITelephony().nvWriteCdmaPrl(preferredRoamingList);
} catch (RemoteException ex) {
Rlog.e(TAG, "nvWriteCdmaPrl RemoteException", ex);
} catch (NullPointerException ex) {
Rlog.e(TAG, "nvWriteCdmaPrl NPE", ex);
}
return false;
|
public boolean | nvWriteItem(int itemID, java.lang.String itemValue)Write one of the NV items defined in com.android.internal.telephony.RadioNVItems.
Used for device configuration by some CDMA operators.
Requires Permission:
{@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}
Or the calling app has carrier privileges. @see #hasCarrierPrivileges
try {
return getITelephony().nvWriteItem(itemID, itemValue);
} catch (RemoteException ex) {
Rlog.e(TAG, "nvWriteItem RemoteException", ex);
} catch (NullPointerException ex) {
Rlog.e(TAG, "nvWriteItem NPE", ex);
}
return false;
|
public static boolean | putIntAtIndex(android.content.ContentResolver cr, java.lang.String name, int index, int value)Convenience function for updating settings value as coma separated
integer values. This will either create a new entry in the table if the
given name does not exist, or modify the value of the existing row
with that name. Note that internally setting values are always
stored as strings, so this function converts the given value to a
string before storing it.
String data = "";
String valArray[] = null;
String v = android.provider.Settings.Global.getString(cr, name);
if (index == Integer.MAX_VALUE) {
throw new RuntimeException("putIntAtIndex index == MAX_VALUE index=" + index);
}
if (index < 0) {
throw new RuntimeException("putIntAtIndex index < 0 index=" + index);
}
if (v != null) {
valArray = v.split(",");
}
// Copy the elements from valArray till index
for (int i = 0; i < index; i++) {
String str = "";
if ((valArray != null) && (i < valArray.length)) {
str = valArray[i];
}
data = data + str + ",";
}
data = data + value;
// Copy the remaining elements from valArray if any.
if (valArray != null) {
for (int i = index+1; i < valArray.length; i++) {
data = data + "," + valArray[i];
}
}
return android.provider.Settings.Global.putString(cr, name, data);
|
public java.lang.String | sendEnvelopeWithStatus(java.lang.String content)Send ENVELOPE to the SIM and return the response.
Requires Permission:
{@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}
Or the calling app has carrier privileges. @see #hasCarrierPrivileges
try {
return getITelephony().sendEnvelopeWithStatus(content);
} catch (RemoteException ex) {
} catch (NullPointerException ex) {
}
return "";
|
public void | setBasebandVersion(java.lang.String version)Set baseband version for the default phone.
int phoneId = getDefaultPhone();
setBasebandVersionForPhone(phoneId, version);
|
public void | setBasebandVersionForPhone(int phoneId, java.lang.String version)Set baseband version by phone id.
if (SubscriptionManager.isValidPhoneId(phoneId)) {
String prop = TelephonyProperties.PROPERTY_BASEBAND_VERSION +
((phoneId == 0) ? "" : Integer.toString(phoneId));
SystemProperties.set(prop, version);
}
|
public void | setCellInfoListRate(int rateInMillis)Sets the minimum time in milli-seconds between {@link PhoneStateListener#onCellInfoChanged
PhoneStateListener.onCellInfoChanged} will be invoked.
The default, 0, means invoke onCellInfoChanged when any of the reported
information changes. Setting the value to INT_MAX(0x7fffffff) means never issue
A onCellInfoChanged.
try {
getITelephony().setCellInfoListRate(rateInMillis);
} catch (RemoteException ex) {
} catch (NullPointerException ex) {
}
|
public void | setDataEnabled(boolean enable)
setDataEnabled(SubscriptionManager.getDefaultDataSubId(), enable);
|
public void | setDataEnabled(int subId, boolean enable)
try {
Log.d(TAG, "setDataEnabled: enabled=" + enable);
getITelephony().setDataEnabled(subId, enable);
} catch (RemoteException e) {
Log.e(TAG, "Error calling ITelephony#setDataEnabled", e);
}
|
public void | setDataNetworkType(int type)Set the network type currently in use on the device for data transmission.
int phoneId = getDefaultPhone();
setDataNetworkTypeForPhone(phoneId, type);
|
public void | setDataNetworkTypeForPhone(int phoneId, int type)Set the network type currently in use on the device for data transmission.
if (SubscriptionManager.isValidPhoneId(phoneId)) {
setTelephonyProperty(phoneId,
TelephonyProperties.PROPERTY_DATA_NETWORK_TYPE,
ServiceState.rilRadioTechnologyToString(type));
}
|
public void | setImsRegistrationState(boolean registered)Set IMS registration state
try {
getITelephony().setImsRegistrationState(registered);
} catch (RemoteException e) {
}
|
public boolean | setLine1NumberForDisplay(java.lang.String alphaTag, java.lang.String number)Set the line 1 phone number string and its alphatag for the current ICCID
for display purpose only, for example, displayed in Phone Status. It won't
change the actual MSISDN/MDN. To unset alphatag or number, pass in a null
value.
Requires that the calling app has carrier privileges.
return setLine1NumberForDisplayForSubscriber(getDefaultSubscription(), alphaTag, number);
|
public boolean | setLine1NumberForDisplayForSubscriber(int subId, java.lang.String alphaTag, java.lang.String number)Set the line 1 phone number string and its alphatag for the current ICCID
for display purpose only, for example, displayed in Phone Status. It won't
change the actual MSISDN/MDN. To unset alphatag or number, pass in a null
value.
Requires that the calling app has carrier privileges.
try {
return getITelephony().setLine1NumberForDisplayForSubscriber(subId, alphaTag, number);
} catch (RemoteException ex) {
} catch (NullPointerException ex) {
}
return false;
|
public void | setNetworkCountryIso(java.lang.String iso)Set the ISO country code equivalent of the current registered
operator's MCC (Mobile Country Code).
int phoneId = getDefaultPhone();
setNetworkCountryIsoForPhone(phoneId, iso);
|
public void | setNetworkCountryIsoForPhone(int phoneId, java.lang.String iso)Set the ISO country code equivalent of the current registered
operator's MCC (Mobile Country Code).
if (SubscriptionManager.isValidPhoneId(phoneId)) {
setTelephonyProperty(phoneId,
TelephonyProperties.PROPERTY_OPERATOR_ISO_COUNTRY, iso);
}
|
public void | setNetworkOperatorName(java.lang.String name)Set the alphabetic name of current registered operator.
int phoneId = getDefaultPhone();
setNetworkOperatorNameForPhone(phoneId, name);
|
public void | setNetworkOperatorNameForPhone(int phoneId, java.lang.String name)Set the alphabetic name of current registered operator.
if (SubscriptionManager.isValidPhoneId(phoneId)) {
setTelephonyProperty(phoneId, TelephonyProperties.PROPERTY_OPERATOR_ALPHA, name);
}
|
public void | setNetworkOperatorNumeric(java.lang.String numeric)Set the numeric name (MCC+MNC) of current registered operator.
int phoneId = getDefaultPhone();
setNetworkOperatorNumericForPhone(phoneId, numeric);
|
public void | setNetworkOperatorNumericForPhone(int phoneId, java.lang.String numeric)Set the numeric name (MCC+MNC) of current registered operator.
setTelephonyProperty(phoneId, TelephonyProperties.PROPERTY_OPERATOR_NUMERIC, numeric);
|
public void | setNetworkRoaming(boolean isRoaming)Set roaming state of the current network, for GSM purposes.
int phoneId = getDefaultPhone();
setNetworkRoamingForPhone(phoneId, isRoaming);
|
public void | setNetworkRoamingForPhone(int phoneId, boolean isRoaming)Set roaming state of the current network, for GSM purposes.
if (SubscriptionManager.isValidPhoneId(phoneId)) {
setTelephonyProperty(phoneId, TelephonyProperties.PROPERTY_OPERATOR_ISROAMING,
isRoaming ? "true" : "false");
}
|
public boolean | setOperatorBrandOverride(java.lang.String brand)Override the 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 that the calling app has carrier privileges.
try {
return getITelephony().setOperatorBrandOverride(brand);
} catch (RemoteException ex) {
Rlog.e(TAG, "setOperatorBrandOverride RemoteException", ex);
} catch (NullPointerException ex) {
Rlog.e(TAG, "setOperatorBrandOverride NPE", ex);
}
return false;
|
public void | setPhoneType(int type)Set phone type for the default phone.
int phoneId = getDefaultPhone();
setPhoneType(phoneId, type);
|
public void | setPhoneType(int phoneId, int type)Set phone type by phone id.
if (SubscriptionManager.isValidPhoneId(phoneId)) {
TelephonyManager.setTelephonyProperty(phoneId,
TelephonyProperties.CURRENT_ACTIVE_PHONE, String.valueOf(type));
}
|
public boolean | setPreferredNetworkType(int networkType)Set the preferred network type.
Used for device configuration by some CDMA operators.
Requires Permission:
{@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}
Or the calling app has carrier privileges. @see #hasCarrierPrivileges
try {
return getITelephony().setPreferredNetworkType(networkType);
} catch (RemoteException ex) {
Rlog.e(TAG, "setPreferredNetworkType RemoteException", ex);
} catch (NullPointerException ex) {
Rlog.e(TAG, "setPreferredNetworkType NPE", ex);
}
return false;
|
public boolean | setPreferredNetworkTypeToGlobal()Set the preferred network type to global mode which includes LTE, CDMA, EvDo and GSM/WCDMA.
Requires that the calling app has carrier privileges.
return setPreferredNetworkType(RILConstants.NETWORK_MODE_LTE_CDMA_EVDO_GSM_WCDMA);
|
public boolean | setRadio(boolean turnOn)
try {
return getITelephony().setRadio(turnOn);
} catch (RemoteException e) {
Log.e(TAG, "Error calling ITelephony#setRadio", e);
}
return false;
|
public boolean | setRadioPower(boolean turnOn)
try {
return getITelephony().setRadioPower(turnOn);
} catch (RemoteException e) {
Log.e(TAG, "Error calling ITelephony#setRadioPower", e);
}
return false;
|
public boolean | setRoamingOverride(java.util.List gsmRoamingList, java.util.List gsmNonRoamingList, java.util.List cdmaRoamingList, java.util.List cdmaNonRoamingList)Override the roaming preference 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.
try {
return getITelephony().setRoamingOverride(gsmRoamingList, gsmNonRoamingList,
cdmaRoamingList, cdmaNonRoamingList);
} catch (RemoteException ex) {
Rlog.e(TAG, "setRoamingOverride RemoteException", ex);
} catch (NullPointerException ex) {
Rlog.e(TAG, "setRoamingOverride NPE", ex);
}
return false;
|
public void | setSimCountryIso(java.lang.String iso)Set TelephonyProperties.PROPERTY_ICC_OPERATOR_ISO_COUNTRY for the default phone.
int phoneId = getDefaultPhone();
setSimCountryIsoForPhone(phoneId, iso);
|
public void | setSimCountryIsoForPhone(int phoneId, java.lang.String iso)Set TelephonyProperties.PROPERTY_ICC_OPERATOR_ISO_COUNTRY for the given phone.
setTelephonyProperty(phoneId,
TelephonyProperties.PROPERTY_ICC_OPERATOR_ISO_COUNTRY, iso);
|
public void | setSimOperatorName(java.lang.String name)Set TelephonyProperties.PROPERTY_ICC_OPERATOR_NUMERIC for the default phone.
int phoneId = getDefaultPhone();
setSimOperatorNameForPhone(phoneId, name);
|
public void | setSimOperatorNameForPhone(int phoneId, java.lang.String name)Set TelephonyProperties.PROPERTY_ICC_OPERATOR_NUMERIC for the given phone.
setTelephonyProperty(phoneId,
TelephonyProperties.PROPERTY_ICC_OPERATOR_ALPHA, name);
|
public void | setSimOperatorNumeric(java.lang.String numeric)Set TelephonyProperties.PROPERTY_ICC_OPERATOR_NUMERIC for the default phone.
int phoneId = getDefaultPhone();
setSimOperatorNumericForPhone(phoneId, numeric);
|
public void | setSimOperatorNumericForPhone(int phoneId, java.lang.String numeric)Set TelephonyProperties.PROPERTY_ICC_OPERATOR_NUMERIC for the given phone.
setTelephonyProperty(phoneId,
TelephonyProperties.PROPERTY_ICC_OPERATOR_NUMERIC, numeric);
|
public void | setSimState(java.lang.String state)Set TelephonyProperties.PROPERTY_SIM_STATE for the default phone.
int phoneId = getDefaultPhone();
setSimStateForPhone(phoneId, state);
|
public void | setSimStateForPhone(int phoneId, java.lang.String state)Set TelephonyProperties.PROPERTY_SIM_STATE for the given phone.
setTelephonyProperty(phoneId,
TelephonyProperties.PROPERTY_SIM_STATE, state);
|
public static void | setTelephonyProperty(int phoneId, java.lang.String property, java.lang.String value)Sets the telephony property with the value specified.
String propVal = "";
String p[] = null;
String prop = SystemProperties.get(property);
if (value == null) {
value = "";
}
if (prop != null) {
p = prop.split(",");
}
if (!SubscriptionManager.isValidPhoneId(phoneId)) {
Rlog.d(TAG, "setTelephonyProperty: invalid phoneId=" + phoneId +
" property=" + property + " value: " + value + " prop=" + prop);
return;
}
for (int i = 0; i < phoneId; i++) {
String str = "";
if ((p != null) && (i < p.length)) {
str = p[i];
}
propVal = propVal + str + ",";
}
propVal = propVal + value;
if (p != null) {
for (int i = phoneId + 1; i < p.length; i++) {
propVal = propVal + "," + p[i];
}
}
if (property.length() > SystemProperties.PROP_NAME_MAX
|| propVal.length() > SystemProperties.PROP_VALUE_MAX) {
Rlog.d(TAG, "setTelephonyProperty: property to long phoneId=" + phoneId +
" property=" + property + " value: " + value + " propVal=" + propVal);
return;
}
Rlog.d(TAG, "setTelephonyProperty: success phoneId=" + phoneId +
" property=" + property + " value: " + value + " propVal=" + propVal);
SystemProperties.set(property, propVal);
|
public boolean | setVoiceMailNumber(java.lang.String alphaTag, java.lang.String number)Sets the voice mail number.
Requires that the calling app has carrier privileges.
return setVoiceMailNumber(getDefaultSubscription(), alphaTag, number);
|
public boolean | setVoiceMailNumber(int subId, java.lang.String alphaTag, java.lang.String number){@hide}
try {
return getITelephony().setVoiceMailNumber(subId, alphaTag, number);
} catch (RemoteException ex) {
} catch (NullPointerException ex) {
}
return false;
|
public void | silenceRinger()
try {
getTelecomService().silenceRinger();
} catch (RemoteException e) {
Log.e(TAG, "Error calling ITelecomService#silenceRinger", e);
}
|
public boolean | supplyPin(java.lang.String pin)
try {
return getITelephony().supplyPin(pin);
} catch (RemoteException e) {
Log.e(TAG, "Error calling ITelephony#supplyPin", e);
}
return false;
|
public int[] | supplyPinReportResult(java.lang.String pin)
try {
return getITelephony().supplyPinReportResult(pin);
} catch (RemoteException e) {
Log.e(TAG, "Error calling ITelephony#supplyPinReportResult", e);
}
return new int[0];
|
public boolean | supplyPuk(java.lang.String puk, java.lang.String pin)
try {
return getITelephony().supplyPuk(puk, pin);
} catch (RemoteException e) {
Log.e(TAG, "Error calling ITelephony#supplyPuk", e);
}
return false;
|
public int[] | supplyPukReportResult(java.lang.String puk, java.lang.String pin)
try {
return getITelephony().supplyPukReportResult(puk, pin);
} catch (RemoteException e) {
Log.e(TAG, "Error calling ITelephony#]", e);
}
return new int[0];
|
public void | toggleRadioOnOff()
try {
getITelephony().toggleRadioOnOff();
} catch (RemoteException e) {
Log.e(TAG, "Error calling ITelephony#toggleRadioOnOff", e);
}
|
public void | updateServiceLocation()
try {
getITelephony().updateServiceLocation();
} catch (RemoteException e) {
Log.e(TAG, "Error calling ITelephony#updateServiceLocation", e);
}
|