Fix for NFC service died during RF transaction from ESE and NFC ON/OFF
To avoid deadlock in JNI due to StartRfDiscovery/acquireRfInterfaceMutexLock
called post Nfc deinit
diff --git a/nci/SN100x/jni/NativeNfcManager.cpp b/nci/SN100x/jni/NativeNfcManager.cpp
index 64688dc..3b5d137 100644
--- a/nci/SN100x/jni/NativeNfcManager.cpp
+++ b/nci/SN100x/jni/NativeNfcManager.cpp
@@ -1339,19 +1339,23 @@
/* Delay is required to avoid update routing during RF Field session*/
usleep(1000 * 1000);
}
-
- /*Stop RF discovery to reconfigure*/
- startRfDiscovery(false);
+ if (sIsDisabling || !sIsNfaEnabled) {
+ return status;
+ }
+ if (sRfEnabled) {
+ /*Stop RF discovery to reconfigure*/
+ startRfDiscovery(false);
+ }
NativeJniExtns::getInstance().notifyNfcEvent(__func__);
LOG(ERROR) << StringPrintf("commitRouting here");
status = RoutingManager::getInstance().commitRouting();
NativeJniExtns::getInstance().notifyNfcEvent("checkIsodepRouting");
- if (!sRfEnabled) {
- /*Stop RF discovery to reconfigure*/
- startRfDiscovery(true);
- }
- return status;
+ if (!sRfEnabled) {
+ /*Stop RF discovery to reconfigure*/
+ startRfDiscovery(true);
+ }
+ return status;
#else
return RoutingManager::getInstance().commitRouting();
#endif