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

Commit b2aa3b74 authored by Wileen Chiu's avatar Wileen Chiu Committed by Ricardo Cerqueira
Browse files

Add P2 option in openLogicalChannel.

- Add support for iccOpenLogicalChannelWithP2.
- Needed to support OMAPI 3.0 defined
by SIM Alliance.

Change-Id: I2ab6cfb7a54c451f32936df51b8298f35a6dc67f
CRs-Fixed: 948787
parent c7ea2123
Loading
Loading
Loading
Loading
+44 −0
Original line number Diff line number Diff line
@@ -3068,6 +3068,50 @@ public class TelephonyManager {
        return null;
    }

    /**
     * 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.
     * @param p2  byte P2 parameter
     * @return an IccOpenLogicalChannelResponse object
     * @hide
     */
    public IccOpenLogicalChannelResponse iccOpenLogicalChannel(String AID, byte p2) {
        try {
            ITelephony telephony = getITelephony();
            if (telephony != null) {
               return telephony.iccOpenLogicalChannelWithP2(AID, p2);
            }
        } catch (RemoteException ex) {
        } catch (NullPointerException ex) {
        }
        return null;
    }

    /**
     * Opens a logical channel to the ICC card for the given subId
     *
     * @param subId subid to send the command to
     * @param AID applcation id. See ETSI 102.221 and 101.220.
     * @param p2 byte P2 parameter
     * @return an IccOpenLogicalChannelResponse object
     * @hide
     */
    public IccOpenLogicalChannelResponse iccOpenLogicalChannel(int subId,
                String AID, byte p2) {
        try {
            ITelephony telephony = getITelephony();
            if (telephony != null) {
                return telephony.iccOpenLogicalChannelUsingSubIdWithP2(subId, AID, p2);
            }
        } catch (RemoteException ex) {
        } catch (NullPointerException ex) {
        }
        return null;
    }

    /**
     * Closes a previously opened logical channel to the ICC card.
     *
+20 −0
Original line number Diff line number Diff line
@@ -570,6 +570,16 @@ interface ITelephony {
     */
    IccOpenLogicalChannelResponse iccOpenLogicalChannel(String AID);

    /**
     * Opens a logical channel to the ICC card.
     *
     * Input parameters equivalent to TS 27.007 AT+CCHO command.
     *
     * @param p2 P2 parameter
     * @param AID Application id.
     * @return an IccOpenLogicalChannelResponse object.
     */
    IccOpenLogicalChannelResponse iccOpenLogicalChannelWithP2(String AID, byte p2);

    /**
     * Opens a logical channel to the ICC card for a particular subId.
@@ -582,6 +592,16 @@ interface ITelephony {
     */
    IccOpenLogicalChannelResponse iccOpenLogicalChannelUsingSubId(int subId, String AID);

    /**
     * Opens a logical channel to the ICC card for a particular subID
     *
     * @param subId user preferred subId.
     * @param p2 P2 parameter
     * @param AID Application id. See ETSI 102.221 and 101.220
     */
    IccOpenLogicalChannelResponse iccOpenLogicalChannelUsingSubIdWithP2(int subId,
        String AID, byte p2);

    /**
     * Closes a previously opened logical channel to the ICC card.
     *
+1 −0
Original line number Diff line number Diff line
@@ -335,6 +335,7 @@ cat include/telephony/ril.h | \
    int RIL_REQUEST_PULL_LCEDATA = 134;
    int RIL_REQUEST_GET_ACTIVITY_INFO = 135;
    int RIL_REQUEST_SIM_GET_ATR = 136;
    int RIL_REQUEST_CAF_SIM_OPEN_CHANNEL_WITH_P2 = 137;
    int RIL_REQUEST_SET_MAX_TRANSMIT_POWER = 139;

    int RIL_UNSOL_RESPONSE_BASE = 1000;