summaryrefslogtreecommitdiffstats
path: root/nci
diff options
context:
space:
mode:
authorMartijn Coenen <maco@google.com>2012-09-26 13:09:20 -0700
committerMartijn Coenen <maco@google.com>2012-09-26 13:13:01 -0700
commit914d6caa70f544fb3dd0710de59dff090c695caa (patch)
treec91e13cc60bc7399d83656b5c8b1a9376e9b4393 /nci
parent18ccd96ac38d28864230f4f1d264fd1a4cc16d8a (diff)
downloadpackages_apps_nfc-914d6caa70f544fb3dd0710de59dff090c695caa.zip
packages_apps_nfc-914d6caa70f544fb3dd0710de59dff090c695caa.tar.gz
packages_apps_nfc-914d6caa70f544fb3dd0710de59dff090c695caa.tar.bz2
Disable all RF activity when DH connects to SE.
If we leave RF polling/listen enabled while talking to the SE from the DH, there is corruption on frames sent out over SWP. To resolve this, disable discovery (both poll and listen) when the SE is route to the DH. This also makes the behavior identical to that of the PN65N devices, which don't allow any RF activity when the SE is routed to the host. Bug: 7004303 Change-Id: I05ad55a6f75b9f346feaf20dccefc23919ff538f
Diffstat (limited to 'nci')
-rwxr-xr-xnci/jni/NativeNfcManager.cpp2
-rwxr-xr-xnci/jni/SecureElement.cpp12
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;
}