summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartijn Coenen <maco@google.com>2013-04-15 09:09:51 -0700
committerMartijn Coenen <maco@google.com>2013-04-15 09:15:40 -0700
commitaafca6482d0b65b1ecab990659c07e4a82582db8 (patch)
treed009bee9a0073efe58883ff4c2fff0b593c3f465
parent027f41e53396c19c9b7572c49b7663c2e268c9af (diff)
downloadandroid_packages_apps_Nfc-aafca6482d0b65b1ecab990659c07e4a82582db8.tar.gz
android_packages_apps_Nfc-aafca6482d0b65b1ecab990659c07e4a82582db8.tar.bz2
android_packages_apps_Nfc-aafca6482d0b65b1ecab990659c07e4a82582db8.zip
Don't restart RF discovery if not needed.
No need to restart RF discovery is the current routing is already applied. Bug: 8508568 Change-Id: If4c2b4fef9211bbd0708e72a82e9726e43dd7857
-rwxr-xr-xnci/jni/NativeNfcManager.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/nci/jni/NativeNfcManager.cpp b/nci/jni/NativeNfcManager.cpp
index bf7c7142..b1199f94 100755
--- a/nci/jni/NativeNfcManager.cpp
+++ b/nci/jni/NativeNfcManager.cpp
@@ -1258,6 +1258,12 @@ static void nfcManager_doSelectSecureElement(JNIEnv*, jobject)
ALOGD ("%s: enter", __FUNCTION__);
bool stat = true;
+ if (sIsSecElemSelected)
+ {
+ ALOGD ("%s: already selected", __FUNCTION__);
+ goto TheEnd;
+ }
+
PowerSwitch::getInstance ().setLevel (PowerSwitch::FULL_POWER);
if (sRfEnabled) {
@@ -1265,22 +1271,14 @@ static void nfcManager_doSelectSecureElement(JNIEnv*, jobject)
startRfDiscovery (false);
}
- if (sIsSecElemSelected)
- {
- ALOGD ("%s: already selected", __FUNCTION__);
- goto TheEnd;
- }
-
stat = SecureElement::getInstance().activate (0xABCDEF);
if (stat)
SecureElement::getInstance().routeToSecureElement ();
sIsSecElemSelected = true;
-TheEnd:
startRfDiscovery (true);
-
PowerSwitch::getInstance ().setModeOn (PowerSwitch::SE_ROUTING);
-
+TheEnd:
ALOGD ("%s: exit", __FUNCTION__);
}