summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWileen Chiu2017-03-03 13:57:48 -0600
committerWileen Chiu2017-04-04 13:30:41 -0500
commitbeb64d6721de1469aefe314894b3cb525f14d2e9 (patch)
tree2ebbbd9474a0cc12dfcc0d9e9b63e7b4bdcf17de
parent24ff2036ce6195ee30fcd2bc2787cb1a4d1666bd (diff)
downloadplatform-hardware-interfaces-beb64d6721de1469aefe314894b3cb525f14d2e9.tar.gz
platform-hardware-interfaces-beb64d6721de1469aefe314894b3cb525f14d2e9.tar.xz
platform-hardware-interfaces-beb64d6721de1469aefe314894b3cb525f14d2e9.zip
Add p2 option in OpenLogicalChannel
- Adding support for P2 parameter - Needed to support OMAPI 3.0 defined by SIM Alliance Bug: 27360148 Change-Id: I88134eded001e14c12e1f2a18efd0a2b51bc22fe
-rw-r--r--radio/1.0/IRadio.hal3
-rw-r--r--radio/1.0/types.hal4
-rw-r--r--radio/1.0/vts/functional/radio_hidl_hal_icc.cpp7
3 files changed, 10 insertions, 4 deletions
diff --git a/radio/1.0/IRadio.hal b/radio/1.0/IRadio.hal
index 29762903..236dbf5b 100644
--- a/radio/1.0/IRadio.hal
+++ b/radio/1.0/IRadio.hal
@@ -1285,10 +1285,11 @@ interface IRadio {
1285 * 1285 *
1286 * @param serial Serial number of request. 1286 * @param serial Serial number of request.
1287 * @param aid AID value, See ETSI 102.221 and 101.220. 1287 * @param aid AID value, See ETSI 102.221 and 101.220.
1288 * @param p2 P2 value, described in ISO 7816-4. Ignore if equal to P2Constant:NO_P2
1288 * 1289 *
1289 * Response callback is IRadioResponse.iccOpenLogicalChannelResponse() 1290 * Response callback is IRadioResponse.iccOpenLogicalChannelResponse()
1290 */ 1291 */
1291 oneway iccOpenLogicalChannel(int32_t serial, string aid); 1292 oneway iccOpenLogicalChannel(int32_t serial, string aid, int32_t p2);
1292 1293
1293 /** 1294 /**
1294 * Close a previously opened logical channel. This command reflects TS 27.007 1295 * Close a previously opened logical channel. This command reflects TS 27.007
diff --git a/radio/1.0/types.hal b/radio/1.0/types.hal
index 2224c8b7..c5d7f8aa 100644
--- a/radio/1.0/types.hal
+++ b/radio/1.0/types.hal
@@ -1161,6 +1161,10 @@ enum DeviceStateType : int32_t {
1161 // this doesn't mean no data is expected. 1161 // this doesn't mean no data is expected.
1162}; 1162};
1163 1163
1164enum P2Constant : int32_t {
1165 NO_P2 = -1, // No P2 value is provided
1166};
1167
1164struct RadioResponseInfo { 1168struct RadioResponseInfo {
1165 RadioResponseType type; // Response type 1169 RadioResponseType type; // Response type
1166 int32_t serial; // Serial number of the request 1170 int32_t serial; // Serial number of the request
diff --git a/radio/1.0/vts/functional/radio_hidl_hal_icc.cpp b/radio/1.0/vts/functional/radio_hidl_hal_icc.cpp
index 19738d5e..107feb40 100644
--- a/radio/1.0/vts/functional/radio_hidl_hal_icc.cpp
+++ b/radio/1.0/vts/functional/radio_hidl_hal_icc.cpp
@@ -246,9 +246,10 @@ TEST_F(RadioHidlTest, iccTransmitApduBasicChannel) {
246 */ 246 */
247TEST_F(RadioHidlTest, iccOpenLogicalChannel) { 247TEST_F(RadioHidlTest, iccOpenLogicalChannel) {
248 int serial = 1; 248 int serial = 1;
249 249 int p2 = 0x04;
250 // Specified in ISO 7816-4 clause 7.1.1 0x04 means that FCP template is requested.
250 for (int i = 0; i < (int)cardStatus.applications.size(); i++) { 251 for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
251 radio->iccOpenLogicalChannel(++serial, cardStatus.applications[i].aidPtr); 252 radio->iccOpenLogicalChannel(++serial, cardStatus.applications[i].aidPtr, p2);
252 EXPECT_EQ(std::cv_status::no_timeout, wait()); 253 EXPECT_EQ(std::cv_status::no_timeout, wait());
253 EXPECT_EQ(serial, radioRsp->rspInfo.serial); 254 EXPECT_EQ(serial, radioRsp->rspInfo.serial);
254 EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type); 255 EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
@@ -317,4 +318,4 @@ TEST_F(RadioHidlTest, supplyNetworkDepersonalization) {
317 if (cardStatus.cardState == CardState::ABSENT) { 318 if (cardStatus.cardState == CardState::ABSENT) {
318 ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::PASSWORD_INCORRECT); 319 ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::PASSWORD_INCORRECT);
319 } 320 }
320} \ No newline at end of file 321}