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

Commit 35b9bdf0 authored by Preeti Ahuja's avatar Preeti Ahuja Committed by Gerrit - the friendly Code Review server
Browse files

SEEK: Add support for getAtr api

Implement getAtr for SEEK on Android.

CRs-Fixed: 718469
Change-Id: I22f8661bbe65e6d2449a7e2f56a0f9c42cf7d164
parent 30e06b2c
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -907,4 +907,21 @@ public abstract class BaseCommands implements CommandsInterface {
    @Override
    public void setLocalCallHold(boolean lchStatus) {
    }

    @Override
    public void iccOpenLogicalChannel(String AID, Message response) {}

    @Override
    public void iccCloseLogicalChannel(int channel, Message response) {}

    @Override
    public void iccTransmitApduLogicalChannel(int channel, int cla, int instruction,
                                              int p1, int p2, int p3, String data,
                                              Message response) {}
    @Override
    public void iccTransmitApduBasicChannel(int cla, int instruction, int p1, int p2,
                                            int p3, String data, Message response) {}

    @Override
    public void getAtr(Message response) {}
}
+3 −0
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ public class CommandException extends RuntimeException {
        ILLEGAL_SIM_OR_ME,
        MISSING_RESOURCE,
        NO_SUCH_ELEMENT,
        INVALID_PARAMETER,
        SUBSCRIPTION_NOT_SUPPORTED,
        DIAL_MODIFIED_TO_USSD,
        DIAL_MODIFIED_TO_SS,
@@ -104,6 +105,8 @@ public class CommandException extends RuntimeException {
                return new CommandException(Error.MISSING_RESOURCE);
            case RILConstants.NO_SUCH_ELEMENT:
                return new CommandException(Error.NO_SUCH_ELEMENT);
            case RILConstants.INVALID_PARAMETER:
                 return new CommandException(Error.INVALID_PARAMETER);
            case RILConstants.SUBSCRIPTION_NOT_SUPPORTED:
                return new CommandException(Error.SUBSCRIPTION_NOT_SUPPORTED);
            case RILConstants.DIAL_MODIFIED_TO_USSD:
+7 −0
Original line number Diff line number Diff line
@@ -1846,6 +1846,13 @@ public interface CommandsInterface {
    public void iccTransmitApduBasicChannel(int cla, int instruction, int p1, int p2,
            int p3, String data, Message response);

    /**
     * Get ATR (Answer To Reset; as per ISO/IEC 7816-4) from SIM card
     *
     * @param response Callback message
     */
    public void getAtr(Message response);

    /**
     * Read one of the NV items defined in {@link RadioNVItems} / {@code ril_nv_items.h}.
     * Used for device configuration by some CDMA operators.
+16 −0
Original line number Diff line number Diff line
@@ -2655,6 +2655,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
            case RIL_REQUEST_SIM_OPEN_CHANNEL: ret  = responseInts(p); break;
            case RIL_REQUEST_SIM_CLOSE_CHANNEL: ret  = responseVoid(p); break;
            case RIL_REQUEST_SIM_TRANSMIT_APDU_CHANNEL: ret = responseICC_IO(p); break;
            case RIL_REQUEST_SIM_GET_ATR: ret = responseString(p); break;
            case RIL_REQUEST_NV_READ_ITEM: ret = responseString(p); break;
            case RIL_REQUEST_NV_WRITE_ITEM: ret = responseVoid(p); break;
            case RIL_REQUEST_NV_WRITE_CDMA_PRL: ret = responseVoid(p); break;
@@ -4768,6 +4769,21 @@ public final class RIL extends BaseCommands implements CommandsInterface {
                p1, p2, p3, data, response);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void getAtr(Message response) {
        RILRequest rr = RILRequest.obtain(RIL_REQUEST_SIM_GET_ATR, response);
        int slotId = 0;
        rr.mParcel.writeInt(1);
        rr.mParcel.writeInt(slotId);
        if (RILJ_LOGD) riljLog(rr.serialString() + "> iccGetAtr: "
                + requestToString(rr.mRequest) + " " + slotId);

        send(rr);
    }

    /*
     * Helper function for the iccTransmitApdu* commands above.
     */
+0 −14
Original line number Diff line number Diff line
@@ -568,20 +568,6 @@ class ImsPhoneCommandInterface extends BaseCommands implements CommandsInterface
    public void setDataProfile(DataProfile[] dps, Message result) {
    }

    @Override
    public void iccOpenLogicalChannel(String AID, Message response) {}

    @Override
    public void iccCloseLogicalChannel(int channel, Message response) {}

    @Override
    public void iccTransmitApduLogicalChannel(int channel, int cla, int instruction,
                                              int p1, int p2, int p3, String data,
                                              Message response) {}
    @Override
    public void iccTransmitApduBasicChannel(int cla, int instruction, int p1, int p2,
                                            int p3, String data, Message response) {}

    @Override
    public void nvReadItem(int itemID, Message response) {}

Loading