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

Commit 8110b7e5 authored by Muralidhar Reddy's avatar Muralidhar Reddy
Browse files

Integrate new iccCloseLogicalChannelWithSessionInfo AIDL changes to framework.

Test: Manually verified profile download/enable on C10 and atest FrameworksTelephonyTests
Bug: 268496310
Change-Id: I21c74b58528d97fbebf9a227dda76da7d665eb2b
parent 8c33c391
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -2115,11 +2115,29 @@ public interface CommandsInterface {
     *
     * 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.
     *
     * Input parameters equivalent to TS 27.007 AT+CCHC command.
     *
     * Per spec SGP.22 V3.0, ES10 commands needs to be sent over command port of MEP-A. In order
     * to close proper logical channel, should pass information about whether the logical channel
     * was opened for sending ES10 commands or not.
     *
     * @param channel Channel id. Id of the channel to be closed.
     * @param isEs10  Whether the logical channel is opened to perform ES10 operations.
     * @param response Callback message.
     */
    public void iccCloseLogicalChannel(int channel, boolean isEs10, Message response);

    /**
     * Exchange APDUs with the SIM on a logical channel.
     *
+7 −3
Original line number Diff line number Diff line
@@ -4122,6 +4122,11 @@ 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);
        if (!simProxy.isEmpty()) {
            RILRequest rr = obtainRequest(RIL_REQUEST_SIM_CLOSE_CHANNEL, result,
@@ -4129,11 +4134,10 @@ public class RIL extends BaseCommands implements CommandsInterface {

            if (RILJ_LOGD) {
                riljLog(rr.serialString() + "> " + RILUtils.requestToString(rr.mRequest)
                        + " channel = " + channel);
                        + " channel = " + channel + " isEs10 = " + isEs10);
            }

            try {
                simProxy.iccCloseLogicalChannel(rr.mSerial, channel);
                simProxy.iccCloseLogicalChannel(rr.mSerial, channel, isEs10);
            } catch (RemoteException | RuntimeException e) {
                handleRadioProxyExceptionForRR(HAL_SERVICE_SIM, "iccCloseLogicalChannel", e);
            }
+15 −2
Original line number Diff line number Diff line
@@ -272,14 +272,27 @@ public class RadioSimProxy extends RadioServiceProxy {
    }

    /**
     * Call IRadioSim#iccCloseLogicalChannel
     * Call IRadioSim#iccCloseLogicalChannelWithSessionInfo
     * @param serial Serial number of request
     * @param channelId Channel ID of the channel to be closed
     * @param isEs10 Whether the logical channel is opened for performing ES10 operations.
     * @throws RemoteException
     */
    public void iccCloseLogicalChannel(int serial, int channelId) throws RemoteException {
    public void iccCloseLogicalChannel(int serial,
            int channelId, boolean isEs10) throws RemoteException {
        if (isEmpty()) return;
        if (isAidl()) {
            if (mHalVersion.greaterOrEqual(RIL.RADIO_HAL_VERSION_2_1)) {
                // TODO: [MEP-A1] Use iccCloseLogicalChannelWithSessionInfo API once vendor
                //  changes are completed.
                //android.hardware.radio.sim.SessionInfo info =
                //        new android.hardware.radio.sim.SessionInfo();
                //info.sessionId = channelId;
                //info.isEs10 = isEs10;
                //mSimProxy.iccCloseLogicalChannelWithSessionInfo(serial, info);
                mSimProxy.iccCloseLogicalChannel(serial, channelId);
                return;
            }
            mSimProxy.iccCloseLogicalChannel(serial, channelId);
        } else {
            mRadioProxy.iccCloseLogicalChannel(serial, channelId);
+3 −0
Original line number Diff line number Diff line
@@ -609,6 +609,9 @@ class ImsPhoneCommandInterface extends BaseCommands implements CommandsInterface
    @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,
+4 −1
Original line number Diff line number Diff line
@@ -43,7 +43,10 @@ class CloseLogicalChannelInvocation extends AsyncMessageInvocation<Integer, Bool
    @Override
    protected void sendRequestMessage(Integer channel, Message msg) {
        Rlog.v(LOG_TAG, "Channel: " + channel);
        mCi.iccCloseLogicalChannel(channel, msg);
        // TODO: Currently CloseLogicalChannelInvocation is used from ApduSender for closing the
        //  channel opened on ISD-R. Hence passing isEs10 as true by default.
        //  Should modify the logic in future if the ApduSender is used with non ISD-R AID.
        mCi.iccCloseLogicalChannel(channel, true /*isEs10*/, msg);
    }

    @Override
Loading