2ec83936a1c05d3286cb5656566e905a50d871de |
|
14-Oct-2011 |
Martijn Coenen <maco@google.com> |
Remove NfcFragment from activity when no longer sharing. This fixes scenarios where the same activity sets, unsets and re-sets an NdefMessage and/or callback. Bug: 5454848 Change-Id: I5ed98047b9cfe90d2f48656d978f2d08bb4bf0cc
/frameworks/base/core/java/android/nfc/NfcActivityManager.java
|
3433a8ae5abf7c518277e2e00c141e1dec83600c |
|
02-Sep-2011 |
Martijn Coenen <maco@google.com> |
Fix Activity ref-leak in NFC dispatch API. Change-Id: I7b1ee6927747b12eb94cfd6ece40c2c73003f07f
/frameworks/base/core/java/android/nfc/NfcActivityManager.java
|
c84c89a6cacaf16c1ba41f57cc1aecdb150e85f9 |
|
23-Aug-2011 |
Nick Pelly <npelly@google.com> |
Improve NDEF push API Introduce setNdefPushMessage() setNdefPushMessageCallback() setNdefPushCompleteCallback() Deprecate public API enableForegroundNdefPush() disableForegroundNdefPush() Hide & Deprecate staged (public but never released) API enableForegroundNdefPushCallback() The new API's do not require the application to explicitly call enable()/disable() in onPause()/onResume(), we use a Fragment behind the scenes to manager this automatically. NDEF Push can be disabled by using a null parameter, so each enable()/disable() pair is collapsed to a single set() call. Application code should now look something like: public void onCreate() { NfcAdapter adapter = NfcAdapter.getDefaultAdapter(this); if (adapter != null) { // check that NFC is available on this device adapter.setNdefPushMessage(myNdefMessage, this); } } And that's it - no need to explicitly hook into onPause() and onResume() events. Also - introduce a generic NfcEvent class that is provided as a parameter on all NFC callbacks. Right now it just provides the NfcAdapter, but using the wrapper classes allows us to add more fields later without changing the callback signature. (i'm thinking Bluetooth). Change-Id: I371dcb026b535b8199225c1262eca64ce644458a
/frameworks/base/core/java/android/nfc/NfcActivityManager.java
|