diff options
author | Love Khanna <love.khanna@nxp.com> | 2017-10-06 14:23:57 +0530 |
---|---|---|
committer | nxpandroid <srikrishna.pramoda@nxp.com> | 2017-10-16 15:15:04 +0530 |
commit | 9294ce089fff8d0f595d9c3a06ec2a5a6d474825 (patch) | |
tree | f96adcee9265ded42a308544c0886cb2d8ea2983 | |
parent | 41d9de578ba8cc3cb11f93d29b7b83d8c7f1f52f (diff) | |
download | android_vendor_nxp_opensource_packages_apps_Nfc-9294ce089fff8d0f595d9c3a06ec2a5a6d474825.tar.gz android_vendor_nxp_opensource_packages_apps_Nfc-9294ce089fff8d0f595d9c3a06ec2a5a6d474825.tar.bz2 android_vendor_nxp_opensource_packages_apps_Nfc-9294ce089fff8d0f595d9c3a06ec2a5a6d474825.zip |
eSE contactless interface is mute In case eSE CE RF params are dirty, initiate full eSE init sequence.
-rw-r--r-- | nci/jni/HciRFParams.cpp | 15 | ||||
-rwxr-xr-x | nci/jni/NativeNfcManager.cpp | 15 |
2 files changed, 30 insertions, 0 deletions
diff --git a/nci/jni/HciRFParams.cpp b/nci/jni/HciRFParams.cpp index 391a1b91..38a9d8f9 100644 --- a/nci/jni/HciRFParams.cpp +++ b/nci/jni/HciRFParams.cpp @@ -16,12 +16,18 @@ #include "HciRFParams.h" +#include "SecureElement.h" #define VAL_START_IDX 4 #define MAX_AID_SIZE 10 #define MAX_APP_DATA_SIZE 15 #define MAX_HIGHER_LAYER_RSP_SIZE 15 +#if(NXP_EXTNS == true) +#define ESE_HANDLE 0x4C0 +bool IsEseCeDisabled; +#endif + HciRFParams HciRFParams::sHciRFParams; /******************************************************************************* @@ -118,6 +124,15 @@ bool HciRFParams::initialize () ALOGV("%s: tlv_size %d", __func__,get_config->tlv_size); ALOGV("%s: param_tlvs %x", __func__,get_config->param_tlvs[0]); +#if(NXP_EXTNS == true) + if((get_config->param_tlvs[1] == 0xA0 && get_config->param_tlvs[2] == 0xF0) && + (get_config->param_tlvs[5] == 0xFF || get_config->param_tlvs[43] == 0xFF) && + SecureElement::getInstance().getEeStatus(ESE_HANDLE) == NFA_EE_STATUS_ACTIVE) { + ALOGV("%s: CE with ESE is disabled", __func__); + IsEseCeDisabled = true; + } +#endif + uint8_t *params = get_config->param_tlvs; params+=VAL_START_IDX; diff --git a/nci/jni/NativeNfcManager.cpp b/nci/jni/NativeNfcManager.cpp index b58d8356..17048fd3 100755 --- a/nci/jni/NativeNfcManager.cpp +++ b/nci/jni/NativeNfcManager.cpp @@ -107,6 +107,7 @@ extern bool recovery; extern uint8_t swp_getconfig_status; extern int gUICCVirtualWiredProtectMask; extern int gEseVirtualWiredProtectMask; +extern bool IsEseCeDisabled; static int32_t gNfcInitTimeout; int32_t gdisc_timeout; int32_t gSeDiscoverycount = 0; @@ -2148,6 +2149,7 @@ static jboolean nfcManager_doInitialize (JNIEnv* e, jobject o) tNFA_PMID ven_config_addr[] = {0xA0, 0x07}; bool isSuccess = false; sNfcee_disc_state = UICC_SESSION_NOT_INTIALIZED; + IsEseCeDisabled = false; /* NFC initialization in progress */ if(NFC_OFF == sNfcState) @@ -2295,6 +2297,19 @@ static jboolean nfcManager_doInitialize (JNIEnv* e, jobject o) ///////////////////////////////////////////////////////////////////////////////// // Add extra configuration here (work-arounds, etc.) #if (NXP_EXTNS == TRUE) + if(IsEseCeDisabled) + { + ALOGV("CE with ESE is disable, Hence reset the session"); + stat = android::ResetEseSession(); + if(stat == NFA_STATUS_OK) + { + SecureElement::getInstance().SecEle_Modeset(0x00); + usleep(50*1000); + SecureElement::getInstance().SecEle_Modeset(0x01); + } + IsEseCeDisabled = false; + } + if(nfcFL.nfcNxpEse) { if(nfcFL.eseFL._ESE_SVDD_SYNC || nfcFL.eseFL._ESE_JCOP_DWNLD_PROTECTION || nfcFL.nfccFL._NFCC_SPI_FW_DOWNLOAD_SYNC || |