summaryrefslogtreecommitdiffstats
path: root/src/nfc/qnearfieldtarget_android.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/nfc/qnearfieldtarget_android.cpp')
-rw-r--r--src/nfc/qnearfieldtarget_android.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/nfc/qnearfieldtarget_android.cpp b/src/nfc/qnearfieldtarget_android.cpp
index 891ce3fc..850f8b4d 100644
--- a/src/nfc/qnearfieldtarget_android.cpp
+++ b/src/nfc/qnearfieldtarget_android.cpp
@@ -304,12 +304,12 @@ void NearFieldTarget::checkIsTargetLost()
QString techStr = m_techList.first();
QAndroidJniObject tagTech = getTagTechnology(techStr);
tagTech.callMethod<void>("connect");
- if (catchJavaExceptions()) {
+ if (catchJavaExceptions(false)) {
handleTargetLost();
return;
}
tagTech.callMethod<void>("close");
- if (catchJavaExceptions())
+ if (catchJavaExceptions(false))
handleTargetLost();
}
@@ -436,11 +436,12 @@ QByteArray NearFieldTarget::jbyteArrayToQByteArray(const jbyteArray &byteArray)
return resultArray;
}
-bool NearFieldTarget::catchJavaExceptions() const
+bool NearFieldTarget::catchJavaExceptions(bool verbose) const
{
QAndroidJniEnvironment env;
if (env->ExceptionCheck()) {
- env->ExceptionDescribe();
+ if (verbose)
+ env->ExceptionDescribe();
env->ExceptionClear();
return true;
}