History log of /frameworks/base/core/java/android/nfc/NfcActivityManager.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
2bf6529bf8f81d1b9f0ff103f12d004937d0f59f 20-Nov-2014 Martijn Coenen <maco@google.com> Merge "Verify NFC permission immediately on API calls." into lmp-mr1-dev
d8bcfbadf7037dd2574312a3bfa04dd70d967166 14-Nov-2014 Martijn Coenen <maco@google.com> Verify NFC permission immediately on API calls.

Bug: 18358968
Change-Id: I648494e6435e107337e0c5bc4c6328774f9a54be
/frameworks/base/core/java/android/nfc/NfcActivityManager.java
56f299b87a891db38691cc0260f761c3ce8ef9ac 31-Oct-2014 Andres Morales <anmorales@google.com> Add UserHandle to BeamShareData

Allows NfcService to start the beam transfer
process in the correct user.

Bug:17966846
Change-Id: Ie98c98e763f0c2eabf11afda645c421b0332a2f6
/frameworks/base/core/java/android/nfc/NfcActivityManager.java
7fe9fa163ccd2ec34cbf533be4422aa66356431f 30-Jan-2014 Martijn Coenen <maco@google.com> Add an API to manually invoke Android Beam.

Activities can call NfcAdapter.invokeBeam() to
manually invoke the Beam animation. Any NFC tap
is then enough to complete the transaction.

Also, added NdefRecord convenience method for
creating Text records.

Bug: 5134061
Change-Id: Ia9df360d1d7e8451157c85a6d12f2a4eec924960
/frameworks/base/core/java/android/nfc/NfcActivityManager.java
5b1e032ea7c06ab11d778264dd950009fcb93cc5 03-Sep-2013 Martijn Coenen <maco@google.com> 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
/frameworks/base/core/java/android/nfc/NfcActivityManager.java
c20ed2ff125fd23bed25df8172bf24db84c5a352 27-Aug-2013 Martijn Coenen <maco@google.com> Add NFC reader-mode API.

Allows applications to temporarily force the NFC controller
to only do tag discovery. This will allow Android applications
to read and interact with devices that employ HCE.

Bug: 10360259
Change-Id: I709ead9a26f8e6ae8582cc295d82bd896e7c5bba
/frameworks/base/core/java/android/nfc/NfcActivityManager.java
1fa2aff21bc4cb89a141828c2661530e6aa655dd 27-Feb-2013 Martijn Coenen <maco@google.com> Add direct NDEF push API.

Hidden for now. Also, modified callback that is called
from NfcService to pass all data in a single object
(BeamShareData). This avoids having to do multiple IPCs
at touch time.

Bug: 5134061
Change-Id: I235f608cef9935041b33b4b7a6980f109c15576c
/frameworks/base/core/java/android/nfc/NfcActivityManager.java
1360c555a4e060be30a7a6a7916449441c1bf646 08-Jan-2013 Martijn Coenen <maco@google.com> Don't IPC for every onPause() in NfcActivityManager.

The NfcService now contains additional code to make sure
that the registered NDEF callback corresponds to the package
running in the foreground. This allows us to stop calling
the NfcService on every onPause() to register the NDEF callback,
as NfcService itself will now detect that the app is no longer
in the foreground, and won't call the callback.

Bug: 5199662
Change-Id: Ibd0d21f8c7b76346238305a6684967263cb7d7e0
/frameworks/base/core/java/android/nfc/NfcActivityManager.java
2c10311a01a9414a8efcedb267a45289a1617888 15-May-2012 Martijn Coenen <maco@google.com> NFC API documentation.

Added docs for beam Uri push and added some sanity checks on params.

Change-Id: I7c43b71c8a9ca4f742933d2d5b9473e0e2451dd3
/frameworks/base/core/java/android/nfc/NfcActivityManager.java
20e8dd9f9e7cff63c83e36a1761538a04c224cc1 13-Apr-2012 Martijn Coenen <maco@google.com> Unhide new Beam push APIs.

Also added support for multiple Uris, removed mimeType argument.

Change-Id: Iad2c4d0e36a174080d7bc9c9c8ab893f90231d02
/frameworks/base/core/java/android/nfc/NfcActivityManager.java
20fe5378d73a1c01f8d5a6d3c53c2b4802a0a680 05-Apr-2012 Martijn Coenen <maco@google.com> Make sure initial activity state is correct.

Change-Id: Ic6199b42e59afa06a0f38f866e2924b84cd234b3
/frameworks/base/core/java/android/nfc/NfcActivityManager.java
1d7e9062330a5a02247752de32a68ecbeba82783 04-Apr-2012 Nick Pelly <npelly@google.com> First cut at Bluetooth Beam

Change-Id: I37e5759515ff8779095b6d8adf5ad9c456fa8529
/frameworks/base/core/java/android/nfc/NfcActivityManager.java
8ce7a27770735791b5c38e4128f4ab9cee86bc43 21-Mar-2012 Nick Pelly <npelly@google.com> Use Application#registerLifecycleEvents() instead of a Fragment for Beam.

Fragments don't work as desired if called after life-cycle events
such as onDestory() or onSaveInstanceState().

The new approach doesn't work after onDestroy() either, but we can more
easily detect this now. For pre-JB apps, we will log an error, and for
JB and onwards we will throw.

Update documentation to make these rules clear, and to encourage
the use of a single Activity per API call, and to make the call
in onCreate().

Bug: 5199662
Bug: 5994691
Bug: 6034901
Bug: 6125297

Change-Id: Ib0dde6abfa44cd56c7ddc13ba0ad0e83bbe30058
/frameworks/base/core/java/android/nfc/NfcActivityManager.java
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