summaryrefslogtreecommitdiff
path: root/core/java/android/nfc/NfcActivityManager.java
Commit message (Collapse)AuthorAgeFilesLines
* Use new UnsupportedAppUsage annotation.Artur Satayev2019-12-181-2/+1
| | | | | | | | Existing annotations in libcore/ and frameworks/ will deleted after the migration. This also means that any java library that compiles @UnsupportedAppUsage requires a direct dependency on "unsupportedappusage" java_library. Bug: 145132366 Test: m && diff unsupportedappusage_index.csv Change-Id: I534e3fd1305e2f4af076986770033478448a665c
* Add @UnsupportedAppUsage annotationsMathew Inwood2018-07-311-0/+2
| | | | | | | | | | | | | | | | | | | For packages: android.nfc.tech android.nfc.dta android.nfc.cardemulation android.nfc This is an automatically generated CL. See go/UnsupportedAppUsage for more details. Exempted-From-Owner-Approval: Mechanical changes to the codebase which have been approved by Android API council and announced on android-eng@ Bug: 110868826 Test: m Change-Id: I6176e760bb0912fd075a36d65fa0b49680c14aa3
* Pass in the user defined by Context.Jeff Sharkey2018-02-031-2/+2
| | | | | | | | | | | | | | | The majority of Manager-style classes already use Context.getUserId() when making calls into the OS, so clean up the remaining callers to unify behind this strategy. This gives @SystemApi developers a nice clean interface to interact across user boundaries, instead of manually adding "AsUser" or "ForUser" method variants, which would quickly become unsustainable. Test: builds, boots Bug: 72863821 Exempt-From-Owner-Approval: trivial changes Change-Id: Ib772ec4438e57a2ad4950821b9432f9842998451
* Clear calling identify b4 Beam callback.Martijn Coenen2015-12-211-30/+34
| | | | | | | | Fixes AppOps crash, because it notices the calling package is different from the calling UID. Bug: 25492633 Change-Id: I55e2d975fd0a7ee94c4623efb3b19b1b54b72da2
* In NfcActivityManager, don't use UserHandle.CURRENT.Nicolas Prevot2015-07-011-1/+1
| | | | | | | | | In the work profile, UserHandle.CURRENT refers to the primary user. We want to refer to the work profile itself. So, using new UserHandle(UserHandle.myUserId()) instead. BUG:21960385 Change-Id: I4d880ccf6926e437d674874295029b29278f3e12
* Expose peer LLCP version in NDEF callbacks.Martijn Coenen2015-04-151-8/+7
| | | | Change-Id: I98b9a9764b66345f842c1f845c8a386161d965f5
* Merge "Verify NFC permission immediately on API calls." into lmp-mr1-devMartijn Coenen2014-11-201-0/+28
|\
| * Verify NFC permission immediately on API calls.Martijn Coenen2014-11-141-0/+28
| | | | | | | | | | Bug: 18358968 Change-Id: I648494e6435e107337e0c5bc4c6328774f9a54be
* | Add UserHandle to BeamShareDataAndres Morales2014-11-031-3/+10
|/ | | | | | | | Allows NfcService to start the beam transfer process in the correct user. Bug:17966846 Change-Id: Ie98c98e763f0c2eabf11afda645c421b0332a2f6
* Add an API to manually invoke Android Beam.Martijn Coenen2014-02-141-1/+10
| | | | | | | | | | | | 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
* Reader mode NFC API: move to callback model.Martijn Coenen2013-09-021-10/+37
| | | | | | | | | | | | | | | | | | 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
* Add NFC reader-mode API.Martijn Coenen2013-08-271-1/+60
| | | | | | | | | 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
* Add direct NDEF push API.Martijn Coenen2013-03-261-28/+21
| | | | | | | | | | 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
* Don't IPC for every onPause() in NfcActivityManager.Martijn Coenen2013-01-071-10/+8
| | | | | | | | | | | | 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
* NFC API documentation.Martijn Coenen2012-05-161-1/+17
| | | | | | Added docs for beam Uri push and added some sanity checks on params. Change-Id: I7c43b71c8a9ca4f742933d2d5b9473e0e2451dd3
* Unhide new Beam push APIs.Martijn Coenen2012-04-121-20/+37
| | | | | | Also added support for multiple Uris, removed mimeType argument. Change-Id: Iad2c4d0e36a174080d7bc9c9c8ab893f90231d02
* Make sure initial activity state is correct.Martijn Coenen2012-04-051-0/+4
| | | | Change-Id: Ic6199b42e59afa06a0f38f866e2924b84cd234b3
* First cut at Bluetooth BeamNick Pelly2012-04-041-1/+39
| | | | Change-Id: I37e5759515ff8779095b6d8adf5ad9c456fa8529
* Use Application#registerLifecycleEvents() instead of a Fragment for Beam.Nick Pelly2012-03-291-127/+220
| | | | | | | | | | | | | | | | | | | | 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
* Remove NfcFragment from activity when no longer sharing.Martijn Coenen2011-10-141-0/+1
| | | | | | | | This fixes scenarios where the same activity sets, unsets and re-sets an NdefMessage and/or callback. Bug: 5454848 Change-Id: I5ed98047b9cfe90d2f48656d978f2d08bb4bf0cc
* Fix Activity ref-leak in NFC dispatch API.Martijn Coenen2011-09-011-3/+11
| | | | Change-Id: I7b1ee6927747b12eb94cfd6ece40c2c73003f07f
* Improve NDEF push APINick Pelly2011-08-261-0/+217
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