summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLove Khanna <love.khanna@nxp.com>2017-04-14 19:15:17 +0530
committerRuchi Kandoi <kandoiruchi@google.com>2017-07-06 11:46:28 -0700
commit09922d2d1dcb21cf7b0bf830efe577381f855c4b (patch)
tree14647523eb2f9521e7fae0c92bb2a6bd5f4c13b0
parent2aff4f645910cdc16a91c4670ee26e4d00045470 (diff)
downloadandroid_packages_apps_Nfc-09922d2d1dcb21cf7b0bf830efe577381f855c4b.tar.gz
android_packages_apps_Nfc-09922d2d1dcb21cf7b0bf830efe577381f855c4b.tar.bz2
android_packages_apps_Nfc-09922d2d1dcb21cf7b0bf830efe577381f855c4b.zip
NCI 2.0: Removed RF_FIELD_INFO config param update during P2P.
As per NCI2.0 , it is not allowed to configure the RF_FIELD_INFO config parameter in RFST_POLL_ACTIVE or RFST_LISTEN_ACTIVE. Bug: 63146248 Test: Compiles. Change-Id: I8cf84e033c2c6401ac8ccbbb2ae30785f3687f3d (cherry picked from commit e40dad57051205491d69cb7101be6761cd96834c)
-rwxr-xr-xnci/jni/NativeNfcManager.cpp50
1 files changed, 28 insertions, 22 deletions
diff --git a/nci/jni/NativeNfcManager.cpp b/nci/jni/NativeNfcManager.cpp
index 8c73ffa3..282d4459 100755
--- a/nci/jni/NativeNfcManager.cpp
+++ b/nci/jni/NativeNfcManager.cpp
@@ -329,16 +329,19 @@ static void nfaConnectionCallback (uint8_t connEvent, tNFA_CONN_EVT_DATA* eventD
break;
}
sP2pActive = true;
- ALOGV("%s: NFA_ACTIVATED_EVT; is p2p", __func__);
- // Disable RF field events in case of p2p
- uint8_t nfa_disable_rf_events[] = { 0x00 };
- ALOGV("%s: Disabling RF field events", __func__);
- status = NFA_SetConfig(NCI_PARAM_ID_RF_FIELD_INFO, sizeof(nfa_disable_rf_events),
- &nfa_disable_rf_events[0]);
- if (status == NFA_STATUS_OK) {
- ALOGV("%s: Disabled RF field events", __func__);
- } else {
- ALOGE("%s: Failed to disable RF field events", __func__);
+ ALOGD("%s: NFA_ACTIVATED_EVT; is p2p", __func__);
+ if (NFC_GetNCIVersion() == NCI_VERSION_1_0)
+ {
+ // Disable RF field events in case of p2p
+ uint8_t nfa_disable_rf_events[] = { 0x00 };
+ ALOGD ("%s: Disabling RF field events", __func__);
+ status = NFA_SetConfig(NCI_PARAM_ID_RF_FIELD_INFO, sizeof(nfa_disable_rf_events),
+ &nfa_disable_rf_events[0]);
+ if (status == NFA_STATUS_OK) {
+ ALOGD ("%s: Disabled RF field events", __func__);
+ } else {
+ ALOGE ("%s: Failed to disable RF field events", __func__);
+ }
}
}
else if (pn544InteropIsBusy() == false)
@@ -391,19 +394,22 @@ static void nfaConnectionCallback (uint8_t connEvent, tNFA_CONN_EVT_DATA* eventD
} else if (sP2pActive) {
sP2pActive = false;
// Make sure RF field events are re-enabled
- ALOGV("%s: NFA_DEACTIVATED_EVT; is p2p", __func__);
- // Disable RF field events in case of p2p
- uint8_t nfa_enable_rf_events[] = { 0x01 };
-
- if (!sIsDisabling && sIsNfaEnabled)
+ ALOGD("%s: NFA_DEACTIVATED_EVT; is p2p", __func__);
+ if (NFC_GetNCIVersion() == NCI_VERSION_1_0)
{
- ALOGV("%s: Enabling RF field events", __func__);
- status = NFA_SetConfig(NCI_PARAM_ID_RF_FIELD_INFO, sizeof(nfa_enable_rf_events),
- &nfa_enable_rf_events[0]);
- if (status == NFA_STATUS_OK) {
- ALOGV("%s: Enabled RF field events", __func__);
- } else {
- ALOGE("%s: Failed to enable RF field events", __func__);
+ // Disable RF field events in case of p2p
+ uint8_t nfa_enable_rf_events[] = { 0x01 };
+
+ if (!sIsDisabling && sIsNfaEnabled)
+ {
+ ALOGD ("%s: Enabling RF field events", __func__);
+ status = NFA_SetConfig(NCI_PARAM_ID_RF_FIELD_INFO, sizeof(nfa_enable_rf_events),
+ &nfa_enable_rf_events[0]);
+ if (status == NFA_STATUS_OK) {
+ ALOGD ("%s: Enabled RF field events", __func__);
+ } else {
+ ALOGE ("%s: Failed to enable RF field events", __func__);
+ }
}
}
}