Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 37384ded authored by Shishir Agrawal's avatar Shishir Agrawal
Browse files

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
parent 121114ab
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -24847,7 +24847,7 @@ package android.telephony {
    method public boolean isNetworkRoaming();
    method public boolean isNetworkRoaming();
    method public void listen(android.telephony.PhoneStateListener, int);
    method public void listen(android.telephony.PhoneStateListener, int);
    method public void newIncomingThirdPartyCall(android.content.ComponentName, java.lang.String, java.lang.String);
    method public void newIncomingThirdPartyCall(android.content.ComponentName, java.lang.String, java.lang.String);
    method public java.lang.String sendEnvelope(java.lang.String);
    method public java.lang.String sendEnvelopeWithStatus(java.lang.String);
    field public static final java.lang.String ACTION_PHONE_STATE_CHANGED = "android.intent.action.PHONE_STATE";
    field public static final java.lang.String ACTION_PHONE_STATE_CHANGED = "android.intent.action.PHONE_STATE";
    field public static final java.lang.String ACTION_RESPOND_VIA_MESSAGE = "android.intent.action.RESPOND_VIA_MESSAGE";
    field public static final java.lang.String ACTION_RESPOND_VIA_MESSAGE = "android.intent.action.RESPOND_VIA_MESSAGE";
    field public static final int CALL_STATE_IDLE = 0; // 0x0
    field public static final int CALL_STATE_IDLE = 0; // 0x0
+6 −5
Original line number Original line Diff line number Diff line
@@ -1806,8 +1806,7 @@ public class TelephonyManager {
    }
    }


    /**
    /**
     * Send ENVELOPE to the SIM, after processing a proactive command sent by
     * Send ENVELOPE to the SIM and return the response.
     * the SIM.
     *
     *
     * <p>Requires Permission:
     * <p>Requires Permission:
     *   {@link android.Manifest.permission#SIM_COMMUNICATION SIM_COMMUNICATION}
     *   {@link android.Manifest.permission#SIM_COMMUNICATION SIM_COMMUNICATION}
@@ -1815,11 +1814,13 @@ public class TelephonyManager {
     * @param content String containing SAT/USAT response in hexadecimal
     * @param content String containing SAT/USAT response in hexadecimal
     *                format starting with command tag. See TS 102 223 for
     *                format starting with command tag. See TS 102 223 for
     *                details.
     *                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 {
        try {
            return getITelephony().sendEnvelope(content);
            return getITelephony().sendEnvelopeWithStatus(content);
        } catch (RemoteException ex) {
        } catch (RemoteException ex) {
        } catch (NullPointerException ex) {
        } catch (NullPointerException ex) {
        }
        }
+5 −4
Original line number Original line Diff line number Diff line
@@ -369,15 +369,16 @@ interface ITelephony {
            int p1, int p2, int p3, String data);
            int p1, int p2, int p3, String data);


    /**
    /**
     * Send ENVELOPE to the SIM, after processing a proactive command sent by
     * Send ENVELOPE to the SIM and returns the response.
     * the SIM.
     *
     *
     * @param contents  String containing SAT/USAT response in hexadecimal
     * @param contents  String containing SAT/USAT response in hexadecimal
     *                  format starting with command tag. See TS 102 223 for
     *                  format starting with command tag. See TS 102 223 for
     *                  details.
     *                  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}.
     * Read one of the NV items defined in {@link RadioNVItems} / {@code ril_nv_items.h}.