diff options
author | Evan Chu <evanchu@broadcom.com> | 2012-10-15 15:36:14 -0400 |
---|---|---|
committer | Martijn Coenen <maco@google.com> | 2012-10-16 10:32:20 -0700 |
commit | 547b58f41866671e0028ed6f395b34e271ce81b1 (patch) | |
tree | 1538023d39f5061c045080f63e470232629f66ad /nci | |
parent | a15b24e9e405b65b7523d8c80173b1c0d71e093e (diff) | |
download | packages_apps_nfc-547b58f41866671e0028ed6f395b34e271ce81b1.zip packages_apps_nfc-547b58f41866671e0028ed6f395b34e271ce81b1.tar.gz packages_apps_nfc-547b58f41866671e0028ed6f395b34e271ce81b1.tar.bz2 |
Fix tag not deactivating to sleep during reconnect.
During reconnect, the JNI deactivates the tag to sleep mode
and re-selects it. Sometimes when the tag leaves the RF field, it
deactivates to idle instead of sleep; causing subsequent select to fail.
Author: Mark Gorodetzky
Bug: 7357299
Change-Id: Id774d0bc3b8e2cbcea93cd2ee061ffecfa821a1e
Diffstat (limited to 'nci')
-rwxr-xr-x | nci/jni/NativeNfcManager.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/nci/jni/NativeNfcManager.cpp b/nci/jni/NativeNfcManager.cpp index 81bb6b2..a872791 100755 --- a/nci/jni/NativeNfcManager.cpp +++ b/nci/jni/NativeNfcManager.cpp @@ -339,16 +339,17 @@ static void nfaConnectionCallback (UINT8 connEvent, tNFA_CONN_EVT_DATA* eventDat case NFA_DEACTIVATED_EVT: // NFC link/protocol deactivated ALOGD("%s: NFA_DEACTIVATED_EVT Type: %u, gIsTagDeactivating: %d", __FUNCTION__, eventData->deactivated.type,gIsTagDeactivating); NfcTag::getInstance().setDeactivationState (eventData->deactivated); - if (gIsTagDeactivating || gIsSelectingRfInterface) + if (eventData->deactivated.type != NFA_DEACTIVATE_TYPE_SLEEP) { - if (gIsTagDeactivating) - nativeNfcTag_doDeactivateStatus(0); - break; + nativeNfcTag_resetPresenceCheck(); + NfcTag::getInstance().connectionEventHandler (connEvent, eventData); + nativeNfcTag_abortWaits(); + NfcTag::getInstance().abort (); + } + else if (gIsTagDeactivating) + { + nativeNfcTag_doDeactivateStatus(0); } - nativeNfcTag_resetPresenceCheck(); - NfcTag::getInstance().connectionEventHandler (connEvent, eventData); - nativeNfcTag_abortWaits(); - NfcTag::getInstance().abort (); // If RF is activated for what we think is a Secure Element transaction // and it is deactivated to either IDLE or DISCOVERY mode, notify w/event. |