From 37384dedab38239433a41641fe87fc3e51bb6976 Mon Sep 17 00:00:00 2001 From: Shishir Agrawal Date: Fri, 14 Mar 2014 09:32:22 -0700 Subject: Modify TelephonyManager to expose sendEnvelopeWithStatus instead of sendEnvelope. The RIL sendEnvelope command does not return the response from the SIM while the sendEnvelopeWithStatus does. Since the response is required for certain envelope commands, its better to expose sendEnvelopeWithStatus. Change-Id: I209bfc59e396bb6f91345d6f99c51cfa35f2d650 --- telephony/java/android/telephony/TelephonyManager.java | 11 ++++++----- telephony/java/com/android/internal/telephony/ITelephony.aidl | 9 +++++---- 2 files changed, 11 insertions(+), 9 deletions(-) (limited to 'telephony') diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index f621fa4..413f9e50 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -1806,8 +1806,7 @@ public class TelephonyManager { } /** - * Send ENVELOPE to the SIM, after processing a proactive command sent by - * the SIM. + * Send ENVELOPE to the SIM and return the response. * *

Requires Permission: * {@link android.Manifest.permission#SIM_COMMUNICATION SIM_COMMUNICATION} @@ -1815,11 +1814,13 @@ public class TelephonyManager { * @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. + * @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 sendEnvelope(String content) { + public String sendEnvelopeWithStatus(String content) { try { - return getITelephony().sendEnvelope(content); + return getITelephony().sendEnvelopeWithStatus(content); } catch (RemoteException ex) { } catch (NullPointerException ex) { } diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl index 4c0f259..e2abb9a 100644 --- a/telephony/java/com/android/internal/telephony/ITelephony.aidl +++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl @@ -369,15 +369,16 @@ interface ITelephony { int p1, int p2, int p3, String data); /** - * Send ENVELOPE to the SIM, after processing a proactive command sent by - * the SIM. + * 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. + * @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 sendEnvelope(String content); + String sendEnvelopeWithStatus(String content); /** * Read one of the NV items defined in {@link RadioNVItems} / {@code ril_nv_items.h}. -- cgit v1.1