diff options
author | Martijn Coenen <maco@google.com> | 2013-09-02 20:38:47 -0700 |
---|---|---|
committer | Martijn Coenen <maco@google.com> | 2013-09-02 20:43:57 -0700 |
commit | 5b1e032ea7c06ab11d778264dd950009fcb93cc5 (patch) | |
tree | 69b8691184cde10bbf629921a4a17e0e419f7078 /api/current.txt | |
parent | 52c10e94d98e32d977bfd4021136f4c9fa571bd6 (diff) | |
download | frameworks_base-5b1e032ea7c06ab11d778264dd950009fcb93cc5.zip frameworks_base-5b1e032ea7c06ab11d778264dd950009fcb93cc5.tar.gz frameworks_base-5b1e032ea7c06ab11d778264dd950009fcb93cc5.tar.bz2 |
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
Diffstat (limited to 'api/current.txt')
-rw-r--r-- | api/current.txt | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/api/current.txt b/api/current.txt index 7aea255..709fcd9 100644 --- a/api/current.txt +++ b/api/current.txt @@ -15182,7 +15182,7 @@ package android.nfc { method public void disableReaderMode(android.app.Activity); method public void enableForegroundDispatch(android.app.Activity, android.app.PendingIntent, android.content.IntentFilter[], java.lang.String[][]); method public deprecated void enableForegroundNdefPush(android.app.Activity, android.nfc.NdefMessage); - method public void enableReaderMode(android.app.Activity, int); + method public void enableReaderMode(android.app.Activity, android.nfc.NfcAdapter.ReaderCallback, int, android.os.Bundle); method public static android.nfc.NfcAdapter getDefaultAdapter(android.content.Context); method public boolean isEnabled(); method public boolean isNdefPushEnabled(); @@ -15198,12 +15198,14 @@ package android.nfc { field public static final java.lang.String EXTRA_ADAPTER_STATE = "android.nfc.extra.ADAPTER_STATE"; field public static final java.lang.String EXTRA_ID = "android.nfc.extra.ID"; field public static final java.lang.String EXTRA_NDEF_MESSAGES = "android.nfc.extra.NDEF_MESSAGES"; + field public static final java.lang.String EXTRA_READER_PRESENCE_CHECK_DELAY = "presence"; field public static final java.lang.String EXTRA_TAG = "android.nfc.extra.TAG"; field public static final int FLAG_READER_KOVIO = 16; // 0x10 field public static final int FLAG_READER_NFC_A = 1; // 0x1 field public static final int FLAG_READER_NFC_B = 2; // 0x2 field public static final int FLAG_READER_NFC_F = 4; // 0x4 field public static final int FLAG_READER_NFC_V = 8; // 0x8 + field public static final int FLAG_READER_NO_PLATFORM_SOUNDS = 256; // 0x100 field public static final int FLAG_READER_SKIP_NDEF_CHECK = 128; // 0x80 field public static final int STATE_OFF = 1; // 0x1 field public static final int STATE_ON = 3; // 0x3 @@ -15223,6 +15225,10 @@ package android.nfc { method public abstract void onNdefPushComplete(android.nfc.NfcEvent); } + public static abstract interface NfcAdapter.ReaderCallback { + method public abstract void onTagDiscovered(android.nfc.Tag); + } + public final class NfcEvent { field public final android.nfc.NfcAdapter nfcAdapter; } |