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

Commit 50cf7900 authored by Muralidhar Reddy's avatar Muralidhar Reddy Committed by Muralidhar Reddy Mule
Browse files

Remove overloaded iccCloseLogicalChannel and iccTransmitApduLogicalChannel from CommandInterface

Keep only one API along with extra isEs10 parameter.

Test: Manually verified on C10, atest FrameworksTelephonyTests and atest CtsStatsdAtomHostTestCases:TelephonyStatsTests
Bug: 268496310
Change-Id: I6235d9a370eb8063c886b351d0f40a8d0b4f00ff
Merged-In: I6235d9a370eb8063c886b351d0f40a8d0b4f00ff
(cherry picked from commit a5a7816d)
parent a250dd14
Loading
Loading
Loading
Loading
+0 −33
Original line number Diff line number Diff line
@@ -2110,19 +2110,6 @@ public interface CommandsInterface {
     */
    public void iccOpenLogicalChannel(String AID, int p2, Message response);

    /**
     * Close a previously opened logical channel to the SIM.
     *
     * Input parameters equivalent to TS 27.007 AT+CCHC command.
     *
     * Starting with Android U, use {@link #iccCloseLogicalChannel(int, boolean, Message)}}
     * API to close the logical channel if the channel was opened to perform ES10 operations.
     *
     * @param channel Channel id. Id of the channel to be closed.
     * @param response Callback message.
     */
    public void iccCloseLogicalChannel(int channel, Message response);

    /**
     * Close a previously opened logical channel to the SIM.
     *
@@ -2138,26 +2125,6 @@ public interface CommandsInterface {
     */
    public void iccCloseLogicalChannel(int channel, boolean isEs10, Message response);

    /**
     * Exchange APDUs with the SIM on a logical channel.
     *
     * Input parameters equivalent to TS 27.007 AT+CGLA command.
     *
     * @param channel Channel id of the channel to use for communication. Has to
     *            be greater than zero.
     * @param cla Class of the APDU command.
     * @param instruction Instruction of the APDU command.
     * @param p1 P1 value of the APDU command.
     * @param p2 P2 value of the APDU command.
     * @param p3 P3 value of the APDU command. If p3 is negative a 4 byte APDU
     *            is sent to the SIM.
     * @param data Data to be sent with the APDU.
     * @param response Callback message. response.obj.userObj will be
     *            an IccIoResult on success.
     */
    public void iccTransmitApduLogicalChannel(int channel, int cla, int instruction,
            int p1, int p2, int p3, String data, Message response);

    /**
     * Exchange APDUs with the SIM on a logical channel.
     *
+0 −11
Original line number Diff line number Diff line
@@ -4120,11 +4120,6 @@ public class RIL extends BaseCommands implements CommandsInterface {
        }
    }

    @Override
    public void iccCloseLogicalChannel(int channel, Message result) {
        iccCloseLogicalChannel(channel, false, result);
    }

    @Override
    public void iccCloseLogicalChannel(int channel, boolean isEs10, Message result) {
        RadioSimProxy simProxy = getRadioServiceProxy(RadioSimProxy.class, result);
@@ -4144,12 +4139,6 @@ public class RIL extends BaseCommands implements CommandsInterface {
        }
    }

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

    @Override
    public void iccTransmitApduLogicalChannel(int channel, int cla, int instruction, int p1, int p2,
            int p3, String data, boolean isEs10Command, Message result) {
+0 −8
Original line number Diff line number Diff line
@@ -606,17 +606,9 @@ class ImsPhoneCommandInterface extends BaseCommands implements CommandsInterface
    @Override
    public void iccOpenLogicalChannel(String AID, int p2, Message response) {}

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

    @Override
    public void iccCloseLogicalChannel(int channel, boolean isEs10, 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 iccTransmitApduLogicalChannel(int channel, int cla, int instruction,
                                              int p1, int p2, int p3, String data,
+4 −4
Original line number Diff line number Diff line
@@ -426,8 +426,8 @@ public class UiccCarrierPrivilegeRules extends Handler {
                if (ar.exception == null && ar.result != null) {
                    mChannelId = ((int[]) ar.result)[0];
                    mUiccProfile.iccTransmitApduLogicalChannel(mChannelId, CLA, COMMAND, P1, P2, P3,
                            DATA, obtainMessage(EVENT_TRANSMIT_LOGICAL_CHANNEL_DONE, mChannelId,
                                    mAIDInUse));
                            DATA, false /*isEs10Command*/, obtainMessage(
                                    EVENT_TRANSMIT_LOGICAL_CHANNEL_DONE, mChannelId, mAIDInUse));
                } else {
                    if (shouldRetry(ar, mRetryCount)) {
                        log("should retry");
@@ -483,7 +483,7 @@ public class UiccCarrierPrivilegeRules extends Handler {
                                }
                            } else {
                                mUiccProfile.iccTransmitApduLogicalChannel(mChannelId, CLA, COMMAND,
                                        P1, P2_EXTENDED_DATA, P3, DATA,
                                        P1, P2_EXTENDED_DATA, P3, DATA, false /*isEs10Command*/,
                                        obtainMessage(EVENT_TRANSMIT_LOGICAL_CHANNEL_DONE,
                                                mChannelId, mAIDInUse));
                                break;
@@ -518,7 +518,7 @@ public class UiccCarrierPrivilegeRules extends Handler {
                    }
                }

                mUiccProfile.iccCloseLogicalChannel(mChannelId, obtainMessage(
                mUiccProfile.iccCloseLogicalChannel(mChannelId, false /*isEs10*/, obtainMessage(
                        EVENT_CLOSE_LOGICAL_CHANNEL_DONE, 0, mAIDInUse));
                mChannelId = -1;
                break;
+4 −4
Original line number Diff line number Diff line
@@ -81,7 +81,7 @@ public class UiccPkcs15 extends Handler {
        private void selectFile() {
            if (mChannelId >= 0) {
                mUiccProfile.iccTransmitApduLogicalChannel(mChannelId, 0x00, 0xA4, 0x00, 0x04, 0x02,
                        mFileId, obtainMessage(EVENT_SELECT_FILE_DONE));
                        mFileId, false /*isEs10Command*/, obtainMessage(EVENT_SELECT_FILE_DONE));
            } else {
                log("EF based");
            }
@@ -90,7 +90,7 @@ public class UiccPkcs15 extends Handler {
        private void readBinary() {
            if (mChannelId >=0 ) {
                mUiccProfile.iccTransmitApduLogicalChannel(mChannelId, 0x00, 0xB0, 0x00, 0x00, 0x00,
                        "", obtainMessage(EVENT_READ_BINARY_DONE));
                        "",  false /*isEs10Command*/, obtainMessage(EVENT_READ_BINARY_DONE));
            } else {
                log("EF based");
            }
@@ -281,8 +281,8 @@ public class UiccPkcs15 extends Handler {
    private void cleanUp() {
        log("cleanUp");
        if (mChannelId >= 0) {
            mUiccProfile.iccCloseLogicalChannel(mChannelId, obtainMessage(
                    EVENT_CLOSE_LOGICAL_CHANNEL_DONE));
            mUiccProfile.iccCloseLogicalChannel(mChannelId, false /*isEs10*/,
                    obtainMessage(EVENT_CLOSE_LOGICAL_CHANNEL_DONE));
            mChannelId = -1;
        }
        mLoadedCallback.sendToTarget();
Loading