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

Commit d87bd02d authored by Wileen Chiu's avatar Wileen Chiu Committed by Amit Mahajan
Browse files

Add p2 option in OpenLogicalChannel

- Adding support for P2 parameter
- Needed to support OMAPI 3.0 defined
  by SIM Alliance

Test: Basic telephony sanity
Bug: 27360148
Merged-In: I6a274195065ab1ef8406849228f60859ee826e53
Change-Id: I88134eded001e14c12e1f2a18efd0a2b51bc22fe
parent cb0b4665
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1285,10 +1285,11 @@ interface IRadio {
     *
     * @param serial Serial number of request.
     * @param aid AID value, See ETSI 102.221 and 101.220.
     * @param p2 P2 value, described in ISO 7816-4. Ignore if equal to P2Constant:NO_P2
     *
     * Response callback is IRadioResponse.iccOpenLogicalChannelResponse()
     */
    oneway iccOpenLogicalChannel(int32_t serial, string aid);
    oneway iccOpenLogicalChannel(int32_t serial, string aid, int32_t p2);

    /**
     * Close a previously opened logical channel. This command reflects TS 27.007
+4 −0
Original line number Diff line number Diff line
@@ -1161,6 +1161,10 @@ enum DeviceStateType : int32_t {
                                          // this doesn't mean no data is expected.
};

enum P2Constant : int32_t {
    NO_P2 = -1,                           // No P2 value is provided
};

struct RadioResponseInfo {
    RadioResponseType type;               // Response type
    int32_t serial;                       // Serial number of the request
+9 −6
Original line number Diff line number Diff line
@@ -246,9 +246,12 @@ TEST_F(RadioHidlTest, iccTransmitApduBasicChannel) {
 */
TEST_F(RadioHidlTest, iccOpenLogicalChannel) {
  int serial = 1;

  int p2 = 0x04;
  // Specified in ISO 7816-4 clause 7.1.1 0x04 means that FCP template is
  // requested.
  for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
    radio->iccOpenLogicalChannel(++serial, cardStatus.applications[i].aidPtr);
      radio->iccOpenLogicalChannel(++serial, cardStatus.applications[i].aidPtr,
                                   p2);
      EXPECT_EQ(std::cv_status::no_timeout, wait());
      EXPECT_EQ(serial, radioRsp->rspInfo.serial);
      EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);