summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartijn Coenen <maco@google.com>2016-08-31 14:50:21 +0000
committerandroid-build-merger <android-build-merger@google.com>2016-08-31 14:50:21 +0000
commit3534e7c19bf1f06b897c4c48e118f1d8e298577e (patch)
tree998874154b59618dde6f8e8affa8e1402a4087ad
parent54dda0fb56b3d1d220324359d5c3450a9a117938 (diff)
parent6e95c4d9dacc38108b0818a5b622d7cdf4f4b1b5 (diff)
downloadandroid_packages_apps_Nfc-3534e7c19bf1f06b897c4c48e118f1d8e298577e.tar.gz
android_packages_apps_Nfc-3534e7c19bf1f06b897c4c48e118f1d8e298577e.tar.bz2
android_packages_apps_Nfc-3534e7c19bf1f06b897c4c48e118f1d8e298577e.zip
Don't dispatch tags when NDEF read times out.
am: 6e95c4d9da Change-Id: If0bfe08a80df11631fc46053d7ca8e88173ded92
-rwxr-xr-xnci/jni/NfcTag.cpp3
-rwxr-xr-xnci/src/com/android/nfc/dhimpl/NativeNfcTag.java5
-rwxr-xr-xsrc/com/android/nfc/NfcService.java9
3 files changed, 3 insertions, 14 deletions
diff --git a/nci/jni/NfcTag.cpp b/nci/jni/NfcTag.cpp
index ddf354a3..c6e074bd 100755
--- a/nci/jni/NfcTag.cpp
+++ b/nci/jni/NfcTag.cpp
@@ -1422,6 +1422,9 @@ void NfcTag::connectionEventHandler (UINT8 event, tNFA_CONN_EVT_DATA* data)
{
SyncEventGuard g (mReadCompleteEvent);
mReadCompletedStatus = data->status;
+ mNdefDetectionTimedOut = data->status != NFA_STATUS_OK;
+ if (mNdefDetectionTimedOut)
+ ALOGE ("%s: NDEF detection timed out", fn);
mReadCompleteEvent.notifyOne ();
}
break;
diff --git a/nci/src/com/android/nfc/dhimpl/NativeNfcTag.java b/nci/src/com/android/nfc/dhimpl/NativeNfcTag.java
index c121a622..6e5ffca7 100755
--- a/nci/src/com/android/nfc/dhimpl/NativeNfcTag.java
+++ b/nci/src/com/android/nfc/dhimpl/NativeNfcTag.java
@@ -812,11 +812,6 @@ public class NativeNfcTag implements TagEndpoint {
if (generateEmptyNdef) {
ndefMsg = null;
- addNdefTechnology(null,
- getConnectedHandle(),
- getConnectedLibNfcType(),
- getConnectedTechnology(),
- supportedNdefLength, cardState);
foundFormattable = false;
reconnect();
}
diff --git a/src/com/android/nfc/NfcService.java b/src/com/android/nfc/NfcService.java
index d91e3b55..6b671e8f 100755
--- a/src/com/android/nfc/NfcService.java
+++ b/src/com/android/nfc/NfcService.java
@@ -1848,12 +1848,6 @@ public class NfcService implements DeviceHostListener {
}
}
- boolean playSound = (readerParams == null ||
- (readerParams.flags & NfcAdapter.FLAG_READER_NO_PLATFORM_SOUNDS) == 0) &&
- debounceTagUid == null;
- if (mScreenState == ScreenStateHelper.SCREEN_STATE_ON_UNLOCKED && playSound) {
- playSound(SOUND_START);
- }
if (tag.getConnectedTechnology() == TagTechnology.NFC_BARCODE) {
// When these tags start containing NDEF, they will require
// the stack to deal with them in a different way, since
@@ -1870,9 +1864,6 @@ public class NfcService implements DeviceHostListener {
// First try to see if this was a bad tag read
if (!tag.reconnect()) {
tag.disconnect();
- if (playSound) {
- playSound(SOUND_ERROR);
- }
break;
}
}