Revert sendEnvelope changes [DO NOT MERGE]
Revert the following changes from the I/O preview. This reverts the
following changes:
Revert "Revert "Revert "Modify TelephonyManager to expose sendEnvelopeWithStatus instead of sendEnvelope."""
This reverts commit 452e185fb6df92358701fb68d4fe6c65f172cc29.
Change-Id: I6bbff508b2f542d6ef3d372956db53d63a9165eb
Revert "Revert "Revert "Expose sendEnvelope."""
This reverts commit 0d5e5b9cce8af40494f72ff9decc169f99780254.
Revert "Adding support for SIM communication from Android over logical channels."
This reverts commit 57f656b9f6.
Change-Id: I975eb468841e85d63e506f68a5d8c879e110d9f6
This commit is contained in:
@@ -1742,216 +1742,6 @@ public class TelephonyManager {
|
||||
com.android.internal.R.string.config_mms_user_agent_profile_url);
|
||||
}
|
||||
|
||||
/**
|
||||
* Opens a logical channel to the ICC card.
|
||||
*
|
||||
* Input parameters equivalent to TS 27.007 AT+CCHO command.
|
||||
*
|
||||
* <p>Requires Permission:
|
||||
* {@link android.Manifest.permission#SIM_COMMUNICATION SIM_COMMUNICATION}
|
||||
*
|
||||
* @param AID Application id. See ETSI 102.221 and 101.220.
|
||||
* @return The logical channel id which is negative on error.
|
||||
*/
|
||||
public int iccOpenLogicalChannel(String AID) {
|
||||
try {
|
||||
return getITelephony().iccOpenLogicalChannel(AID);
|
||||
} catch (RemoteException ex) {
|
||||
} catch (NullPointerException ex) {
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Closes a previously opened logical channel to the ICC card.
|
||||
*
|
||||
* Input parameters equivalent to TS 27.007 AT+CCHC command.
|
||||
*
|
||||
* <p>Requires Permission:
|
||||
* {@link android.Manifest.permission#SIM_COMMUNICATION SIM_COMMUNICATION}
|
||||
*
|
||||
* @param channel is the channel id to be closed as retruned by a successful
|
||||
* iccOpenLogicalChannel.
|
||||
* @return true if the channel was closed successfully.
|
||||
*/
|
||||
public boolean iccCloseLogicalChannel(int channel) {
|
||||
try {
|
||||
return getITelephony().iccCloseLogicalChannel(channel);
|
||||
} catch (RemoteException ex) {
|
||||
} catch (NullPointerException ex) {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Transmit an APDU to the ICC card over a logical channel.
|
||||
*
|
||||
* Input parameters equivalent to TS 27.007 AT+CGLA command.
|
||||
*
|
||||
* <p>Requires Permission:
|
||||
* {@link android.Manifest.permission#SIM_COMMUNICATION SIM_COMMUNICATION}
|
||||
*
|
||||
* @param channel is the channel id to be closed as returned by a successful
|
||||
* iccOpenLogicalChannel.
|
||||
* @param cla Class of the APDU command.
|
||||
* @param instruction Instruction of the APDU command.
|
||||
* @param p1 P1 value of the APDU command.
|
||||
* @param p2 P2 value of the APDU command.
|
||||
* @param p3 P3 value of the APDU command. If p3 is negative a 4 byte APDU
|
||||
* is sent to the SIM.
|
||||
* @param data Data to be sent with the APDU.
|
||||
* @return The APDU response from the ICC card with the status appended at
|
||||
* the end. If an error occurs, an empty string is returned.
|
||||
*/
|
||||
public String iccTransmitApduLogicalChannel(int channel, int cla,
|
||||
int instruction, int p1, int p2, int p3, String data) {
|
||||
try {
|
||||
return getITelephony().iccTransmitApduLogicalChannel(channel, cla,
|
||||
instruction, p1, p2, p3, data);
|
||||
} catch (RemoteException ex) {
|
||||
} catch (NullPointerException ex) {
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
* Send ENVELOPE to the SIM and return the response.
|
||||
*
|
||||
* <p>Requires Permission:
|
||||
* {@link android.Manifest.permission#SIM_COMMUNICATION SIM_COMMUNICATION}
|
||||
*
|
||||
* @param content String containing SAT/USAT response in hexadecimal
|
||||
* format starting with command tag. See TS 102 223 for
|
||||
* details.
|
||||
* @return The APDU response from the ICC card, with the last 4 bytes
|
||||
* being the status word. If the command fails, returns an empty
|
||||
* string.
|
||||
*/
|
||||
public String sendEnvelopeWithStatus(String content) {
|
||||
try {
|
||||
return getITelephony().sendEnvelopeWithStatus(content);
|
||||
} catch (RemoteException ex) {
|
||||
} catch (NullPointerException ex) {
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
* Read one of the NV items defined in {@link com.android.internal.telephony.RadioNVItems}.
|
||||
* Used for device configuration by some CDMA operators.
|
||||
*
|
||||
* @param itemID the ID of the item to read.
|
||||
* @return the NV item as a String, or null on any failure.
|
||||
* @hide
|
||||
*/
|
||||
public String nvReadItem(int itemID) {
|
||||
try {
|
||||
return getITelephony().nvReadItem(itemID);
|
||||
} catch (RemoteException ex) {
|
||||
Rlog.e(TAG, "nvReadItem RemoteException", ex);
|
||||
} catch (NullPointerException ex) {
|
||||
Rlog.e(TAG, "nvReadItem NPE", ex);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Write one of the NV items defined in {@link com.android.internal.telephony.RadioNVItems}.
|
||||
* Used for device configuration by some CDMA operators.
|
||||
*
|
||||
* @param itemID the ID of the item to read.
|
||||
* @param itemValue the value to write, as a String.
|
||||
* @return true on success; false on any failure.
|
||||
* @hide
|
||||
*/
|
||||
public boolean nvWriteItem(int itemID, String itemValue) {
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the CDMA Preferred Roaming List (PRL) in the radio NV storage.
|
||||
* Used for device configuration by some CDMA operators.
|
||||
*
|
||||
* @param preferredRoamingList byte array containing the new PRL.
|
||||
* @return true on success; false on any failure.
|
||||
* @hide
|
||||
*/
|
||||
public boolean nvWriteCdmaPrl(byte[] preferredRoamingList) {
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @param resetType reset type: 1: reload NV reset, 2: erase NV reset, 3: factory NV reset
|
||||
* @return true on success; false on any failure.
|
||||
* @hide
|
||||
*/
|
||||
public boolean nvResetConfig(int resetType) {
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the preferred network type.
|
||||
* Used for device configuration by some CDMA operators.
|
||||
*
|
||||
* @return the preferred network type, defined in RILConstants.java.
|
||||
* @hide
|
||||
*/
|
||||
public int getPreferredNetworkType() {
|
||||
try {
|
||||
return getITelephony().getPreferredNetworkType();
|
||||
} catch (RemoteException ex) {
|
||||
Rlog.e(TAG, "getPreferredNetworkType RemoteException", ex);
|
||||
} catch (NullPointerException ex) {
|
||||
Rlog.e(TAG, "getPreferredNetworkType NPE", ex);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the preferred network type.
|
||||
* Used for device configuration by some CDMA operators.
|
||||
*
|
||||
* @param networkType the preferred network type, defined in RILConstants.java.
|
||||
* @return true on success; false on any failure.
|
||||
* @hide
|
||||
*/
|
||||
public boolean setPreferredNetworkType(int networkType) {
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Expose the rest of ITelephony to @PrivateApi
|
||||
*/
|
||||
|
||||
@@ -329,114 +329,6 @@ interface ITelephony {
|
||||
*/
|
||||
void setCellInfoListRate(int rateInMillis);
|
||||
|
||||
/**
|
||||
* Opens a logical channel to the ICC card.
|
||||
*
|
||||
* Input parameters equivalent to TS 27.007 AT+CCHO command.
|
||||
*
|
||||
* @param AID Application id. See ETSI 102.221 and 101.220.
|
||||
* @return The logical channel id which is set to -1 on error.
|
||||
*/
|
||||
int iccOpenLogicalChannel(String AID);
|
||||
|
||||
/**
|
||||
* Closes a previously opened logical channel to the ICC card.
|
||||
*
|
||||
* Input parameters equivalent to TS 27.007 AT+CCHC command.
|
||||
*
|
||||
* @param channel is the channel id to be closed as retruned by a
|
||||
* successful iccOpenLogicalChannel.
|
||||
* @return true if the channel was closed successfully.
|
||||
*/
|
||||
boolean iccCloseLogicalChannel(int channel);
|
||||
|
||||
/**
|
||||
* Transmit an APDU to the ICC card over a logical channel.
|
||||
*
|
||||
* Input parameters equivalent to TS 27.007 AT+CGLA command.
|
||||
*
|
||||
* @param channel is the channel id to be closed as retruned by a
|
||||
* successful iccOpenLogicalChannel.
|
||||
* @param cla Class of the APDU command.
|
||||
* @param instruction Instruction of the APDU command.
|
||||
* @param p1 P1 value of the APDU command.
|
||||
* @param p2 P2 value of the APDU command.
|
||||
* @param p3 P3 value of the APDU command. If p3 is negative a 4 byte APDU
|
||||
* is sent to the SIM.
|
||||
* @param data Data to be sent with the APDU.
|
||||
* @return The APDU response from the ICC card with the status appended at
|
||||
* the end. If an error occurs, an empty string is returned.
|
||||
*/
|
||||
String iccTransmitApduLogicalChannel(int channel, int cla, int instruction,
|
||||
int p1, int p2, int p3, String data);
|
||||
|
||||
/**
|
||||
* Send ENVELOPE to the SIM and returns the response.
|
||||
*
|
||||
* @param contents String containing SAT/USAT response in hexadecimal
|
||||
* format starting with command tag. See TS 102 223 for
|
||||
* details.
|
||||
* @return The APDU response from the ICC card, with the last 4 bytes
|
||||
* being the status word. If the command fails, returns an empty
|
||||
* string.
|
||||
*/
|
||||
String sendEnvelopeWithStatus(String content);
|
||||
|
||||
/**
|
||||
* Read one of the NV items defined in {@link RadioNVItems} / {@code ril_nv_items.h}.
|
||||
* Used for device configuration by some CDMA operators.
|
||||
*
|
||||
* @param itemID the ID of the item to read.
|
||||
* @return the NV item as a String, or null on any failure.
|
||||
*/
|
||||
String nvReadItem(int itemID);
|
||||
|
||||
/**
|
||||
* Write one of the NV items defined in {@link RadioNVItems} / {@code ril_nv_items.h}.
|
||||
* Used for device configuration by some CDMA operators.
|
||||
*
|
||||
* @param itemID the ID of the item to read.
|
||||
* @param itemValue the value to write, as a String.
|
||||
* @return true on success; false on any failure.
|
||||
*/
|
||||
boolean nvWriteItem(int itemID, String itemValue);
|
||||
|
||||
/**
|
||||
* Update the CDMA Preferred Roaming List (PRL) in the radio NV storage.
|
||||
* Used for device configuration by some CDMA operators.
|
||||
*
|
||||
* @param preferredRoamingList byte array containing the new PRL.
|
||||
* @return true on success; false on any failure.
|
||||
*/
|
||||
boolean nvWriteCdmaPrl(in byte[] preferredRoamingList);
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @param resetType the type of reset to perform (1 == factory reset; 2 == NV-only reset).
|
||||
* @return true on success; false on any failure.
|
||||
*/
|
||||
boolean nvResetConfig(int resetType);
|
||||
|
||||
/*
|
||||
* Get the preferred network type.
|
||||
* Used for device configuration by some CDMA operators.
|
||||
*
|
||||
* @return the preferred network type, defined in RILConstants.java.
|
||||
*/
|
||||
int getPreferredNetworkType();
|
||||
|
||||
/**
|
||||
* Set the preferred network type.
|
||||
* Used for device configuration by some CDMA operators.
|
||||
*
|
||||
* @param networkType the preferred network type, defined in RILConstants.java.
|
||||
* @return true on success; false on any failure.
|
||||
*/
|
||||
boolean setPreferredNetworkType(int networkType);
|
||||
|
||||
/**
|
||||
* User enable/disable Mobile Data.
|
||||
*
|
||||
@@ -451,3 +343,4 @@ interface ITelephony {
|
||||
*/
|
||||
boolean getDataEnabled();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user