diff options
-rwxr-xr-x | nci/jni/NativeNfcManager.cpp | 2 | ||||
-rwxr-xr-x | nci/jni/SecureElement.cpp | 12 |
2 files changed, 13 insertions, 1 deletions
diff --git a/nci/jni/NativeNfcManager.cpp b/nci/jni/NativeNfcManager.cpp index f4d5573..99ffc77 100755 --- a/nci/jni/NativeNfcManager.cpp +++ b/nci/jni/NativeNfcManager.cpp @@ -87,6 +87,7 @@ namespace android const char* gNativeNfcSecureElementClassName = "com/android/nfc/dhimpl/NativeNfcSecureElement"; void doStartupConfig (); void startStopPolling (bool isStartPolling); + void startRfDiscovery (bool isStart); } @@ -132,7 +133,6 @@ static UINT32 sConfigUpdated = 0; static void nfaConnectionCallback (UINT8 event, tNFA_CONN_EVT_DATA *eventData); static void nfaDeviceManagementCallback (UINT8 event, tNFA_DM_CBACK_DATA *eventData); static bool isPeerToPeer (tNFA_ACTIVATED& activated); -static void startRfDiscovery (bool isStart); ///////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////// diff --git a/nci/jni/SecureElement.cpp b/nci/jni/SecureElement.cpp index 2f94047..5f370cc 100755 --- a/nci/jni/SecureElement.cpp +++ b/nci/jni/SecureElement.cpp @@ -37,6 +37,10 @@ int gSEId = -1; // secure element ID to use in connectEE(), -1 means not set int gGatePipe = -1; // gate id or static pipe id to use in connectEE(), -1 means not set bool gUseStaticPipe = false; // if true, use gGatePipe as static pipe id. if false, use as gate id +namespace android +{ + extern void startRfDiscovery (bool isStart); +} ////////////////////////////////////////////// ////////////////////////////////////////////// @@ -630,6 +634,9 @@ bool SecureElement::connectEE () return (false); } + // Disable RF discovery completely while the DH is connected + android::startRfDiscovery(false); + mNewSourceGate = 0; if (gGatePipe == -1) @@ -809,6 +816,11 @@ bool SecureElement::disconnectEE (jint seID) ALOGE ("%s: fail dealloc gate; error=0x%X", fn, nfaStat); } mIsPiping = false; + // Re-enable RF discovery + // Note that it only effactuates the current configuration, + // so if polling/listening were configured OFF (forex because + // the screen was off), they will stay OFF with this call. + android::startRfDiscovery(true); return true; } |