summaryrefslogtreecommitdiffstats
path: root/nci/jni
Commit message (Collapse)AuthorAgeFilesLines
* Fast-fail SE open if it's activated in listen mode.Martijn Coenen2012-10-115-17/+219
| | | | | | | | | | | | | | | | | | | | Users of the NFC-extras API usually want to talk to the SE once it has completed a transaction. The hard part is knowing when it is safe to connect to the SE, as it will break the connection to any reader. And when relinquishing the connection to the SE, the reader may find the device again and process another transaction. This patch adds the following two conditions for allowing to open the SE from the DH: 1) The SE may not be activated in listen mode 2) The RF field must have been off for at least 50 ms Bug: 7275484 Change-Id: Ibde32a8e2aef045c17ab76ef08c72f96edfedaef
* Use RF_ACTIVATE/DEACTIVATE to generate RF events. (DO NOT MERGE)Paul Chaisson2012-10-111-1/+44
| | | | | | | | Create the RF Events for SE transactions based on RF activations (listen mode and ISO-DEP only). Bug: 7276275 Change-Id: Ibea0f64ba82ed31a7c582f6a44eb15abf25dda1c
* Don't return target lost in case of NACK for T2T.Martijn Coenen2012-10-091-14/+12
| | | | | | | | | Causes applications such as TagInfo to report the tag as being lost. Also fixed a small memory leak triggered in this case. Bug: 7294613 Change-Id: I260e02896e534b23de5c7e0278609e27a9a20e7f
* NFA_HciAddStaticPipe()'s parameters changedEvan Chu2012-10-041-2/+6
| | | | | Bug: 7282057 Change-Id: Ic877f67654906e21f1942adf05751943e3d6cb01
* Fix locking around power state.Evan Chu2012-10-033-10/+34
| | | | | | | Protect state against multi-threaded access. Bug: 7281263 Change-Id: I12735c725b6abf956cb7143f25397653839bc6e4
* Substitute empty select for configurable AID.Paul Chaisson2012-10-022-1/+47
| | | | | | | | Workaround some SEs that do not support interpreting an empty select as a select of the card manager. Bug: 7198430 Change-Id: Icce0e793ca6f03d5c2271812859b04417d2708e8
* Merge "Fix native crash during RF field notifications." into jb-broadcom-nfcMartijn Coenen2012-10-011-1/+1
|\
| * Fix native crash during RF field notifications.Martijn Coenen2012-10-011-1/+1
| | | | | | | | | | Bug: 7264008 Change-Id: I2647b0c6adf8f95e21d9f789c411742aef19c5ad
* | Power up the NFCC when DH wants to talk to the SE.Paul Chaisson2012-09-304-51/+73
| | | | | | | | | | | | | | | | We need to allow usecases were the DH wants to talk to the SE even if the screen is off. Bug: 7257431 Change-Id: Iad66ef29757985b7aab5f0748fbf7589b3777bc3
* | Do not activate a tag during NFC disable.Evan Chu2012-09-302-3/+9
|/ | | | | | | Could cause RF field to remain on. Bug: 7164846 Change-Id: I82efc29b96c7129465fea5354fa5484da31618a6
* Disable all RF activity when DH connects to SE.Martijn Coenen2012-09-262-1/+13
| | | | | | | | | | | | | | If we leave RF polling/listen enabled while talking to the SE from the DH, there is corruption on frames sent out over SWP. To resolve this, disable discovery (both poll and listen) when the SE is route to the DH. This also makes the behavior identical to that of the PN65N devices, which don't allow any RF activity when the SE is routed to the host. Bug: 7004303 Change-Id: I05ad55a6f75b9f346feaf20dccefc23919ff538f
* Enable/disable RF discovery only when needed.Martijn Coenen2012-09-261-4/+11
| | | | | | | Fixes coming out of suspend with EE routing enabled. Bug: 7233312 Change-Id: Ibbb9d7c26c2152fbac543d84d3306fc0ed50272d
* Tell secure element to warm-reset when closing pipe to DH.Evan Chu2012-09-252-1/+36
| | | | | | | | | | | Set HCI registry to cause Oberthur secure element to perform warm-reset. We use this to close any applets that the DH may have opened during communication to the SE. This feature is Oberthur-specific. Bug: 7163680 Change-Id: Id0589b5b41bbea1df9b8dbd73abd5a112f773916
* Fix NXP PN544 controller interop with Broadcom controllerEvan Chu2012-09-256-56/+463
| | | | | | | | When NDEF detection times out, stop polling temporarily. Let NXP PN544 controller poll and activate the NFC-DEP interface. Bug: 6986507 Change-Id: Iaa3194e4dbc4b9d2c16aaeb360a7f15dfd82c38a
* Don't try to set low-power mode if NFA_enable fails.Evan Chu2012-09-251-1/+2
| | | | | | | Would otherwise cause stack hang. Bug: 7214014 Change-Id: I5a5373f389b06b873cee1c1fb694502d7ad598b3
* Don't print error for resetting SE route.Martijn Coenen2012-09-201-1/+1
| | | | | Bug: 7113095 Change-Id: Iaa2e2b05244ec10392c98aa5dd0d5ee84e62e39f
* Grant licenseEvan Chu2012-09-201-0/+50
| | | | | Bug: 7125646 Change-Id: If700eb3cdd85e9ee08701d2dd8971ce2500a834d
* copyright by The Android Open Source ProjectEvan Chu2012-09-1931-263/+425
| | | | | Bug: 7125646 Change-Id: I4de457f982857be315d65386f431d5eafcd8af02
* Fix locking in PeerToPeer.Martijn Coenen2012-09-184-255/+462
| | | | | | | | | | | | | | | | | | | | The PeerToPeer class had some serious multi-threading issues: - mServers / mClients simultaneously being accessed by different threads - P2pServer / P2pClient objects being deleted while still being used by other threads - Race conditions where we could go to sleep on a condition variable without ever waking up. This fixes most of the issues by: - Properly locking all access to mServers / mClients - Using Android's sp mechanism to do ref counting on P2pServer/P2pClient/NfaConn TODO: - Fix races around the condition variables - those are very hard to hit, but we need them fixed anyway. Bug: 7089048 Change-Id: I08564c65cc40734086e517d6107e31f86c3b6adc
* Integrate NFC Hardware Abstraction Layer.Evan Chu2012-09-185-76/+6
| | | | | Bug: 7123942 Change-Id: I4fa153b80e1af2b00b326370e102f714cde4334b
* Merge "User proper error code during tag reading" into jb-broadcom-nfcMartijn Coenen2012-09-111-1/+1
|\
| * User proper error code during tag readingEvan Chu2012-09-111-1/+1
| | | | | | | | | | | | | | | | When reading a tag and it does not respond to a command, use taglost=1. It causes a TagLostException in the app. Bug: 7047415 Change-Id: I766849991441b82e5ad03d3031bc735fa5f9c27a
* | Merge "Use correct app name for NFA_HciDeregister()" into jb-broadcom-nfcMartijn Coenen2012-09-112-2/+4
|\ \ | |/
| * Use correct app name for NFA_HciDeregister()Evan Chu2012-09-112-2/+4
| | | | | | | | | | | | | | The "app name" parameters must match in HciDregister() and HciRegister() Change-Id: I43010268bb4c0ee7cdc7c1440346a6dedc230a58
* | Fix NFC low-power modes.Evan Chu2012-09-071-11/+24
|/ | | | | | | | | | | At the end of nfcManager_doInitialize(), enter low-power mode. This logic is used after boot and before the user unlocks the screen. If the user does not unlock the screen, the phone stays in low-power mode. Additionally, only power off the chip if discovery is disabled AND the SE is not selected. Change-Id: I2bd2effce34b5dc586ad484c1da2ae86da49f0c1
* Use NFA_DM_DISC_DURATION_POLL from config file.Paul Chaisson2012-09-071-0/+4
| | | | | | | Use the poll duration ("NFA_DM_DISC_DURATION_POLL") from the conf file if one is configured. Change-Id: If17d402cbe8505b096a168640f99b88f7e3b6e48
* Remove old NPP->SNEP redirect code.Martijn Coenen2012-09-062-451/+4
| | | | | | | | | This code was used when Android did not support SNEP natively yet. The current Android behavior is to automatically try SNEP first, then fall back to NPP. Change-Id: Ifb1df3a5439cc1a7b939b4ae1dc70135d9c63a25
* Correct spelling.Evan Chu2012-09-062-4/+4
| | | | Change-Id: Ie747c06a0a5161ad5479f93cbc56e482ed7da33c
* correctly handle P2P congestion eventEvan Chu2012-09-061-10/+15
| | | | | | Correctly handle NFA_P2P_CONGEST_EVT to prevent race condition. Change-Id: If255ade96867d45b2a7cff1cb3d6e4cbc2d883d3
* handle NACK, ACK for Mifare UltralightEvan Chu2012-09-063-1/+59
| | | | | | | | BLTH01652900: During trasceive operation for Mifare Ultralight, handle NACK and ACK responses properly Bug: 7047415 Change-Id: I778a2bbbcd3fff47b0da73ec37d76bf81708d931
* Remove "brcm" in namesEvan Chu2012-09-068-63/+62
| | | | | | BLTH01642677. Remove "brcm" in names. Change-Id: Ic3a08abfeb2808d2a0b01402a76d9864b099ef49
* Upgrade to stack NFA_MI_1.03.36Evan Chu2012-08-312-9/+13
| | | | Change-Id: I79510a45e8a552626f0473000e23d0fc6888ee33
* Create JavaClassConstants.h to store some global namesEvan Chu2012-08-2811-33/+48
| | | | | | Create JavaClassConstants.h to store some global names Change-Id: I918d9e8f6db646f637cddbebbc2c4e5c5495623d
* In SyncEvent class, only unlock mutex onceEvan Chu2012-08-286-96/+110
| | | | | | In SyncEvent class, only unlock mutex once. Change-Id: I0fb797c9e6e8ea793fd38abd72a0c2780a734e95
* During nfcManager_disableDiscovery() go to power-off-sleep mode.Evan Chu2012-08-231-0/+2
| | | | | | | BLTH01634648: During nfcManager_disableDiscovery() go to power-off-sleep mode when secure element is not selected. Change-Id: I85c37fa635a90fdc8c90b5a86fe1d3e091d421d4
* Log NFC controller firmware version.Martijn Coenen2012-08-161-1/+1
| | | | | | ALOGD is now squelched by default. Moved it to ALOGE. Change-Id: I3bb7601e65d01d8d01a95902a0be95c7e1a3426f
* Remove unused functions; correct spellingEvan Chu2012-08-161-79/+2
| | | | | | Remove unused functions; correct spelling Change-Id: I6ecf17f8cf8eeae831ba3fcc0a2eb492332c0cb6
* Remove gJniVersion; add thread-synchronizationEvan Chu2012-08-166-61/+51
| | | | | | Remove gJniVersion. Add thread-synchronization for obtaining a new JNI handle. Change-Id: I23e05c95fd90005f6ef1cac69e1e07f0b9612227
* Reduce compilation warnings in NFC JNI.Evan Chu2012-08-152-2/+3
| | | | Change-Id: Iba0dab66be054ca1b0bc0f477c1107909df65cda
* Remove whitespace from NFC NCI JNI.Evan Chu2012-08-1030-772/+746
| | | | | | | - Logging changes - Upgrade to stack NFA_MI_1.03.33 Change-Id: Iba2af1af49a261de50f79572b478838e2bdc890f
* Support for setting p2p target/initiator modes in NCI.Martijn Coenen2012-08-093-0/+44
| | | | | | | | | | | Allows selectively enabling / disabling p2p modes in the NCI stack. TODO: - Support selecting individual Nfc-F speeds (212/424). - Support disabling initiator Nfc-A / Nfc-F just for NFC-DEP. Change-Id: I55a08bd83640b45e2d8346587031f49213a0860b
* Fix one last user of astl to use stlport instead...Elliott Hughes2012-08-081-2/+5
| | | | | | | | | This wasn't directly referencing libastl, so I didn't find it first time round. A top level rebuild without external/astl caught it. I've since grepped and there are no other projects that pull in the include files without the shared library. Change-Id: I2dd06727098744076a7e115d05a8139029ff977a
* Dump NFC controller firmware version in the logs.Martijn Coenen2012-08-061-2/+20
| | | | Change-Id: I0ff7c460b53f56d7b98e1e27838cfd4243a2b0a0
* Don't route PPSE AIDs to the host by default.Martijn Coenen2012-08-021-2/+0
| | | | | | | | | | In our current model these AIDs should be handled by the EE. Because this routing also activates Nfc-B listen mode, it causes some Beam inter-op issues with PN544-based devices. Change-Id: I865bbf7cdd48a781410ad3742426fa9b05751c70
* Follow-up NFC code drop.Martijn Coenen2012-07-305-141/+91
| | | | | | | From partner, uploaded 07/26/2012; modified to fit in new dhimpl/jni split. Change-Id: I3a8c04ab9427adc1295b7b46ec1308f98a2c2c5e
* NFC: Initial NCI DeviceHost and JNI implementation.Martijn Coenen2012-07-2731-0/+14544
From partner drop at 07/20. Modified to fit into our new JNI/DH split. New build config that builds two targets, Nfc and NfcNci, each with their own dependencies. Product config files have to specify either Nfc or NfcNci in their packages config. Change-Id: I348a3aad7167195ca03baf9636408ab8e4c55fce