Use sendEnvelopeWithStatus API
Expose sendEnvelopeWithStatus through PhoneInterfaceManager
Change-Id: I9f40c602cb2f3f446a0792f8dbd9258cfcafd02a
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index 61b26f8..b931644 100644
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -1296,6 +1296,22 @@
return s;
}
+ @Override
+ public String sendEnvelopeWithStatus(String content) {
+ enforceSimCommunicationPermission();
+
+ IccIoResult response = (IccIoResult)sendRequest(CMD_SEND_ENVELOPE, content);
+ if (response.payload == null) {
+ return "";
+ }
+
+ // Append the returned status code to the end of the response payload.
+ String s = Integer.toHexString(
+ (response.sw1 << 8) + response.sw2 + 0x10000).substring(1);
+ s = IccUtils.bytesToHexString(response.payload) + s;
+ return s;
+ }
+
/**
* Read one of the NV items defined in {@link com.android.internal.telephony.RadioNVItems}
* and {@code ril_nv_items.h}. Used for device configuration by some CDMA operators.