OSDN Git Service

Reader mode NFC API: move to callback model.
authorMartijn Coenen <maco@google.com>
Tue, 3 Sep 2013 03:38:47 +0000 (20:38 -0700)
committerMartijn Coenen <maco@google.com>
Tue, 3 Sep 2013 03:43:57 +0000 (20:43 -0700)
commit5b1e032ea7c06ab11d778264dd950009fcb93cc5
tree69b8691184cde10bbf629921a4a17e0e419f7078
parent52c10e94d98e32d977bfd4021136f4c9fa571bd6
Reader mode NFC API: move to callback model.

Using intents for reader mode doesn't work well for 2 reasons:
1) Intents are used to resolve, but in reader mode we already
   know where to resolve to. Additionally, dispatching an intent
   causes additional latency.
2) Using intents with foreground dispatch was tricky; for every
   call to onNewIntent() with a new tag, there was a call to
   onPause(), which effectively disabled reader mode again,
   causing a discovery loop.

Instead, let the app register a callback, and call that when
we discover a new tag. Also, add new flag to disable platform
sounds, and to change the presence check delay.

Bug: 10360259
Change-Id: I8373543d6cf2f7ca73c9b3e42bb8b51e3ac48cac
Android.mk
api/current.txt
core/java/android/nfc/IAppCallback.aidl [moved from core/java/android/nfc/INdefPushCallback.aidl with 90% similarity]
core/java/android/nfc/INfcAdapter.aidl
core/java/android/nfc/NfcActivityManager.java
core/java/android/nfc/NfcAdapter.java