summaryrefslogtreecommitdiffstats
path: root/src/com/android/nfc/NfcService.java
Commit message (Collapse)AuthorAgeFilesLines
* Support for setting p2p modes from javaland and some cleanup.Martijn Coenen2012-03-021-0/+12
| | | | | | Removed code-duplication, fixed some warnings. Change-Id: I5b7a2986e3836d6689b677bf80cb93421bfa821e
* Fix crash when disabling NFC with target in field.Martijn Coenen2012-02-271-2/+8
| | | | Change-Id: I6c8d85278bc1379d40d83ec4d3df5797e4643e10
* Cache installed packages for sending SE broadcasts.Martijn Coenen2012-02-131-21/+41
| | | | | | | | | | | | | | Getting the list of installed packages takes some time on a phone with lots of packages (seen >500ms). Since we did this for every SE broadcast (including field on / field off), I've seen the NFC service event queue fill up, which has a bad effect on latency-critical events such as the events for llcp link establishment. This caches the list of installed packages. Bug: 5963061 Change-Id: Ia9f02c9ce58dae5c81949f7317425e5ee415ee92
* Merge "LLCP 1.1 support."Martijn Coenen2012-01-271-2/+2
|\
| * LLCP 1.1 support.Martijn Coenen2012-01-271-2/+2
| | | | | | | | | | | | | | | | | | | | - Allow servicename for connectionless sockets; - Pass in servicename in Bind() for both types; - EchoServer: allow MIU=128 again since ATR_RES fix was merged in libnfc-nxp - EchoServer: fix reading from incorrect offset. Change-Id: Ie77fe5b46e7a17435e6261c8b7400dcca4d3784a
* | Don't need to pass the NdefMessage in dispatch().Nick Pelly2012-01-261-7/+7
| | | | | | | | Change-Id: Ib1463aa51b1ce48cf7217866cb7c11ab8caa4e06
* | Rewrite NDEF dispatch path. It was getting pretty messy.Nick Pelly2012-01-251-8/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The dispatch sequence is identical, but the hierarchy of functions has been collapsed. The flow now is: dipsatchTag() -> tryOverrides() -> *** NDEF override *** *** TECH override *** *** TAG override *** tryNdef() -> *** AAR to NDEF *** *** AAR to application launch *** *** AAR to market launch *** *** regular NDEF *** tryTech() -> *** TECH *** *** TAG *** o Fix bug where cancelling a pending intent would disable further foreground dispatch. o Fix bug where a foreground process dying would not cancel override o Assume one NdefMessage per tag in implementation methods Change-Id: Iaf7a0a83076e4f540a5e55c9e628490570116b01
* | Merge "Bring LLCP connectionless sockets back to life."Martijn Coenen2012-01-181-0/+7
|\ \ | |/
| * Bring LLCP connectionless sockets back to life.Martijn Coenen2012-01-131-0/+7
| | | | | | | | | | | | Useful for testing the connectionless part of the LLCP stack. Change-Id: I76a7962526ec1e6ff463c938431229f89c545824
* | Make airplane override for NFC persistent.Martijn Coenen2012-01-101-4/+14
|/ | | | | | | Make behavior identical to wifi/bluetooth. Bug: 5455123 Change-Id: I8c10888b7d3129723c6520dc0e81fa1793ae542c
* NfcService: some trivial cleanups.mike wakerly2011-12-121-9/+7
| | | | | | | | | | | | I noticed these while looking at something else. - Removes unused imports; unthrown exceptions on some non-visible methods; dead code. - Tags a few stray interface implementations that lacked @Override. - Removes unnecessary semicolons in a few place. - Fixes one instance of ArrayList being used as a raw type. Change-Id: I860921a3a4d003fd6d6fc1381c0813599f3caf26
* resolved conflicts for merge of 92250f5c to masterNick Pelly2011-12-011-14/+25
|\ | | | | | | Change-Id: Ibad338d19e8b8c54ce02a0e347d1965dcf7b7008
| * Fix mismatched link()/unlink() causing NFC-EE to be stuck open.Nick Pelly2011-12-011-14/+25
| | | | | | | | | | | | | | | | | | | | The fix is to keep a strong reference to the IBinder (actually a BinderProxy) from the caller while the NFC-EE is open. The bug occurs when a GC occurs in NfcService while the NFC-EE is open. The BinderProxy is destroyed before it has been unlinked. Bug: 5684874
* | Fix two incorrect synchronized statements.mike wakerly2011-11-281-2/+2
| | | | | | | | | | | | | | (credit: robtsai) Change-Id: Ic628bd0c156cd88e0f18db46212c8ebdf4eaedf5 Bug: 5631907
* | am e1cadb0c: Merge "Replace vendor specific NfcGoogle.apk with generic ↵Nick Pelly2011-11-211-1/+0
|\ \ | |/ | | | | | | | | | | Nfc.apk" into ics-mr1 * commit 'e1cadb0cb6d6741a8b0a94456a5324c6f4a6f64d': Replace vendor specific NfcGoogle.apk with generic Nfc.apk
| * Merge "Replace vendor specific NfcGoogle.apk with generic Nfc.apk" into ics-mr1Nick Pelly2011-11-211-1/+0
| |\
| | * Replace vendor specific NfcGoogle.apk with generic Nfc.apkNick Pelly2011-11-211-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The access control changes allow us to just use Nfc.apk with the regular platform certificate, instead of the custom signed NfcGoogle.apk. So we can compeltely get rid of vendor/google/apps/NfcGoogle and just build it out of packages/apps/Nfc now. The package name is also reverted from com.android.nfc3 to com.android.nfc The NFC uid needs to get bumped (25 to 27) to allow the cert change. Bug: 5608249 Change-Id: I4437dff96f2529f0b9e7d8e65c21359c3eeccd0b
* | | am 806a7827: Merge "Also send NFCEE broadcasts to dynamically registered ↵Martijn Coenen2011-11-171-9/+6
|\ \ \ | |/ / | | | | | | | | | | | | | | | receivers." into ics-mr1 * commit '806a78272a812f274309bd902b319590a254a896': Also send NFCEE broadcasts to dynamically registered receivers.
| * | Also send NFCEE broadcasts to dynamically registered receivers.Martijn Coenen2011-11-171-9/+6
| |/ | | | | | | | | Bug: 5630129 Change-Id: I050283b6a8be0f564b34da0f8c08c6bb708f2501
* | am 2b093e93: Merge "Enable NFC-EE immediately when screen is on but locked." ↵Nick Pelly2011-11-151-92/+143
|\ \ | |/ | | | | | | | | | | into ics-mr1 * commit '2b093e93f56f008413665e876a6189921a4a57b3': Enable NFC-EE immediately when screen is on but locked.
| * Merge "Enable NFC-EE immediately when screen is on but locked." into ics-mr1Nick Pelly2011-11-151-92/+143
| |\
| | * Enable NFC-EE immediately when screen is on but locked.mike wakerly2011-11-151-92/+143
| | | | | | | | | | | | | | | Bug: 5375005 Change-Id: I072dfbca1fa8cdd25cf9232f2f0c82080aec767b
* | | am f4226b69: Merge "Add null check to aovid NPE on un-matched close()." into ↵Nick Pelly2011-11-151-3/+7
|\ \ \ | |/ / | | | | | | | | | | | | | | | ics-mr1 * commit 'f4226b69c9e19d0329069b39d8ae2774fcbf88d1': Add null check to aovid NPE on un-matched close().
| * | Merge "Add null check to aovid NPE on un-matched close()." into ics-mr1Nick Pelly2011-11-141-3/+7
| |\ \ | | |/
| | * Add null check to aovid NPE on un-matched close().Nick Pelly2011-11-141-3/+7
| | | | | | | | | | | | | | | | | | Also finish removing NFCEE permission, and fix a couple of style mistakes. Change-Id: I4ec22469990de6661365c281db2e8cfd7ae413b0
* | | resolved conflicts for merge of ebf4b36e to masterNick Pelly2011-11-111-27/+58
|\ \ \ | |/ / | | | | | | Change-Id: I73a3025a35da21db6600b6e82c99836641e9bee7
| * | Merge "Implement static white-list access control for NFC-EE." into ics-mr1Nick Pelly2011-11-111-27/+58
| |\ \ | | |/
| | * Implement static white-list access control for NFC-EE.Jeff Hamilton2011-11-111-27/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NFC service now has a build time array of package signatures and package names that are allowed access to the NFCEE, removing the shared certificate requirement. See sample_nfcee_access.xml for the XML format. Bug: 4515759 Change-Id: Ibf03e259137f2f4247ec5d31fb88b1090b013d32
* | | am d9203771: Optimize soundpool use.Martijn Coenen2011-11-111-13/+51
|\ \ \ | |/ / | | | | | | | | | * commit 'd92037714c289cffb9ed1e6e6df36cd3b7292a21': Optimize soundpool use.
| * | Optimize soundpool use.Martijn Coenen2011-11-111-13/+51
| |/ | | | | | | | | | | | | Share a single soundpool and release it when NFC is disabled. Bug: 5590478 Change-Id: I858c9520bf6880e7d7c5920c12966d86108dd125
| * Add event logs for NFC events. DO NOT MERGEJeff Hamilton2011-10-281-6/+6
| | | | | | | | | | Bug: 5128799 Change-Id: I5607abe5d28ef9682afa084651c50aa651655b60
* | Changes semantics of isNdefPushEnabled() - require NFC to be enabled.Nick Pelly2011-10-311-1/+1
| | | | | | | | Change-Id: I065411644c19e30f01ce93560fc7e37efe817fe0
* | Add event logs for NFC events.Jeff Hamilton2011-10-251-6/+6
|/ | | | Change-Id: I5607abe5d28ef9682afa084651c50aa651655b60
* NFC: Enable guard host timeout.Martijn Coenen2011-10-211-0/+1
| | | | | | | Set to 255 ms, increase number of retries to 64. Add dump() interface to native library Change-Id: Ib3a32f70453f7f8b79ff89394410f56b4b9dd7a2
* Fix crash when turning screen off and NFC is off.Martijn Coenen2011-10-191-6/+4
| | | | | Bug: 5480404 Change-Id: I52add3c89fc535bfc37bc8c12ed0f8f905cbe304
* Make the crash on screen off less frequent.Jeff Hamilton2011-10-171-16/+35
| | | | | | | | | | | | | | | | | | | | | | | The LLCP stack is still using globals without holding the concurrency lock. When turning the screen off we were previously disabling the NFCEE routing before disconnecting the active target. The routing code would grab the lock and then touch the globals, which the LLCP was using illegally, causing a crash when the LLCP triggered callbacks are delivered. This change reorders the shutdown at screen off to disconnect the remote target before issuing the change to the NFCEE routing in an attempt to stop the ongoing LLCP transactions, thereby avoiding the crash. Since the callbacks are asynchronous the race is still there, but it's hit more like 10% of the time instead of 100% of the time. Bug: 5366024 Change-Id: I31230166c1c5bf116195db350ac6605feb90e87f
* Add DUMP permissions checkKenny Root2011-09-301-0/+9
| | | | | Bug: 5389201 Change-Id: I8ddb60ebe63bcc01e0695868286ad4c7da4afa69
* NfcService: call enableAppSwitches for additional events.mike wakerly2011-09-281-0/+1
| | | | | | This addresses the responsiveness issue identified in b/5140941 Change-Id: I8fad061be2e3f1006e4e2910db84c0a3360e2a0a
* Fix NFC to only be enabled when the lockscreen is dismissed.Jeff Hamilton2011-09-261-1/+1
| | | | | Bug: 5300713 Change-Id: I93f0d75d159b3456e6fa8fc376d10493f25e3233
* Manually port d77e05f7 from gingerbread:Jeff Hamilton2011-09-141-0/+5
| | | | | | | | | Patch to perform a download at NfcService boot time This patch permit, when NFC is off, to perform a download if the PN544 is not up to date Change-Id: Iaa01e218ccd1e4cb18ef77d58c18348823135b1e
* Include stopped apps when broadcasting SE events.Jeff Hamilton2011-09-061-6/+11
| | | | | Bug: 5249686 Change-Id: I5b3f2708ef28de58655ac2901f85f0575210f01c
* Merge "NFC service updates for moving NDEF push to a fragment."Nick Pelly2011-08-261-53/+27
|\
| * NFC service updates for moving NDEF push to a fragment.Nick Pelly2011-08-251-53/+27
| | | | | | | | | | | | | | enable()/disable() -> set() ZeroClick -> NdefPush Change-Id: I21806665b8fd29e4580bd2e3200858d834605f6f
* | Support for getMaxTransceiveLength() API.Martijn Coenen2011-08-261-5/+27
|/ | | | | Maximum transceive length is enforced in calls to transceive. Change-Id: I94a4f16283e5fd5df9143b02e52c16f868b1c3ab
* Decouple P2P link management from P2P UX management.Nick Pelly2011-08-101-89/+20
| | | | | | | | | | | | | | | | | | | The goal is to make it easier to track the state of the P2P transfer, and to make it easier to fine-tune UX (sound, vibration, animation) for P2P transfer. NdefP2pManager -> P2pLinkManager It now only handles LLCP and NDEF logic (and no UX). It has a state machine to track the state of the LLCP link, send and receive. It does debouncing on the LLCP link. Events are surfaced to P2pEventManager through the P2pEventListener interface. P2pEventManager Handles all UX (sound, vibration, animation) and send confirmation. The current implementation uses Rotation to confirm send, and P2pAnimationActivity to animate the send. Change-Id: Ie498219857afe69403e90f09c77f4d6d1b24ffeb
* Address code review comments for "Increase priority of EnableDisableTask..."Nick Pelly2011-08-101-0/+3
| | | | | | Restore THREAD_PRIORITY_BACKGROUND. Change-Id: Id33b3c9d38e04fd61a758b81e46d26ec22a1aae0
* Increase priority of EnableDisableTask thread to fix FW download failures.Nick Pelly2011-08-091-0/+10
| | | | | | | | | | | | | | AsyncTask uses THREAD_PRIORITY_BACKGROUND, which is not responsive enough to execute software I2C firmware download with the NXP PN544. Use THREAD_PRIORITY_DEFAULT instead. Software I2C uses the host processor to manually toggle the transport line to indicate each bit. With THREAD_PRIORITY_BACKGROUND there might be high latency between bits. The observed result is that we do not receive the expected "00 00 00" response to a firmware write command - we hang and timeout. Change-Id: I525759837d26009c01304f60a420b5213443d959
* Fix bug where NfcAdapterExtras.get() always fails.Nick Pelly2011-08-091-2/+7
| | | | | | And improve some logging while we're at it. Change-Id: Ia1f5c1a451690bfcf5b9af75e855c09164460561
* A bunch of NfcService improvements.Nick Pelly2011-08-091-478/+581
| | | | | | | | | | | | | o Make enable/disable async, notify with NfcAdapter.ACTION_ADAPTER_STATE_CHANGED o Make NFC enabled/disabled a 4-state machine, managed in EnableDisableTask o Airplane mode support: automatic disable/enable without persisting preference o Rename SE reset to EE wipe for consistency, remove some dead code o Allow EE wipe during airplane mode o Fix thread-safety issues on mObjectMap and a few others o Improve power on/off state machine in prepration for airplane mode support. o Implement dump(): executed by "adb shell dumpsys nfc" Change-Id: I408c38eae8fa1b55c3752cb3bdc1d22a49b5a1e6
* Turn on polling if NFC service restarts with screen on.Nick Pelly2011-08-061-1/+1
| | | | | | | There was a bug where mScreenUnlocked is initialized incorrectly when the screen is on. Change-Id: Id1bc813f6927d23cc317c0f0da074c0cee160fe3