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

Commit ebe860e5 authored by Ajay Nambi's avatar Ajay Nambi Committed by Amit Mahajan
Browse files

Add p2 option in openLogicalChannel.

- Add support for iccOpenLogicalChannelWithP2.
- Needed to support OMAPI 3.0 defined
by SIM Alliance.
- Deprecate iccOpenLogicalChannel(String) API and
pass down an invalid p2 value to keep original behavior

Test: Basic telephony sanity
Bug: 27360148
Change-Id: I2ab6cfb7a54c451f32936df51b8298f35a6dc67f
parent eca0d421
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -40109,7 +40109,8 @@ package android.telephony {
    method public boolean hasIccCard();
    method public boolean iccCloseLogicalChannel(int);
    method public byte[] iccExchangeSimIO(int, int, int, int, int, java.lang.String);
    method public android.telephony.IccOpenLogicalChannelResponse iccOpenLogicalChannel(java.lang.String);
    method public deprecated android.telephony.IccOpenLogicalChannelResponse iccOpenLogicalChannel(java.lang.String);
    method public android.telephony.IccOpenLogicalChannelResponse iccOpenLogicalChannel(java.lang.String, int);
    method public java.lang.String iccTransmitApduBasicChannel(int, int, int, int, int, java.lang.String);
    method public java.lang.String iccTransmitApduLogicalChannel(int, int, int, int, int, int, java.lang.String);
    method public boolean isConcurrentVoiceAndDataSupported();
+2 −1
Original line number Diff line number Diff line
@@ -43601,7 +43601,8 @@ package android.telephony {
    method public boolean hasIccCard();
    method public boolean iccCloseLogicalChannel(int);
    method public byte[] iccExchangeSimIO(int, int, int, int, int, java.lang.String);
    method public android.telephony.IccOpenLogicalChannelResponse iccOpenLogicalChannel(java.lang.String);
    method public deprecated android.telephony.IccOpenLogicalChannelResponse iccOpenLogicalChannel(java.lang.String);
    method public android.telephony.IccOpenLogicalChannelResponse iccOpenLogicalChannel(java.lang.String, int);
    method public java.lang.String iccTransmitApduBasicChannel(int, int, int, int, int, java.lang.String);
    method public java.lang.String iccTransmitApduLogicalChannel(int, int, int, int, int, int, java.lang.String);
    method public boolean isConcurrentVoiceAndDataSupported();
+2 −1
Original line number Diff line number Diff line
@@ -40308,7 +40308,8 @@ package android.telephony {
    method public boolean hasIccCard();
    method public boolean iccCloseLogicalChannel(int);
    method public byte[] iccExchangeSimIO(int, int, int, int, int, java.lang.String);
    method public android.telephony.IccOpenLogicalChannelResponse iccOpenLogicalChannel(java.lang.String);
    method public deprecated android.telephony.IccOpenLogicalChannelResponse iccOpenLogicalChannel(java.lang.String);
    method public android.telephony.IccOpenLogicalChannelResponse iccOpenLogicalChannel(java.lang.String, int);
    method public java.lang.String iccTransmitApduBasicChannel(int, int, int, int, int, java.lang.String);
    method public java.lang.String iccTransmitApduLogicalChannel(int, int, int, int, int, int, java.lang.String);
    method public boolean isConcurrentVoiceAndDataSupported();
+23 −3
Original line number Diff line number Diff line
@@ -3643,9 +3643,28 @@ public class TelephonyManager {
     *
     * @param AID Application id. See ETSI 102.221 and 101.220.
     * @return an IccOpenLogicalChannelResponse object.
     * @deprecated Replaced by {@link #iccOpenLogicalChannel(String, int)}
     */
    @Deprecated
    public IccOpenLogicalChannelResponse iccOpenLogicalChannel(String AID) {
        return iccOpenLogicalChannel(getSubId(), AID);
        return iccOpenLogicalChannel(getSubId(), AID, -1);
    }

    /**
     * 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#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}
     * Or the calling app has carrier privileges. @see #hasCarrierPrivileges
     *
     * @param AID Application id. See ETSI 102.221 and 101.220.
     * @param p2 P2 parameter (described in ISO 7816-4).
     * @return an IccOpenLogicalChannelResponse object.
     */
    public IccOpenLogicalChannelResponse iccOpenLogicalChannel(String AID, int p2) {
        return iccOpenLogicalChannel(getSubId(), AID, p2);
    }

    /**
@@ -3659,14 +3678,15 @@ public class TelephonyManager {
     *
     * @param subId The subscription to use.
     * @param AID Application id. See ETSI 102.221 and 101.220.
     * @param p2 P2 parameter (described in ISO 7816-4).
     * @return an IccOpenLogicalChannelResponse object.
     * @hide
     */
    public IccOpenLogicalChannelResponse iccOpenLogicalChannel(int subId, String AID) {
    public IccOpenLogicalChannelResponse iccOpenLogicalChannel(int subId, String AID, int p2) {
        try {
            ITelephony telephony = getITelephony();
            if (telephony != null)
                return telephony.iccOpenLogicalChannel(subId, AID);
                return telephony.iccOpenLogicalChannel(subId, AID, p2);
        } catch (RemoteException ex) {
        } catch (NullPointerException ex) {
        }
+2 −1
Original line number Diff line number Diff line
@@ -623,9 +623,10 @@ interface ITelephony {
     *
     * @param subId The subscription to use.
     * @param AID Application id. See ETSI 102.221 and 101.220.
     * @param p2 P2 parameter (described in ISO 7816-4).
     * @return an IccOpenLogicalChannelResponse object.
     */
    IccOpenLogicalChannelResponse iccOpenLogicalChannel(int subId, String AID);
    IccOpenLogicalChannelResponse iccOpenLogicalChannel(int subId, String AID, int p2);

    /**
     * Closes a previously opened logical channel to the ICC card.