Manage 61XX, 6CXX internally in HAL for chained response and allow 69XX, 62XX
and 63XX status word forwarding

Change-Id: Ibaa4ae71a089ac38bbc76869277e62af1093ac57
diff --git a/secure_element/1.0/GtoService.cpp b/secure_element/1.0/GtoService.cpp
index a003c92..3bd7ec4 100644
--- a/secure_element/1.0/GtoService.cpp
+++ b/secure_element/1.0/GtoService.cpp
@@ -26,7 +26,7 @@
 using android::status_t;
 
 int main() {
-  ALOGD("Thales Secure Element HAL for eSE1 Service 1.5.0 is starting. libse-gto v1.13");
+  ALOGD("Thales Secure Element HAL for eSE1 Service 1.6.0 is starting. libse-gto v1.13");
   sp<ISecureElement> se_service = new SecureElement("eSE1");
   configureRpcThreadpool(1, true);
   status_t status = se_service->registerAsService("eSE1");
diff --git a/secure_element/1.0/GtoService_ese2.cpp b/secure_element/1.0/GtoService_ese2.cpp
index 4ababbd..7773ff8 100644
--- a/secure_element/1.0/GtoService_ese2.cpp
+++ b/secure_element/1.0/GtoService_ese2.cpp
@@ -26,7 +26,7 @@
 using android::status_t;
 
 int main() {
-  ALOGD("Thales Secure Element HAL for eSE2 Service 1.5.0 is starting. libse-gto v1.13");
+  ALOGD("Thales Secure Element HAL for eSE2 Service 1.6.0 is starting. libse-gto v1.13");
   sp<ISecureElement> se_service = new SecureElement("eSE2");
   configureRpcThreadpool(1, true);
   status_t status = se_service->registerAsService("eSE2");
diff --git a/secure_element/1.0/SecureElement.cpp b/secure_element/1.0/SecureElement.cpp
index 0f02092..af63040 100644
--- a/secure_element/1.0/SecureElement.cpp
+++ b/secure_element/1.0/SecureElement.cpp
@@ -47,6 +47,7 @@
 #define LOG_HAL_LEVEL 4
 #endif
 
+uint8_t getResponse[5] = {0x00, 0xC0, 0x00, 0x00, 0x00};
 static struct se_gto_ctx *ctx;
 
 SecureElement::SecureElement(const char* ese_name){
@@ -220,6 +221,7 @@
     uint8_t *resp;
     int resp_len = 0;
     uint8_t index = 0;
+    int getResponseOffset = 0;
 
     apdu_len = 5;
     apdu = (uint8_t*)malloc(apdu_len * sizeof(uint8_t));
@@ -295,8 +297,9 @@
         apdu[index++] = p2;
         apdu[index++] = aid.size();
         memcpy(&apdu[index], aid.data(), aid.size());
-        dump_bytes("CMD: ", ':', apdu, apdu_len, stdout);
 
+send_logical:
+        dump_bytes("CMD: ", ':', apdu, apdu_len, stdout);
         resp_len = se_gto_apdu_transmit(ctx, apdu, apdu_len, resp, 65536);
         ALOGD("SecureElement:%s selectApdu resp_len = %d", __func__,resp_len);
     }
@@ -310,11 +313,35 @@
     } else {
         dump_bytes("RESP: ", ':', resp, resp_len, stdout);
 
-        if (resp[resp_len - 2] == 0x90 && resp[resp_len - 1] == 0x00) {
-            resApduBuff.selectResponse.resize(resp_len);
-            memcpy(&resApduBuff.selectResponse[0], resp, resp_len);
+        if (resp[resp_len - 2] == 0x90 || resp[resp_len - 2] == 0x62 || resp[resp_len - 2] == 0x63) {
+            resApduBuff.selectResponse.resize(getResponseOffset + resp_len);
+            memcpy(&resApduBuff.selectResponse[getResponseOffset], resp, resp_len);
             mSecureElementStatus = SecureElementStatus::SUCCESS;
         }
+        else if (resp[resp_len - 2] == 0x61) {
+            resApduBuff.selectResponse.resize(getResponseOffset + resp_len - 2);
+            memcpy(&resApduBuff.selectResponse[getResponseOffset], resp, resp_len - 2);
+            getResponseOffset += (resp_len - 2);
+            getResponse[4] = resp[resp_len - 1];
+            getResponse[0] = apdu[0];
+            dump_bytes("getResponse CMD: ", ':', getResponse, 5, stdout);
+            free(apdu);
+            apdu_len = 5;
+            apdu = (uint8_t*)malloc(apdu_len * sizeof(uint8_t));
+            memset(resp, 0, resp_len);
+            memcpy(apdu, getResponse, apdu_len);
+            apdu[0] = resApduBuff.channelNumber;
+            goto send_logical;
+        }
+        else if (resp[resp_len - 2] == 0x6C) {
+            resApduBuff.selectResponse.resize(getResponseOffset + resp_len - 2);
+            memcpy(&resApduBuff.selectResponse[getResponseOffset], resp, resp_len - 2);
+            getResponseOffset += (resp_len - 2);
+            apdu[4] = resp[resp_len - 1];
+            dump_bytes("case2 getResponse CMD: ", ':', apdu, 5, stdout);
+            memset(resp, 0, resp_len);
+            goto send_logical;
+        }
         else if (resp[resp_len - 2] == 0x6A && resp[resp_len - 1] == 0x80) {
             mSecureElementStatus = SecureElementStatus::IOERROR;
         }
@@ -355,6 +382,8 @@
     int apdu_len = 0;
     uint8_t *resp;
     int resp_len = 0;
+    int getResponseOffset = 0;
+    uint8_t index = 0;
 
     if (!checkSeUp) {
         if (initializeSE() != EXIT_SUCCESS) {
@@ -373,7 +402,7 @@
 
 
     if (apdu != NULL) {
-        uint8_t index = 0;
+        index = 0;
         apdu[index++] = 0x00;
         apdu[index++] = 0xA4;
         apdu[index++] = 0x04;
@@ -381,7 +410,7 @@
         apdu[index++] = aid.size();
         memcpy(&apdu[index], aid.data(), aid.size());
         dump_bytes("CMD: ", ':', apdu, apdu_len, stdout);
-
+send_basic:
         resp_len = se_gto_apdu_transmit(ctx, apdu, apdu_len, resp, 65536);
         ALOGD("SecureElement:%s selectApdu resp_len = %d", __func__,resp_len);
     }
@@ -394,14 +423,38 @@
     } else {
         dump_bytes("RESP: ", ':', resp, resp_len, stdout);
 
-        if ((resp[resp_len - 2] == 0x90) && (resp[resp_len - 1] == 0x00)) {
-            result.resize(resp_len);
-            memcpy(&result[0], resp, resp_len);
+        if (resp[resp_len - 2] == 0x90 || resp[resp_len - 2] == 0x62 || resp[resp_len - 2] == 0x63) {
+            result.resize(getResponseOffset + resp_len);
+            memcpy(&result[getResponseOffset], resp, resp_len);
 
             isBasicChannelOpen = true;
             nbrOpenChannel++;
             mSecureElementStatus = SecureElementStatus::SUCCESS;
         }
+        else if (resp[resp_len - 2] == 0x61) {
+            result.resize(getResponseOffset + resp_len - 2);
+            memcpy(&result[getResponseOffset], resp, resp_len - 2);
+            getResponseOffset += (resp_len - 2);
+            getResponse[4] = resp[resp_len - 1];
+            getResponse[0] = apdu[0];
+            dump_bytes("getResponse CMD: ", ':', getResponse, 5, stdout);
+            free(apdu);
+            apdu_len = 5;
+            apdu = (uint8_t*)malloc(apdu_len * sizeof(uint8_t));
+            memset(resp, 0, resp_len);
+            memcpy(apdu, getResponse, apdu_len);
+            goto send_basic;
+        }
+        else if (resp[resp_len - 2] == 0x6C) {
+            result.resize(getResponseOffset + resp_len - 2);
+            memcpy(&result[getResponseOffset], resp, resp_len - 2);
+            getResponseOffset += (resp_len - 2);
+            apdu[4] = resp[resp_len - 1];
+            dump_bytes("case2 getResponse CMD: ", ':', apdu, 5, stdout);
+            apdu_len = 5;
+            memset(resp, 0, resp_len);
+            goto send_basic;
+        }
         else if (resp[resp_len - 2] == 0x68 && resp[resp_len - 1] == 0x81) {
             mSecureElementStatus = SecureElementStatus::CHANNEL_NOT_AVAILABLE;
         }
diff --git a/secure_element/1.1/GtoService.cpp b/secure_element/1.1/GtoService.cpp
index 5aeca90..be9b7aa 100644
--- a/secure_element/1.1/GtoService.cpp
+++ b/secure_element/1.1/GtoService.cpp
@@ -27,7 +27,7 @@
 
 int main() {
   ALOGD("android::hardware::secure_element::V1_1 is starting.");
-  ALOGD("Thales Secure Element HAL for eSE2 Service 1.5.0 is starting. libse-gto v1.13");
+  ALOGD("Thales Secure Element HAL for eSE2 Service 1.6.0 is starting. libse-gto v1.13");
   sp<ISecureElement> se_service = new SecureElement("eSE1");
   configureRpcThreadpool(1, true);
   status_t status = se_service->registerAsService("eSE1");
diff --git a/secure_element/1.1/GtoService_ese2.cpp b/secure_element/1.1/GtoService_ese2.cpp
index 2ff983e..e29d71a 100644
--- a/secure_element/1.1/GtoService_ese2.cpp
+++ b/secure_element/1.1/GtoService_ese2.cpp
@@ -27,7 +27,7 @@
 
 int main() {
   ALOGD("android::hardware::secure_element::V1_1 is starting.");
-  ALOGD("Thales Secure Element HAL for eSE2 Service 1.5.0 is starting. libse-gto v1.13");
+  ALOGD("Thales Secure Element HAL for eSE2 Service 1.6.0 is starting. libse-gto v1.13");
   sp<ISecureElement> se_service = new SecureElement("eSE2");
   configureRpcThreadpool(1, true);
   status_t status = se_service->registerAsService("eSE2");
diff --git a/secure_element/1.1/SecureElement.cpp b/secure_element/1.1/SecureElement.cpp
index 8e5bceb..ca1c5e8 100644
--- a/secure_element/1.1/SecureElement.cpp
+++ b/secure_element/1.1/SecureElement.cpp
@@ -47,6 +47,7 @@
 #define LOG_HAL_LEVEL 4
 #endif
 
+uint8_t getResponse[5] = {0x00, 0xC0, 0x00, 0x00, 0x00};
 static struct se_gto_ctx *ctx;
 
 SecureElement::SecureElement(const char* ese_name){
@@ -253,6 +254,7 @@
     uint8_t *resp;
     int resp_len = 0;
     uint8_t index = 0;
+    int getResponseOffset = 0;
 
     apdu_len = 5;
     apdu = (uint8_t*)malloc(apdu_len * sizeof(uint8_t));
@@ -328,8 +330,9 @@
         apdu[index++] = p2;
         apdu[index++] = aid.size();
         memcpy(&apdu[index], aid.data(), aid.size());
-        dump_bytes("CMD: ", ':', apdu, apdu_len, stdout);
 
+send_logical:
+        dump_bytes("CMD: ", ':', apdu, apdu_len, stdout);
         resp_len = se_gto_apdu_transmit(ctx, apdu, apdu_len, resp, 65536);
         ALOGD("SecureElement:%s selectApdu resp_len = %d", __func__,resp_len);
     }
@@ -343,11 +346,35 @@
     } else {
         dump_bytes("RESP: ", ':', resp, resp_len, stdout);
 
-        if (resp[resp_len - 2] == 0x90 && resp[resp_len - 1] == 0x00) {
-            resApduBuff.selectResponse.resize(resp_len);
-            memcpy(&resApduBuff.selectResponse[0], resp, resp_len);
+        if (resp[resp_len - 2] == 0x90 || resp[resp_len - 2] == 0x62 || resp[resp_len - 2] == 0x63) {
+            resApduBuff.selectResponse.resize(getResponseOffset + resp_len);
+            memcpy(&resApduBuff.selectResponse[getResponseOffset], resp, resp_len);
             mSecureElementStatus = SecureElementStatus::SUCCESS;
         }
+        else if (resp[resp_len - 2] == 0x61) {
+            resApduBuff.selectResponse.resize(getResponseOffset + resp_len - 2);
+            memcpy(&resApduBuff.selectResponse[getResponseOffset], resp, resp_len - 2);
+            getResponseOffset += (resp_len - 2);
+            getResponse[4] = resp[resp_len - 1];
+            getResponse[0] = apdu[0];
+            dump_bytes("getResponse CMD: ", ':', getResponse, 5, stdout);
+            free(apdu);
+            apdu_len = 5;
+            apdu = (uint8_t*)malloc(apdu_len * sizeof(uint8_t));
+            memset(resp, 0, resp_len);
+            memcpy(apdu, getResponse, apdu_len);
+            apdu[0] = resApduBuff.channelNumber;
+            goto send_logical;
+        }
+        else if (resp[resp_len - 2] == 0x6C) {
+            resApduBuff.selectResponse.resize(getResponseOffset + resp_len - 2);
+            memcpy(&resApduBuff.selectResponse[getResponseOffset], resp, resp_len - 2);
+            getResponseOffset += (resp_len - 2);
+            apdu[4] = resp[resp_len - 1];
+            dump_bytes("case2 getResponse CMD: ", ':', apdu, 5, stdout);
+            memset(resp, 0, resp_len);
+            goto send_logical;
+        }
         else if (resp[resp_len - 2] == 0x6A && resp[resp_len - 1] == 0x80) {
             mSecureElementStatus = SecureElementStatus::IOERROR;
         }
@@ -388,6 +415,8 @@
     int apdu_len = 0;
     uint8_t *resp;
     int resp_len = 0;
+    int getResponseOffset = 0;
+    uint8_t index = 0;
 
     if (!checkSeUp) {
         if (initializeSE() != EXIT_SUCCESS) {
@@ -411,7 +440,7 @@
 
 
     if (apdu != NULL) {
-        uint8_t index = 0;
+        index = 0;
         apdu[index++] = 0x00;
         apdu[index++] = 0xA4;
         apdu[index++] = 0x04;
@@ -419,7 +448,7 @@
         apdu[index++] = aid.size();
         memcpy(&apdu[index], aid.data(), aid.size());
         dump_bytes("CMD: ", ':', apdu, apdu_len, stdout);
-
+send_basic:
         resp_len = se_gto_apdu_transmit(ctx, apdu, apdu_len, resp, 65536);
         ALOGD("SecureElement:%s selectApdu resp_len = %d", __func__,resp_len);
     }
@@ -432,14 +461,38 @@
     } else {
         dump_bytes("RESP: ", ':', resp, resp_len, stdout);
 
-        if ((resp[resp_len - 2] == 0x90) && (resp[resp_len - 1] == 0x00)) {
-            result.resize(resp_len);
-            memcpy(&result[0], resp, resp_len);
+        if (resp[resp_len - 2] == 0x90 || resp[resp_len - 2] == 0x62 || resp[resp_len - 2] == 0x63) {
+            result.resize(getResponseOffset + resp_len);
+            memcpy(&result[getResponseOffset], resp, resp_len);
 
             isBasicChannelOpen = true;
             nbrOpenChannel++;
             mSecureElementStatus = SecureElementStatus::SUCCESS;
         }
+        else if (resp[resp_len - 2] == 0x61) {
+            result.resize(getResponseOffset + resp_len - 2);
+            memcpy(&result[getResponseOffset], resp, resp_len - 2);
+            getResponseOffset += (resp_len - 2);
+            getResponse[4] = resp[resp_len - 1];
+            getResponse[0] = apdu[0];
+            dump_bytes("getResponse CMD: ", ':', getResponse, 5, stdout);
+            free(apdu);
+            apdu_len = 5;
+            apdu = (uint8_t*)malloc(apdu_len * sizeof(uint8_t));
+            memset(resp, 0, resp_len);
+            memcpy(apdu, getResponse, apdu_len);
+            goto send_basic;
+        }
+        else if (resp[resp_len - 2] == 0x6C) {
+            result.resize(getResponseOffset + resp_len - 2);
+            memcpy(&result[getResponseOffset], resp, resp_len - 2);
+            getResponseOffset += (resp_len - 2);
+            apdu[4] = resp[resp_len - 1];
+            dump_bytes("case2 getResponse CMD: ", ':', apdu, 5, stdout);
+            apdu_len = 5;
+            memset(resp, 0, resp_len);
+            goto send_basic;
+        }
         else if (resp[resp_len - 2] == 0x68 && resp[resp_len - 1] == 0x81) {
             mSecureElementStatus = SecureElementStatus::CHANNEL_NOT_AVAILABLE;
         }
diff --git a/secure_element/1.2/GtoService.cpp b/secure_element/1.2/GtoService.cpp
index 34a0624..009b8c5 100644
--- a/secure_element/1.2/GtoService.cpp
+++ b/secure_element/1.2/GtoService.cpp
@@ -29,7 +29,7 @@
 
 int main() {
   ALOGD("android::hardware::secure_element::V1_2 is starting.");
-  ALOGD("Thales Secure Element HAL for eSE1 Service 1.5.0 is starting. libse-gto v1.13");
+  ALOGD("Thales Secure Element HAL for eSE1 Service 1.6.0 is starting. libse-gto v1.13");
   // Ignore this dlopen if libstpreprocess21.so doesn't exist.
   void* stdll = dlopen("/vendor/lib64/libstpreprocess21.so", RTLD_NOW);
   if (stdll) {
diff --git a/secure_element/1.2/GtoService_ese2.cpp b/secure_element/1.2/GtoService_ese2.cpp
index 1a8eb84..d6e3f75 100644
--- a/secure_element/1.2/GtoService_ese2.cpp
+++ b/secure_element/1.2/GtoService_ese2.cpp
@@ -27,7 +27,7 @@
 
 int main() {
   ALOGD("android::hardware::secure_element::V1_2 is starting.");
-  ALOGD("Thales Secure Element HAL for eSE2 Service 1.5.0 is starting. libse-gto v1.13");
+  ALOGD("Thales Secure Element HAL for eSE2 Service 1.6.0 is starting. libse-gto v1.13");
   sp<ISecureElement> se_service = new SecureElement("eSE2");
   configureRpcThreadpool(1, true);
   status_t status = se_service->registerAsService("eSE2");
diff --git a/secure_element/1.2/SecureElement.cpp b/secure_element/1.2/SecureElement.cpp
index 8cda099..dd2cb10 100644
--- a/secure_element/1.2/SecureElement.cpp
+++ b/secure_element/1.2/SecureElement.cpp
@@ -51,6 +51,7 @@
 #define LOG_HAL_LEVEL 4
 #endif
 
+uint8_t getResponse[5] = {0x00, 0xC0, 0x00, 0x00, 0x00};
 static struct se_gto_ctx *ctx;
 
 SecureElement::SecureElement(const char* ese_name){
@@ -258,6 +259,7 @@
     uint8_t *resp;
     int resp_len = 0;
     uint8_t index = 0;
+    int getResponseOffset = 0;
 
     apdu_len = 5;
     apdu = (uint8_t*)malloc(apdu_len * sizeof(uint8_t));
@@ -333,8 +335,9 @@
         apdu[index++] = p2;
         apdu[index++] = aid.size();
         memcpy(&apdu[index], aid.data(), aid.size());
-        dump_bytes("CMD: ", ':', apdu, apdu_len, stdout);
 
+send_logical:
+        dump_bytes("CMD: ", ':', apdu, apdu_len, stdout);
         resp_len = se_gto_apdu_transmit(ctx, apdu, apdu_len, resp, 65536);
         ALOGD("SecureElement:%s selectApdu resp_len = %d", __func__,resp_len);
     }
@@ -348,11 +351,35 @@
     } else {
         dump_bytes("RESP: ", ':', resp, resp_len, stdout);
 
-        if (resp[resp_len - 2] == 0x90 && resp[resp_len - 1] == 0x00) {
-            resApduBuff.selectResponse.resize(resp_len);
-            memcpy(&resApduBuff.selectResponse[0], resp, resp_len);
+        if (resp[resp_len - 2] == 0x90 || resp[resp_len - 2] == 0x62 || resp[resp_len - 2] == 0x63) {
+            resApduBuff.selectResponse.resize(getResponseOffset + resp_len);
+            memcpy(&resApduBuff.selectResponse[getResponseOffset], resp, resp_len);
             mSecureElementStatus = SecureElementStatus::SUCCESS;
         }
+        else if (resp[resp_len - 2] == 0x61) {
+            resApduBuff.selectResponse.resize(getResponseOffset + resp_len - 2);
+            memcpy(&resApduBuff.selectResponse[getResponseOffset], resp, resp_len - 2);
+            getResponseOffset += (resp_len - 2);
+            getResponse[4] = resp[resp_len - 1];
+            getResponse[0] = apdu[0];
+            dump_bytes("getResponse CMD: ", ':', getResponse, 5, stdout);
+            free(apdu);
+            apdu_len = 5;
+            apdu = (uint8_t*)malloc(apdu_len * sizeof(uint8_t));
+            memset(resp, 0, resp_len);
+            memcpy(apdu, getResponse, apdu_len);
+            apdu[0] = resApduBuff.channelNumber;
+            goto send_logical;
+        }
+        else if (resp[resp_len - 2] == 0x6C) {
+            resApduBuff.selectResponse.resize(getResponseOffset + resp_len - 2);
+            memcpy(&resApduBuff.selectResponse[getResponseOffset], resp, resp_len - 2);
+            getResponseOffset += (resp_len - 2);
+            apdu[4] = resp[resp_len - 1];
+            dump_bytes("case2 getResponse CMD: ", ':', apdu, 5, stdout);
+            memset(resp, 0, resp_len);
+            goto send_logical;
+        }
         else if (resp[resp_len - 2] == 0x6A && resp[resp_len - 1] == 0x80) {
             mSecureElementStatus = SecureElementStatus::IOERROR;
         }
@@ -393,6 +420,8 @@
     int apdu_len = 0;
     uint8_t *resp;
     int resp_len = 0;
+    int getResponseOffset = 0;
+    uint8_t index = 0;
 
     if (!checkSeUp) {
         if (initializeSE() != EXIT_SUCCESS) {
@@ -416,7 +445,7 @@
 
 
     if (apdu != NULL) {
-        uint8_t index = 0;
+        index = 0;
         apdu[index++] = 0x00;
         apdu[index++] = 0xA4;
         apdu[index++] = 0x04;
@@ -424,7 +453,7 @@
         apdu[index++] = aid.size();
         memcpy(&apdu[index], aid.data(), aid.size());
         dump_bytes("CMD: ", ':', apdu, apdu_len, stdout);
-
+send_basic:
         resp_len = se_gto_apdu_transmit(ctx, apdu, apdu_len, resp, 65536);
         ALOGD("SecureElement:%s selectApdu resp_len = %d", __func__,resp_len);
     }
@@ -437,14 +466,38 @@
     } else {
         dump_bytes("RESP: ", ':', resp, resp_len, stdout);
 
-        if ((resp[resp_len - 2] == 0x90) && (resp[resp_len - 1] == 0x00)) {
-            result.resize(resp_len);
-            memcpy(&result[0], resp, resp_len);
+        if (resp[resp_len - 2] == 0x90 || resp[resp_len - 2] == 0x62 || resp[resp_len - 2] == 0x63) {
+            result.resize(getResponseOffset + resp_len);
+            memcpy(&result[getResponseOffset], resp, resp_len);
 
             isBasicChannelOpen = true;
             nbrOpenChannel++;
             mSecureElementStatus = SecureElementStatus::SUCCESS;
         }
+        else if (resp[resp_len - 2] == 0x61) {
+            result.resize(getResponseOffset + resp_len - 2);
+            memcpy(&result[getResponseOffset], resp, resp_len - 2);
+            getResponseOffset += (resp_len - 2);
+            getResponse[4] = resp[resp_len - 1];
+            getResponse[0] = apdu[0];
+            dump_bytes("getResponse CMD: ", ':', getResponse, 5, stdout);
+            free(apdu);
+            apdu_len = 5;
+            apdu = (uint8_t*)malloc(apdu_len * sizeof(uint8_t));
+            memset(resp, 0, resp_len);
+            memcpy(apdu, getResponse, apdu_len);
+            goto send_basic;
+        }
+        else if (resp[resp_len - 2] == 0x6C) {
+            result.resize(getResponseOffset + resp_len - 2);
+            memcpy(&result[getResponseOffset], resp, resp_len - 2);
+            getResponseOffset += (resp_len - 2);
+            apdu[4] = resp[resp_len - 1];
+            dump_bytes("case2 getResponse CMD: ", ':', apdu, 5, stdout);
+            apdu_len = 5;
+            memset(resp, 0, resp_len);
+            goto send_basic;
+        }
         else if (resp[resp_len - 2] == 0x68 && resp[resp_len - 1] == 0x81) {
             mSecureElementStatus = SecureElementStatus::CHANNEL_NOT_AVAILABLE;
         }