History log of /packages/apps/Nfc/src/com/android/nfc/NfcService.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
6e95c4d9dacc38108b0818a5b622d7cdf4f4b1b5 30-Aug-2016 Martijn Coenen <maco@google.com> Don't dispatch tags when NDEF read times out.

If we get a timeout status from the stack, store
that state so we don't dispatch tags with empty
NDEF messages with a read timeout. This was already
done when we timed out while reading NDEF meta-data,
but not the message itself.

Also, don't play sounds during detection at all;
NDEF messages are usually so small that the "start
detect" sound is immediately followed by either a
"success" sound or a "failure" sound; we now only
play a sound if the tag was successfully read and
will be dispatched.

Bug: 31165960
Change-Id: I4738731ad3b265df08a22666e52d801578dd329f
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
1ff09042e0f95cd4adcca60a250a80f1638703ac 12-Aug-2016 Martijn Coenen <maco@google.com> Fix Tron stats reporting.

Fix counter names, as "tron_varz" is automatically
appended. Also, only try to upload stats every four
hours.

Bug: 30424959
Change-Id: I1b168467888e1d5d6e7bc478ccc833c498292108
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
2603a23b04792ffb771ab5e8c32d767af47883f7 09-Aug-2016 Martijn Coenen <maco@google.com> Allow for ignore() to work with random UID tags.

By also verifying the NDEF message has changed.

Bug: 30201458
Change-Id: I7349d3d26c63b993ec07ce0c5c55a61a3a396f6e
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
ffca56f1d7b1f84b3ea555d1419813c0d9de56ac 28-Jul-2016 Martijn Coenen <maco@google.com> Tron Metrics for Tag/P2P/HCE.

Bug: 30424959
Change-Id: I00c4e5d7429ba3e741d96d66c40a4bfb346e17b2
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
bc7e1cc4811b33f08ed41ec97e7042d6a93e0b4d 21-Jun-2016 Martijn Coenen <maco@google.com> Allow system_server access to NFC reader mode API.

Bug: 29451566
Change-Id: I26b0a2e9b33854efd59b95ab230a6db3042f93c7
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
33eda9fbec3532d27bed6c87041c3781c32d1003 23-May-2016 Martijn Coenen <maco@google.com> Verify setForegroundDispatch caller is in foreground.

Bug: 28300969
Change-Id: Icadfe70cd06f921badd266e7a4efbae15a8c206a
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
0634b25a05b6c572f2f53ba011de28e75f1063a9 14-Apr-2016 Martijn Coenen <maco@google.com> Fix API review comments, add remove callback.

Bug: 28148561
Bug: 26426491
Change-Id: I82007581426b1701d32470bb6ebc00f8e12f4d52
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
f0894642530ea128642ba50cf3cbaf778728cae0 11-Apr-2016 Martijn Coenen <maco@google.com> Only add service when object is complete initialized.

Bug: 27857203
Change-Id: I18b37b7bb3423c6abe5d0831c69ec34be68840d7
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
d07906fe33dfe2a0da05cc8e7bf4bfbfcb17906b 29-Mar-2016 Martijn Coenen <maco@google.com> Don't disable NFC in airplane mode.

Bug: 22985639
Change-Id: I78c351b335c779fb0c8361509d57a8d5fa6bed63
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
b2926485375d730aa7d373e8f1da8b1f371847fc 26-Feb-2016 Martijn Coenen <maco@google.com> Fix references to obsolete Settings.System

Bug: 23532907
Change-Id: I1b420fa02cdbde90e248b35f61507f9cc786d1f5
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
955cd77202d37cd9e4fb15d4c77151bf496e5607 25-Jan-2016 Martijn Coenen <maco@google.com> resolve merge conflicts of ab0586a700 to master.

Change-Id: I8f8eb4348588e68dafe9f3082271b97ecec9fdb9
ecb8d7bbd1a44cd3edbcb6c5d903fc8d9a625d70 22-Jan-2016 Yoshinobu Ito <Yoshinobu.Ito@jp.sony.com> Implementation of HCE for NFC-F.

This impementation includes HCE(Host-based Card Emulation) for NFC-F
which emulates NFC Forum Type 3 Tag on a smartphone.

Signed-off-by: Daisuke Ito <DaisukeE.Ito@jp.sony.com>
Yoshinobu Ito <Yoshinobu.Ito@jp.sony.com>

Change-Id: I1618a7fba801e0705ff3cc078206a1446b3dd56d
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
5673ed9a219424c020d07fefcb92cb4cfb676057 18-Jan-2016 Martijn Coenen <maco@google.com> Implement API for "debouncing" NFC tags.

Bug: 26426491
Change-Id: I33207fd01dfdd4595c421d6b208867ae96fed586
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
39f28d05cc65a3b44c8e0fed45b4670de0a3b1ba 06-Jan-2016 Jeff Sharkey <jsharkey@android.com> Follow PackageManager refactoring.

Change-Id: I26fc67827d47ab4801ca1aae65de26ec3329d727
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
a14098bcfb57b0a0bb5cf51c181d7ebc681bfa11 19-Oct-2015 Martijn Coenen <maco@google.com> am 3f73df83: am 3f3788f0: am f08a81c4: Merge "Don\'t enable reader mode when NFC is disabled." into mnc-dr-dev am: 4aa62e3910

* commit '3f73df835bf03575e0343564feec185d06406d6f':
Don't enable reader mode when NFC is disabled.
eee16964e9db2f60863de63d75dde41bbed4aed3 19-Oct-2015 Martijn Coenen <maco@google.com> Don't enable reader mode when NFC is disabled.

Bug: 24426328
Change-Id: I70ea074cb3346c991b4402676cef5729c2b911a3
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
64716fb7e891af2ccd3ba65b2f551ecf1e4d8855 13-Oct-2015 Xiaohui Chen <xiaohuic@google.com> cleanup USER_OWNER in Nfc

Change-Id: Ib5632b08a20e215162819f5946786cc1d7dc31db
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
2daeeee63456a515693980372908234e1fa14ba5 15-Apr-2015 Martijn Coenen <maco@google.com> Expose peer LLCP version to apps.

Change-Id: Id5ea699a8508b5bdf44c0bae2d38893e2c42241a
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
229c7e6cbc07db2b3718403776b68a09d807ebb9 07-Apr-2015 Mathias Jeppsson <mathias.jeppsson@sonymobile.com> Add missing @Override

Change-Id: I4366238e21b27145d064e2323497ce0083538f03
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
616980fe53b2595f6320d344a6b8ebb0e898485e 04-Dec-2014 Andres Morales <anmorales@google.com> Remove B' polling for B tags

Bug: 18613259
Change-Id: Ic5b19e7953250647dc9cf7802dd04815a80a1141
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
8a80bc7b9b873290a57b938eaa01a3156d0de861 20-Nov-2014 Andres Morales <anmorales@google.com> Merge "Prevent Beam at the lockscreen and during provisioning" into lmp-mr1-dev
14ca22641d7fa624eebdc68554bf2612f2682791 20-Nov-2014 Martijn Coenen <maco@google.com> Merge "Add verifyNfcPermission()." into lmp-mr1-dev
31b0f4653686119d74876cae5d637c5baf52b935 12-Nov-2014 Andres Morales <anmorales@google.com> Prevent Beam at the lockscreen and during provisioning

Since we can poll at the lockscreen not for unlock
tags, need to explicitly disable Beam.

Also since we allow peripheral handover during provisioning,
we started allowing Beam as well. Blocking that.

Bug: 18349433
Change-Id: I987f43228d2c003c66201d2e91bd9bdfebd49d78
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
d5c1305a0bc29f69d77b513b3c9ec7da25b327b7 19-Nov-2014 Martijn Coenen <maco@google.com> Merge "Restrict RF Field events to preferred app." into lmp-mr1-dev
5d0258c45b65f1051add13d35ff6adc7b6e67697 14-Nov-2014 Martijn Coenen <maco@google.com> Add verifyNfcPermission().

Bug: 18358968
Change-Id: I5d0e705fa115cef25653aa198b65f0c805e2553c
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
b82d80d891077ccd74729e4143925a66eb89eef2 24-Oct-2014 Andres Morales <anmorales@google.com> Refactor Beam to work with managed profiles

Simplify logic and break out different components
into their own services.

Allow BeamShareData to pass a UserHandle in order
to start the transfer in the correct user.

Bug: 17966846
Change-Id: I012a9ebe87deca6fceb857da8c8d4e2ecbeca6fe
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
d943597d17fb8aa462b119040334478756f9e2f9 13-Nov-2014 Martijn Coenen <maco@google.com> Restrict RF Field events to preferred app.

If any of the packages in nfcee_extras.xml
is preferred (either tap&pay or foreground),
only that app will get RF field events. Otherwise,
all apps in nfcee_extras will get the events.

Long term solution will be to reduce reliance
on RF field events (which doesn't scale), and instead
tie this to AID selection.

Bug: 18358874
Change-Id: I29276b8929f48b8ca33d61c4120a7405c0ab4dcf
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
eebaf6f543d8b8983b2b0dce29812d2d2329424f 28-Oct-2014 Benjamin Franz <bfranz@google.com> Merge "Deactivate Beam when DISALLOW_OUTGOING_BEAM is set." into lmp-mr1-dev
b708f80d56ba6d6ed110b9b7d1008563689821a4 16-Oct-2014 Benjamin Franz <bfranz@google.com> Deactivate Beam when DISALLOW_OUTGOING_BEAM is set.

Bug: 18008824
Change-Id: I25b64f0de6e62a94ba59b3ff6ea40c14da25ca90
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
65860bb589c5802ffadb14540670408d6c8dfaa9 15-Oct-2014 Benjamin Franz <bfranz@google.com> Reactivate Beam sharing for managed profiles.

Bug: 17916693
Change-Id: I41f2a0e45378365a0ef7c042067c85d234b1a00b
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
dbcee970ef57927e73c269f573d06e2f133a34c1 17-Sep-2014 Martijn Coenen <maco@google.com> Prefix registration fixes.

- If only one service for a prefix exists, make it default,
even if it's not the default app.
- Upper-case all incoming AIDs.
- Add @Override and missing break statements.

Bug: 16517161
Change-Id: I3e93ef740b39ae7c32ef6708df647f23f7a5b8bf
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
e276d3323d755d8bdaccd59a551332c064970215 15-Sep-2014 Andres Morales <anmorales@google.com> Fix build

typo after doing a rebase

Change-Id: If13cc4c1ab5f66f66b51dc8e464b35f6bb30239c
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
42c0f35783e2849de525cdbe743c95c197fdcf50 09-Sep-2014 Andres Morales <anmorales@google.com> Pause polling while pairing to peripheral.

Attempt at working around the NFC KB resetting itself
due to NFC discovery.

This prevents the tag from being picked up repeated times.
However, since it re-enables polling once it's done, it will
definitely end up disconnecting the KB if the device remains on it
after pairing has ended. This is because tapping an NFC handover
sticker for a paired device disconnects the device.

Leaving a timeout after paring succeeds before re-enabling
polling as a hacky bandaid solution.

Bug: 17401266
Change-Id: I981a4b2ad7ebf99ba8aa5106cc44f8ac7d899132
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
4db692d187951b1e9b92d5609509ad2fb85b8fa5 11-Sep-2014 Andres Morales <anmorales@google.com> Merge "Don't allow Beam for devices with DISALLOW_OUTGOING_BEAM" into lmp-dev
4fe7c276d3404559e97982a0a4e1ebf4bac815c6 10-Sep-2014 Martijn Coenen <maco@google.com> Merge "Reinstate RF field events." into lmp-dev
b42756d47f39774a07654f68af27bf3cc2c41511 04-Sep-2014 Andres Morales <anmorales@google.com> Don't allow Beam for devices with DISALLOW_OUTGOING_BEAM

Bug:17387303
Change-Id: Idb892839627315d08f010a705506d8668d8eb5dc
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
c19c065b6d0e1a088780c4dca27a1404d5926765 09-Sep-2014 Martijn Coenen <maco@google.com> Reinstate RF field events.

These are generic enough to maintain in AOSP,
and can still be protected by nfcee_access.xml
like they used to be.

Bug: 16653617
Change-Id: Id604fcc45d4263b24fea2f16ca6a24e25f8580c3
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
cf76dfbf36ab621b9372527ddc8ca605e00d7784 05-Sep-2014 Andres Morales <anmorales@google.com> Allow BLE keyboard to be paired via NFC in SW

Bug:17397066
Change-Id: Id8a51e1c8285b263b74dce72c11b79b9f196a957
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
bdd6b46cf24eb1da94262d4d1637d9c6fcf7bcd9 27-Aug-2014 Andres Morales <anmorales@google.com> Merge "Remove "woosh" SOUND_START on lockscreen" into lmp-dev
8c5388958a276c5934a5d31c4f413ba15d89e893 27-Aug-2014 Andres Morales <anmorales@google.com> Merge "Disable Beam for managed profiles" into lmp-dev
5c452dad7b24f28223414ce5e953bfcab782570e 21-Aug-2014 Andres Morales <anmorales@google.com> Disable Beam for managed profiles

Bug:17009804
Change-Id: I57e82216f8d54bc71b318c648c045378ccdbf5bb
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
3e8b9a06407baa7c17e6f4c6bac20e0a3deaef31 21-Aug-2014 Andres Morales <anmorales@google.com> Remove "woosh" SOUND_START on lockscreen

Bug: 17178281
Change-Id: I76f010e66fa43d15ddbdc551d99e4bf3ab20f7b7
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
731fd8a52cec0dbe8d6ec6a4c7aa36ff52812112 19-Aug-2014 Andres Morales <anmorales@google.com> Remove old NFC unlock API

Bug: 16401635
Change-Id: I7ada54d46993aa381a89652e6d3eee77a42744c2
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
af05d4f78bca45a13f54444a67c1da09bdd599a3 15-Aug-2014 Andres Morales <anmorales@google.com> Fix bug where unlock handlers are not properly removed

Previously thought the casted INfcUnlockHandler
would be equivalent to the IBinder instance but
that was not the case.

Bug: 17054331
Change-Id: I6c441659b6e2b05e76495aa5d1d903e4159beec6
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
32cdfbf250f2611bb7624c13cfd7d111a847676e 12-Aug-2014 Andres Morales <anmorales@google.com> Don't play success sound after NFC unlock

Bug: 16896337
Change-Id: I846b17a0a89cd27e56163240655ac3d79c0cb5f7
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
34cfff42771acf6d889dd0e5fedc2c2313d9784a 04-Aug-2014 Andres Morales <anmorales@google.com> Only allow NDEF dispatch at lockscreen

Also add logging of lockscreen poll mask for debugging

Bug: 16547456
Change-Id: Ia6ba345d7d0bcd4ea108e32bcdfa86e87a574721
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
16ee2fe0e0f6d2f811bd06c37cbd53c8b395e6d6 23-Jul-2014 Andres Morales <anmorales@google.com> NFC Unlock api changes

Add NfcUnlockHandler interface

Bug: 16401635
Change-Id: I6c31c67771c1b74d7100df56fa4d253f171a17a2
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
f5c979220fadb2c3ac0bca09e16d0d281ed20eb2 25-Jul-2014 Martijn Coenen <maco@google.com> Support for configuring SE listen technologies.

If the config file specified an SE to use, configure
its listen technologies correctly.

Also, fix commitRouting() to actually commit the
configuration.

Bug: 16517161
Change-Id: I1283fcb3f855c89a8b238be857bd56f06a14138f
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
d4da55b9d4203ceff9d6747988a7b6a57dbde258 23-Jul-2014 Martijn Coenen <maco@google.com> Merge "Don't show Beam in share menu if turned off." into lmp-dev
a7a09dbc3e681de3054d61b544753cbb8406c649 21-Jul-2014 Martijn Coenen <maco@google.com> Don't show Beam in share menu if turned off.

Bug: 16381088
Change-Id: I4a52f1a2c8f1510816390e1dfe770a629c0ea045
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
ffeeef8e8d6d5f7c15f9f041d691cd9b64ddc58b 21-Jul-2014 Martijn Coenen <maco@google.com> Don't restart discovery if NFC was turned off.

disableInternal() didn't update the discovery state,
so when NFC was power cycled, it would try to restart
discovery instead of starting from scratch.

Also get rid of mDiscoveryEnabled, its state was already
captured in mCurrentDiscoveryParameters.

Bug: 16285426
Change-Id: If3d36dca3566993dc852abb233a1041cc1aff124
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
4a3b0d475942690861d41e7d3ef88efd59335bcd 02-Jul-2014 Martijn Coenen <maco@google.com> Merge "Fix invoking Beam from share menu for multi-user."
34322b73c1e09907cb007e86bae77c744b338cd7 01-Jul-2014 Martijn Coenen <maco@google.com> Fix invoking Beam from share menu for multi-user.

Don't call into NfcService from Binder, but instead
through a newly added IPC call.

Also, get rid of deprecated ActivityManager calls
to determine foreground task, and use new
ForegroundUtils for that instead,

Bug: 15939863

Change-Id: If5a4b64de337abc36b1f1df30b4f612946e8496f
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
304a6342ee7e5620d3b50d988755c035f1686dc2 28-Jun-2014 Martijn Coenen <maco@google.com> Don't conditionally enable snooze.

We keep our devices in snooze by default now.

Change-Id: Ia84635031d60221da054448b8c81c5c48f1f821d
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
0799bcbe2469aa6a88c6cbdf0cdee5b50e1994f0 18-Dec-2013 Andres Morales <anmorales@google.com> Refactoring NfcService routing logic.

Currently, routing logic contains a lot of nested conditionals
and causes unnecessary work to occur, particularly in enabling
reader mode. This CL moves this logic to a state object that contains
all necessary information to transfer from one routing state to another,
leading to fewer calls to the NFCC, eliminating duplicate work, and
making the code more readable.

Change-Id: I6a8758e61cc0cbb015d618575da35386eadf7d3a
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
a30388eb7ddeabe1c9b85d49a65b82aac6a845ca 12-Apr-2014 Andres Morales <anmorales@google.com> Fix duplicate tag dispatch after NFC triggered unlock

Since we allowed the tag to continue dispatch after unlock
as well as reenable discovery when the phone is unlocked
the tag used for unlock gets processed twice.

This patch adds logic to ensure the tag gets processed only
once.

Change-Id: Ie42bffb5ec302b68013e6bf1c1104db01e96e79f
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
28a49f0de26c4cc6f0b8c30dc67bebcb1a3110b6 20-May-2014 Andres Morales <anmorales@google.com> Adding NFC Trustlet

Exposing calls to register a lockscreen dispatch service.

Change-Id: I7feaeef3b6b9abd090d8c5e905c32ec7bff8063a
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
2a4a7a41a817932569d2052116b8a8c2e5a368f5 29-May-2014 Martijn Coenen <maco@google.com> am 8069265a: Initialize polling mode correctly.

* commit '8069265a99f0bf35bc305254cdf8eebf91708395':
Initialize polling mode correctly.
8069265a99f0bf35bc305254cdf8eebf91708395 28-May-2014 Martijn Coenen <maco@google.com> Initialize polling mode correctly.

Bug: 15259858
Change-Id: I154fcdc05d2a110038d677c6b6da00a30e1c51b3
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
f354330f2dfbc3baddea2b9162bebd8df8573fd5 23-May-2014 Martijn Coenen <maco@google.com> Merge "Goodbye secure element."
766d24ccb639ed3bf23f7fe918290df6d372e611 20-May-2014 Andres Morales <anmorales@google.com> Reverting NFC Unlock from Nfc application.

Will be re-added through TrustAgent.

Change-Id: Ic5c6c19a5c9227476af5b85eab64b1d7c7ad9cc4
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
c8768e4b2ab114d227bd8af441d81525837f78cb 25-Mar-2014 Martijn Coenen <maco@google.com> Goodbye secure element.

I really liked you,
but everybody else wanted you too.
Maybe some day you'll be back,
connected to the host CPU.

Change-Id: If78bce7c7178a77919b8b1b64334909f4ff7e037
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
35b004b876ba3d10a8f204beeaa282289ad9b13b 24-Apr-2014 Martijn Coenen <maco@google.com> Fix NPE in case device doesn't support HCE.

Bug: 14294802
Change-Id: Ib17e13a51f29b87a74bb8015cad7d21fbe611ceb
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
af3e301d7820bc0a2447db8af16ab5335e6bd520 10-Apr-2014 Martijn Coenen <maco@google.com> Support for dynamic AID registration.

Change-Id: Iac786c395e2f46e54f74e6c643cd0b9414af333b
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
9340b42304a512cb8fe9f4c068ba1b908876fb10 07-Jan-2014 Martijn Coenen <maco@google.com> Android Beam direct invoke / share menu invoking.

This change allows Android Beam to be invoked
directly from an application.

Additionally, it adds handling for the ACTION_SEND
intent that is launched by various apps when using the
share menu. This will cause Android Beam to be shown
as an option in share menus. There's some logic needed
that translates the data in an ACTION_SEND intent to
either NDEF message or an Uri that can be shared using
handover.

Finally, the Beam UI code has been modified to instantiate
a proper window, in order for us to catch the back key
event to be able to back out of the Beam animation
(this wasn't possible previously).

Bug: 5134061
Change-Id: I9cbfc50109bb497973bae177c67d920f6f990789
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
a1e95d30dbe8dad0a8bb333b4ca17c009fc34e2f 04-Feb-2014 Andres Morales <anmorales@google.com> Revert "Refactoring NfcService routing logic."

This reverts commit 80e61a46c0541471ef01a9d3c91570139336bcff.

Change-Id: I0b4fc471a3dae22c4d732b1c002f51a412c2c121
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
80e61a46c0541471ef01a9d3c91570139336bcff 18-Dec-2013 Andres Morales <anmorales@google.com> Refactoring NfcService routing logic.

Currently, routing logic contains a lot of nested conditionals
and causes unnecessary work to occur, particularly in enabling
reader mode. This CL moves this logic to a state object that contains
all necessary information to transfer from one routing state to another,
leading to fewer calls to the NFCC, eliminating duplicate work, and
making the code more readable.

Change-Id: I4c451cb96ed27954fe2e6e7e7704643f3f3456a6
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
d2604c0544f7bc26e5b2407f0215cccfffedae2c 11-Dec-2013 Andres Morales <anmorales@google.com> Expose snooze mode config and polling modes in java layer

Change-Id: I3a604fb4260a1e99e6aa40189e999996d5947ed4
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
4309f9c7c0097bdd95cf791eef78700b106dec21 15-Nov-2013 Andres Morales <anmorales@google.com> Add NFC unlock to NFC Service

Change-Id: Ie065742a6f2ffe8ddcfe141a56bea16b40486124

Fix imports

Change-Id: I389d8ecba447d1eb0bd15a74709dc6c7eae99a2c
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
341b2c02da8b4d2a681f3fbcc5657921ad421e32 07-Oct-2013 Martijn Coenen <maco@google.com> Disable HCE debug logging.

But add some code to dump information about the
HCE service/AID cache in bugreports.

Bug: 11142134
Change-Id: I7387748bcf93e92ab2f25bc307941cdeccaca4ef
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
43dc7d3d2160c5fbd063e27c2810b87f4626e75f 07-Oct-2013 Martijn Coenen <maco@google.com> Fix NPE in NfcService.

Bug: 11104960
Change-Id: Ie068d2bbbed92165abd6afc685727c9fc4aabd12
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
efb7a3df560585994cebd40fcf5ffbc864f8c358 01-Oct-2013 Martijn Coenen <maco@google.com> Make CardEmulation APIs work even if NFC is off.

Previously we wouldn't index HCE services at all
if NFC was off. This created some weird dependency
that apps would have to check whether NFC was enabled
before being able to trust the APIs, and that could
result in tricky race conditions as well.

Bug: 11023618
Change-Id: I3cbcfcf43fe26d0d878fac75ece51c9e81f7220d
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
06645f1a5dc19e01f61895797f7b4c2204ae7b62 27-Sep-2013 Martijn Coenen <maco@google.com> HCE: invalidate cache if passed in service unknown.

To fix a specific scenario where a service is enabled
using PackageManager.setComponentEnabledSetting(): in this
case, the ACTION_PACKAGE_CHANGED broadcast is delayed by
10 seconds, causing NfcService not to know about enabled
services until then.

This in turn could cause our "isDefault" APIs to return
incorrect results in the first 10 seconds after changing
the component state, because we do not know about the
newly enabled service yet.

Fix by invalidating the cache if we don't know about a
service passed in from API calls.

Bug: 10633674
Change-Id: I4c236002afc79464e0b41f3c6919541915020ba4
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
f9366de7b3ad1ce90859d4194dacf13c0066926b 18-Sep-2013 Martijn Coenen <maco@google.com> Reject invalid AIDs.

Also, notify currently active service if an AID
has been selected on an off-host secure selement.
Clean up some TODO items as well.

Bug: 10817001
Change-Id: Ia6c0bb746d88add94464ed8c4339aa4aaf9d6c35
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
3dd24ecefb71ce4f585faa002ba1054a0c6dbd06 04-Sep-2013 Martijn Coenen <maco@google.com> Implement reader mode API for NXP chipsets.

Bug: 10360259
Change-Id: I1339840ed900b73d3f9ae43e1a01b59c7e679f9e
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
31f39aee25964dad1038b7a9cc335d5a386113c8 03-Sep-2013 Martijn Coenen <maco@google.com> Changes for callback model of reader mode APIs.

Bug: 10360259
Change-Id: I41c47ce84aa18bce01f6fb1ebe280fac0ed79070
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
f5cd84c3a7ffb66196ab3c0745569da937d7533b 30-Aug-2013 Martijn Coenen <maco@google.com> Upgrade to new API changes.

Following API review. Also:
- Added support for pause/resume P2P in reader mode
- Fixed bug where we tried to route even when NFC was off,
causing lockups.

Bug: 10550349
Bug: 10552589
-

Change-Id: I48f6834386bd542bdf1b7f1a8b1072d8981b0915
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
451ba48faa87d78bfbec0597ff06af1747cf6acb 29-Aug-2013 Martijn Coenen <maco@google.com> HCE: API updates, default handling, lock-screen.

- Use new selection mode APIs
- Fixed up default handling
- Check if service requires device unlock before dispatching
- Fixed isDefaultServiceForAid()
- Fixed a bug where we created two routing managers

Change-Id: Iba4a3ce7f599974ccedbf8d301cc46ff1e99c94e
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
c4e4277a71c70e96198cb760676ad3b40f9e0e3d 27-Aug-2013 Martijn Coenen <maco@google.com> Implement reader mode APIs.

Disable p2p/listen modes on request. Currently only
for NCI platforms, NXP will follow later.

Also, fixed some compiler warnings and a mem leak.

Bug: 10360259
Change-Id: Id13db24914adc43db62e055b66e0989e9cde2482
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
78976de08ad5d5f9d5fcba28f3ea82350907a782 15-Aug-2013 Martijn Coenen <maco@google.com> HCE UX: Display dialog on service failure indication.

Also:
- Refactor AID handling to separate class.
- Implement unHandled() call from service.
- Verify the service's identify by checking replyTo param
- Return 6F00 in case we can't parse an APDU for whatever reason.

Bug: 10262585
Change-Id: I1a3ccb9ae57107d68cf5923c3cf05bd224f93e4e
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
4358172f18871d58d5bc2050e4d9d0bf9bc2d5e5 10-Aug-2013 Martijn Coenen <maco@google.com> HCE: dialog when default app is removed

Plus some other stuff:
- Fix locking in AidRoutingManager
- Simplify default handling

Change-Id: I46ed2e645cdef9c2778ac7ae263f698391e3e22b
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
89c893312d524f50c47b0d32071f3de8631197f3 08-Aug-2013 Martijn Coenen <maco@google.com> HCE: permissions, OffHost services, payment service.

- Added permission and userId checks for all new
incoming binder calls.
- Started enumerating OffHostApduServies correctly,
dealing with the routing as we go.
- Fixed up HostEmulationManager logic to work with the
correct service; check if service is already bound.
- Persistently bind to payment service if one has been
selected as default by the user.
- Return 6A82 for AIDs that are not found.

Change-Id: I7b8121bec54b815d94b49747bc4f2bb00de26b36
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
62372fdecd77cc07db475e79e366e6864b44b956 07-Aug-2013 Martijn Coenen <maco@google.com> Invalidate HCE service cache upon user switch.

Change-Id: I022c15485798b164c6278e2abc9407da5d101e50
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
75f63db568f953e935e62cb3046d167b881979c8 07-Aug-2013 Martijn Coenen <maco@google.com> HCE: 1-time tap overrides, chooser/tap again.

- Added two dialogs for dealing with app selection
and asking the user to "Tap Again" once an app
has been selected.
- Logic for dealing with 1-time tap overrides and
defaults.

UX still to be finalized.

Change-Id: I10f9fed6ef8aa6255a88f6a518af9875068ddac4
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
a0b908c58b5ab0d242ccc545d14573901774bd29 31-Jul-2013 Martijn Coenen <maco@google.com> More HCE work.

- Factor our helper class containing information about
(Off)HostApduServices to ApduServiceInfo.
- New BIND_NFC_SERVICE permission to protect implementing
services from other apps binding.
- Implement INfcCardEmulationService interface from
the framework APIs.
- Observe changes in settings for default apps in a
category.
- Single algorithm that resolves AIDs to a list of eligible
services, taking into account defaults as well. Result of
that algorithm feeds directly into the routing decisions.
- Removed old persisting code, everything is in Settings.Secure now.

Change-Id: I1840710f19435b079d20a4a41642b79fd03d1c76
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
953c3dd151419d497205246d4bfa8a818d39d00a 25-Jul-2013 Martijn Coenen <maco@google.com> Fix NPE on turning off NFC.

Bug: 9998605
Change-Id: Iccc85ade4354308e34ef78250e0cad2ca18bafb3
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
a56a84a384db51809101e149d83bf41b5e198ca0 23-Jul-2013 Martijn Coenen <maco@google.com> HCE: Update XML grammar to reflect framework.

Also, keep sending SE broadcasts for now.

Change-Id: Ic960066f2374e7ecba1df89468dfc35f97d3ce2c
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
0a9487f8aad77ed5f1a8f142b690396446858247 23-Jul-2013 Martijn Coenen <maco@google.com> HCE: stop sending SE broadcasts on HCE-capable devices.

Change-Id: I5ac57adf20f09f97f18e8514167c6677cab8ff81
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
6493859b424f65af79e3e13835f7dfed38495c00 20-Jul-2013 Martijn Coenen <maco@google.com> HCE: use new platform APIs.

The service interface is now defined in the platform.

Change-Id: I6dbffed4d8185f437880912179f69b91e1a51cd9
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
d53c2b599c73f7404b5a604be4d9a5449cafdd72 16-Jul-2013 Martijn Coenen <maco@google.com> HCE: Support dynamic routing changes.

- Routing table will now be dynamically updated as
HCE services are installed/removed/modified
- Layering and arch:
- RegisteredAidCache knows about which services want
which AIDs, and on what route.
- AidRoutingManager maintains the current state of the
AID routing table in the NFCC.
- HostEmulationManager is responsible for incoming
HCE transactions and resolving them to the correct
service.
- Fixed various bugs

Change-Id: I16327dfca96a9bd3fb5633c2e6b4247fe35ab8d6
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
9f8f6cf9c58405ecafe2d425801e6c14088db8c7 30-Apr-2013 Martijn Coenen <maco@google.com> Host-based card emulation.

Initial check-in that allows to build basic HCE apps:
- Introduced new RoutingManager, taking care of programming
the routing table to the NFCC.
- Added DeviceHost interfaces for adding/removing aids to
the routing table, and sending raw frames.
- On devices that have an eSE, the eSE is the default route.
- Removed routing code from SecureElement class.
- HostEmulationManager resolves and dispatches AIDs
routed to the host to an application service.
- Simple Messenger service interface for exchanging APDUs.
- RegisteredAidCache keeps a cache of AIDs that are registered
by Android applications, as well as their route.

TODO:
- Dynamic registration of AIDs.
- Dynamic updates of the routing table.
- AID conflict resolution.
- Allow apps to indicate AIDs present "off-host".
- Implement base-class HCE service in framework.
- Switch default route to host.

Change-Id: I7d7643770fcc848699810ec5443d0d9b81d85669
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
2b4dc11f4508cdb662a8069cccf9f2273004a4c8 31-May-2013 Martijn Coenen <maco@google.com> Check for proper SE open return values on wipe.

Bug: 9227578
Change-Id: Iff9e9512ac4d8e25a287ce40fba7c2717b4419fa
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
96e8f30552ad5b420cc89b97ffdc486962701afa 21-May-2013 Martijn Coenen <maco@google.com> Broadcast LLCP events in debug builds.

Bug: 8839848
Change-Id: I01a18b3409da66ab1394c2c196a06a8749b9c72c
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
476ee8a64404b7ee042ba1a70400bcb1dd5ace10 26-Apr-2013 Martijn Coenen <maco@google.com> Fix more race conditions.

In the old NXP JNI:
- We can be in the process of discovering a tag/p2p target
when we try to configure discovery. In case ConfigureDiscovery
returns BUSY, don't immediately call abort(), but retry a few
times.
- Completely disable Tag/P2P discovery *before* opening a pipe
to the SMX. This avoids nasty races with opening the SMX
while a P2P/Tag device enters the field.

Bug: 8552749
Change-Id: I433a40c918373c661abda3bc40dd36db7b233245
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
7a499e775021bafefbe890d079e2a43f4a54482c 24-Apr-2013 Martijn Coenen <maco@google.com> Avoid P2P/SMX race conditions in NXP stack.

Google Wallet can trigger off field P2P field events
and initiate communication with the SMX. The NXP stack
appears to contain some tricky race conditions around
opening/closing the SMX close to P2P interactions. For now,
do not allow NFCEE access while a P2P link is still active.

Bug: 8552749
Change-Id: I7acae39bc22cebb5d79a484990dcd3fc5f3dad23
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
3e38dca2bc7c7629d7159663d597a1e886d85527 19-Apr-2013 Martijn Coenen <maco@google.com> Don't close the NFC-EE pipe immediately on disable.

The combination of an outstanding APDU request together
with a "warm-reset" HCI command that we send on NFC disable
sometimes cause a complete NFC controller lockup (depending
on the order and timing).

To prevent this, delay closing the NFC-EE pipe for a while on
NFC disable to give processes a chance to finish their outstanding
APDU request.

Bug: 8660403
Change-Id: I40d5f33fc41453aa3592a50721b8bef793e0af5d
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
89baa7140bbc7899e8c2735bcfd69021a1240487 09-Apr-2013 Martijn Coenen <maco@google.com> Improve Kovio reading reliability.

NfcBarcode tags such as Kovio are only activated very briefly,
just to spit out the uid. Consequent NDEF and reconnect() calls
by the NfcService will often fail, causing the tag to not be
reported properly to the upper layers.

For now, don't perform NDEF checking on these tags, and just
dispatch them when we see them.

Bug: 8576348
Change-Id: If011f6e99d85a61d19d9cea15719fab90cffad43
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
57a44d07a3de327e8cdbbcd622118aa517313dbe 28-Mar-2013 Martijn Coenen <maco@google.com> Deal with pre-MR2 PN544 NXP stack LLCP bugs.

In MR2 we started connecting LLCP on link
activation instead of when the send was confirmed. Pre-MR2
NXP-stack devices have a bug that causes them to only
send the first SYMM after 750 ms (in case they are the
initiator). There is another bug that causes that same stack
to crash if two threads try to send a packet at the same
time.

Unfortunately, this combination of factors creates the
following race:

1) pre-MR2 PN544-initiator initiates p2p link with MR2 device
2) pre-MR2 PN544-initiator starts Touch to Beam animation
3) pre-MR2 PN544 doesn't have data to send, but delays SYMM for 750ms
4) MR2 device finally gets SYMM after 750ms, and sends CONNECT PDU
5) pre-MR2 PN544-initiator device responds to CONNECT PDU with CC on Thread 1
6) Within a ~50 ms window, the user on the pre-MR2 PN544-initiator touches
the screen to confirm the send. This causes Thread 2 to try to send
something, which fails.

As a result, the Beam transaction fails. Unfortunately
this is quite easy to reproduce, since the Beam animation takes
about 750ms, just the same amount of time it takes for the SYMM
to get sent.

To prevent such a race condition, we should make sure that we do
not create multi-threaded access on the remote device. The best way
to do that is to not connect the LLCP services automatically when
talking to a pre-MR2 PN544-initiator.

Long story short, when we don't receive a first packet of data
after 200 ms, we consider the remote device to be a buggy
implementation, and delay the connect until the time the user
decides to send something (in which case it's fine - it's unlikely
the user at the other side tries to send something at exactly the
same time).

Also fixed RF field notifications to be more robust; whenever
p2p is activated, we disable field events, and always treat the
field as being on.

Bug: 8508568
Change-Id: I41b427afb24c7f8d228adc91d258cca553539588
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
7d8987f233985a5ff29226890e11012275d325f5 07-Mar-2013 Martijn Coenen <maco@google.com> Allow incoming provisioning intents while in setup wizard.

When the device is in setup wizard, the keyguard state
registers as locked, hence in this state NFC was not
enabled.

This change adds some resource settings to enable
NFC in setup wizard, and allow a set of mime-types
to be received while in that mode.

Bug: 8275527
Change-Id: Iab6cd8438fa77764b0cc9c96cbf1a36e95d79524
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
c3981b9a0b39faed474480bc3dbd3e33bbd50b99 11-Feb-2013 Martijn Coenen <maco@google.com> Return more accurate errors for NfcEe.open.

There are a number of different conditions under
which access to the SE is not possible. Since some
of these require user intervention to resolve (ie
external field present), return a more accurate
reason for NfcEe.open failure.

Bug: 4304698
Change-Id: Ie947c29be12d554a02d9246264a9f0e026a37af8
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
3859c5cccb202c20882fb3887cfa87babb1d85a3 08-Jan-2013 Martijn Coenen <maco@google.com> Enforce foreground NDEF push.

Store the calling UID along with the NDEF callback,
to make sure the registered callback is running in
the foreground.

Bug: 5199662
Change-Id: Ia6eb4457309445909629878f3371805a503fc82f
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
a1af766ba0b1fc5a016b796f76c29f56519dec15 14-Dec-2012 The Android Open Source Project <initial-contribution@android.com> Snapshot 81cfc41a448a57d0b3e16b817dc074e91ae94188

Change-Id: Ia1661589783f7d51557ff902c3260c341958c310
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
525c260303268a83da4c3413b953d13c9084e834 14-Dec-2012 The Android Open Source Project <initial-contribution@android.com> Snapshot 1a6bcf3cca90fedfbad33c1cdd6d05af5774fc01

Change-Id: I3ccb25bf7cde2c22f52260cae0e9957517e6bb5f
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
4bbd47e5507d4c47a4d722216606307e45195a0a 25-Jul-2012 Martijn Coenen <maco@google.com> Move NXP JNI and DeviceHost implementation into separate dir.

Preparation for the new NCI stack. The idea is to
build either the NXP or the NCI stack, triggered
by a makefile switch. To that end, move the
DeviceHost and JNI implementations in their own
directory, so we can build them only if needed.

Change-Id: I8579ec30ceb1908e4cd180cfbd10224aa4bddb8d
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
ff94ceff4c2715134c85a84c75d47a5835f1a598 25-Jul-2012 Martijn Coenen <maco@google.com> Revert "Move NXP JNI and DeviceHost implementation into separate dir."

This reverts commit 26f6049196acaa9768ba6bdef343216ea878a4c1.
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
26f6049196acaa9768ba6bdef343216ea878a4c1 20-Jul-2012 Martijn Coenen <maco@google.com> Move NXP JNI and DeviceHost implementation into separate dir.

Preparation for the new NCI stack. The idea is to
build either the NXP or the NCI stack, triggered
by a makefile switch. To that end, move the
DeviceHost and JNI implementations in their own
directory, so we can build them only if needed.

Change-Id: Ibb6aeb11f0bb887e153fd457860b1ad0e39e7933
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
f439271150e4548f116919e0254d57655421581c 01-Jun-2012 Martijn Coenen <maco@google.com> Add watchdog to applyRouting().

We've seen some devices hang in doSelectSecureElement,
probably waiting for a response from the HW. Root cause
is unknown, may be due to a different access pattern
of Wallet or OTAProxy. Until we can reproduce better
and find the root cause, watchdog this method. Added
advantage is that we can have the relevant context in the logs
when the crash occurs.

Bug: 6585958
Change-Id: Ic797ea479869a68173fcd42049cc4ba8d009d2e0
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
4ac28aa73f8bc7b501912fb8e96877a7b9a1f4f2 18-May-2012 Martijn Coenen <maco@google.com> Close NFCEE when NFC is being shut down.

Bug: 6501921
Change-Id: Ib76fd3a436632ddad0da7c73f7972018990f37c0
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
37058bf7b59def2f9a565ae5b16aae54e80e9e95 11-Apr-2012 Sunil Jogi <sunil.jogi@nxp.com> Added shared prefs for SE wired mode

When SE is in wired mode shared prefs sets the se_wired to true,
when SE is no more in wired mode shared prefs sets se_wired to
false. Default value for se_wired is false. se_wired shared pref
is set during the NFC initialization.

Change-Id: I9a3565c23035802895c8e99c671483c808312e0e
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
290a6967a04f49dc3969dced9f82c1636a7e7902 10-Apr-2012 Sunil Jogi <sunil.jogi@nxp.com> Updated disable method

Updated disable method so it can be used for phone shutdown and
also can retain the state of NFC Adapter.

Change-Id: I216e68b1d08d3e6d97cb82ad13cd3366c480d757
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
43f2fa7ad4c72ef4849f2d2b78a963c1925c63a3 04-Apr-2012 Nick Pelly <npelly@google.com> First cut at Bluetooth Beam

Change-Id: I616fd57b7822d703280ec960b84cf8c5ced6719d
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
ba15143ff54f5078f9b2cef5804525d387c52c72 03-Apr-2012 Martijn Coenen <maco@google.com> Support for querying extended length APDU support.

Bug: 5813943
Change-Id: I1274e3c47203e30cedefb57049738f97122de4b1
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
3322eb8bf21f95ec1564dff145d16e34e12ddfd5 31-Mar-2012 Martijn Coenen <maco@google.com> Merge "Let connect() fail with an I/O exception if tag has left the field."
4f5627f090c497cc6f628120a5b182891da73f5d 30-Mar-2012 Martijn Coenen <maco@google.com> Merge "Remove permissions check from the TagService."
cd7f018ec0cff0fcdcfe1399aa2398b809f2e35e 30-Mar-2012 Martijn Coenen <maco@google.com> Let connect() fail with an I/O exception if tag has left the field.

Because connect() can sometimes be implemented without any I/O,
(usually between transitions to/from the NDEF technology),
it does not always notice when a tag has left the field. Since
we promise in the API docs that it does, fix it by checking
(cached) presence.

Change-Id: Ie6ad1b5dec3621051e395d3be0d0e09615e53ebc
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
182152b054d555fc4ac5d5c2cd2367cb8c205782 30-Mar-2012 Martijn Coenen <maco@google.com> Remove permissions check from the TagService.

This will allow apps to call getNfcAdapter() and check if NFC
is enabled without having the NFC permission.

Added a permission check inside the TagService methods itself,
and removed obsolete method.

Bug: 5928657
Change-Id: I27c510ab7c3cbbda8e58e486100ede83312ce0dd
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
788afc415ce874e47a696e572565761c8ec0b7f5 29-Mar-2012 Martijn Coenen <maco@google.com> Merge "Get rid of getLastError()."
0ec8bb7e59bad813e1423bff0c756fafe85b011c 29-Mar-2012 Martijn Coenen <maco@google.com> Get rid of getLastError().

Was only used for one call into the service, and it wasn't even correct
in that case.

Change-Id: I6c7d9d137783fde9341e119402e6823776c711b7
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
2b8c4b2f4bc578f76b6dc0da33ef3aab70f3ba64 29-Mar-2012 Martijn Coenen <maco@google.com> Merge "Don't crash on passing invalid data to NfcService."
791ab7ad5b2fafaa4587d9ba7fb0fe39a815f278 29-Mar-2012 Martijn Coenen <maco@google.com> Don't crash on passing invalid data to NfcService.

Change-Id: Ibec1e2adb13a1f60bad1a573c9bf1f93d5cd4bc6
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
c96f982f8c0fa061701143a27395acf3b24dfb54 28-Mar-2012 Nick Pelly <npelly@google.com> Keep static NDEF in application rather than NFC Service.

This means we make an IPC callback during Beam for static NDEF, instead
of an IPC every time the static NDEF changes. This results in less IPC,
and the latency increase during Beam is not measurable.

This fixes a bug where a crashed application still leaves its
static NDEF message inside NFC service.

Bug: 5199662
Change-Id: Id4879356b2b2b0d65ce3183d7a1bda9cde455f2c
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
0c39284106d29e8852197d163dcc95c01da29f0d 01-Feb-2012 Martijn Coenen <maco@google.com> Support for setting p2p modes from javaland and some cleanup.

Removed code-duplication, fixed some warnings.

Change-Id: I5b7a2986e3836d6689b677bf80cb93421bfa821e
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
9a93cf5cf4b845c7983f202fe0e03615f31f6db0 27-Feb-2012 Martijn Coenen <maco@google.com> Fix crash when disabling NFC with target in field.

Change-Id: I6c8d85278bc1379d40d83ec4d3df5797e4643e10
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
e288a8c852ad826efcb2ef5a318394974918209d 13-Feb-2012 Martijn Coenen <maco@google.com> Cache installed packages for sending SE broadcasts.

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
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
2a576dd16a5688b6172d9951a4572d31c1345ad5 27-Jan-2012 Martijn Coenen <maco@google.com> Merge "LLCP 1.1 support."
3b82eef50f734cab061330f55de8b8bf5396f24b 27-Jan-2012 Martijn Coenen <maco@google.com> LLCP 1.1 support.

- 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
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
ea78e5beebff19ece23870b4ff5e5fd69d61aaa1 24-Jan-2012 Nick Pelly <npelly@google.com> Don't need to pass the NdefMessage in dispatch().

Change-Id: Ib1463aa51b1ce48cf7217866cb7c11ab8caa4e06
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
391cfe2479eca2080c14d1832599ad51cafae918 05-Jan-2012 Nick Pelly <npelly@google.com> Rewrite NDEF dispatch path. It was getting pretty messy.

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
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
1a037ff469a506d8918cac51d52c77ac789884f8 18-Jan-2012 Martijn Coenen <maco@google.com> Merge "Bring LLCP connectionless sockets back to life."
e008eba3b51c5303d52bf3e9e989dfd03b18435a 13-Jan-2012 Martijn Coenen <maco@google.com> Bring LLCP connectionless sockets back to life.

Useful for testing the connectionless part of the LLCP stack.

Change-Id: I76a7962526ec1e6ff463c938431229f89c545824
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
1668f533e6a2f041703919bafa4c3ceee62dbc38 10-Jan-2012 Martijn Coenen <maco@google.com> Make airplane override for NFC persistent.

Make behavior identical to wifi/bluetooth.

Bug: 5455123
Change-Id: I8c10888b7d3129723c6520dc0e81fa1793ae542c
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
c9342fef947c49e247495b83f94f16d43cd3562c 13-Dec-2011 mike wakerly <mikey@google.com> NfcService: some trivial cleanups.

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
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
a76d8ec1ab27f0955daed9e7a03fd3eb4c4092c7 01-Dec-2011 Nick Pelly <npelly@google.com> resolved conflicts for merge of 92250f5c to master

Change-Id: Ibad338d19e8b8c54ce02a0e347d1965dcf7b7008
92250f5cc5e34549985c31a053feff85b21c60c0 18-Nov-2011 Nick Pelly <npelly@google.com> Fix mismatched link()/unlink() causing NFC-EE to be stuck open.

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
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
2a3f6f141fdaf746a81ce850a8ab0ef251041966 29-Nov-2011 mike wakerly <mikey@google.com> Fix two incorrect synchronized statements.

(credit: robtsai)

Change-Id: Ic628bd0c156cd88e0f18db46212c8ebdf4eaedf5
Bug: 5631907
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
772130a3db390936a4ad448c56780f167eaa401f 22-Nov-2011 Nick Pelly <npelly@google.com> am e1cadb0c: Merge "Replace vendor specific NfcGoogle.apk with generic Nfc.apk" into ics-mr1

* commit 'e1cadb0cb6d6741a8b0a94456a5324c6f4a6f64d':
Replace vendor specific NfcGoogle.apk with generic Nfc.apk
e1cadb0cb6d6741a8b0a94456a5324c6f4a6f64d 22-Nov-2011 Nick Pelly <npelly@google.com> Merge "Replace vendor specific NfcGoogle.apk with generic Nfc.apk" into ics-mr1
37bb7b23886d7c058f7e9589ee5522b4a467b1b0 21-Nov-2011 Nick Pelly <npelly@google.com> Replace vendor specific NfcGoogle.apk with generic Nfc.apk

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
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
c171c42ca5de4b63f0a5b4f2de152d57fc0581ac 18-Nov-2011 Martijn Coenen <maco@google.com> am 806a7827: Merge "Also send NFCEE broadcasts to dynamically registered receivers." into ics-mr1

* commit '806a78272a812f274309bd902b319590a254a896':
Also send NFCEE broadcasts to dynamically registered receivers.
483f3065021c878468ab0921140aa9a2c89b4246 17-Nov-2011 Martijn Coenen <maco@google.com> Also send NFCEE broadcasts to dynamically registered receivers.

Bug: 5630129
Change-Id: I050283b6a8be0f564b34da0f8c08c6bb708f2501
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
b5ca7e7f3f4ec2bfad07bb9d7b6edb8d6bee7943 16-Nov-2011 Nick Pelly <npelly@google.com> am 2b093e93: Merge "Enable NFC-EE immediately when screen is on but locked." into ics-mr1

* commit '2b093e93f56f008413665e876a6189921a4a57b3':
Enable NFC-EE immediately when screen is on but locked.
2b093e93f56f008413665e876a6189921a4a57b3 16-Nov-2011 Nick Pelly <npelly@google.com> Merge "Enable NFC-EE immediately when screen is on but locked." into ics-mr1
fc87b4294aa0a2c85c2332a4c5229161a83961d8 29-Sep-2011 mike wakerly <mikey@google.com> Enable NFC-EE immediately when screen is on but locked.

Bug: 5375005
Change-Id: I072dfbca1fa8cdd25cf9232f2f0c82080aec767b
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
574f2781e70873388760adb43214c88a49c1f063 15-Nov-2011 Nick Pelly <npelly@google.com> am f4226b69: Merge "Add null check to aovid NPE on un-matched close()." into ics-mr1

* commit 'f4226b69c9e19d0329069b39d8ae2774fcbf88d1':
Add null check to aovid NPE on un-matched close().
f4226b69c9e19d0329069b39d8ae2774fcbf88d1 15-Nov-2011 Nick Pelly <npelly@google.com> Merge "Add null check to aovid NPE on un-matched close()." into ics-mr1
0571ce53451baf7d363703b6e3ac10bc885fc5bc 14-Nov-2011 Nick Pelly <npelly@google.com> Add null check to aovid NPE on un-matched close().

Also finish removing NFCEE permission, and fix a couple of style mistakes.

Change-Id: I4ec22469990de6661365c281db2e8cfd7ae413b0
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
0d00a83fcea7bf96e118d0271ed807a3f39f0bc4 11-Nov-2011 Nick Pelly <npelly@google.com> resolved conflicts for merge of ebf4b36e to master

Change-Id: I73a3025a35da21db6600b6e82c99836641e9bee7
1d9c95c9d31f71519d72b60e5af9cd64822ed87b 11-Nov-2011 Martijn Coenen <maco@google.com> am d9203771: Optimize soundpool use.

* commit 'd92037714c289cffb9ed1e6e6df36cd3b7292a21':
Optimize soundpool use.
ebf4b36e17dd0a63f293a618a6d1bcea98a69bd3 11-Nov-2011 Nick Pelly <npelly@google.com> Merge "Implement static white-list access control for NFC-EE." into ics-mr1
d92037714c289cffb9ed1e6e6df36cd3b7292a21 11-Nov-2011 Martijn Coenen <maco@google.com> Optimize soundpool use.

Share a single soundpool and release it when NFC is disabled.

Bug: 5590478
Change-Id: I858c9520bf6880e7d7c5920c12966d86108dd125
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
c05387ef4e6d6d024b03254e7e2ea5ad001cf2d2 25-Oct-2011 Jeff Hamilton <jham@android.com> Implement static white-list access control for NFC-EE.

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
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
9993a5a96a862cea4512509b413d0de6cacb7c14 31-Oct-2011 Nick Pelly <npelly@google.com> Changes semantics of isNdefPushEnabled() - require NFC to be enabled.

Change-Id: I065411644c19e30f01ce93560fc7e37efe817fe0
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
f5c40bdbcabbe81fdf43a24cd82be919ffb5de04 11-Aug-2011 Jeff Hamilton <jham@android.com> Add event logs for NFC events. DO NOT MERGE

Bug: 5128799
Change-Id: I5607abe5d28ef9682afa084651c50aa651655b60
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
416e2fc507d696486a127f932105b3b95519d0cb 11-Aug-2011 Jeff Hamilton <jham@android.com> Add event logs for NFC events.

Change-Id: I5607abe5d28ef9682afa084651c50aa651655b60
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
56f2a7bc39a14487f01cbf2d131ba3cde4126f2d 20-Oct-2011 Martijn Coenen <maco@google.com> NFC: Enable guard host timeout.

Set to 255 ms, increase number of retries to 64.
Add dump() interface to native library

Change-Id: Ib3a32f70453f7f8b79ff89394410f56b4b9dd7a2
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
7bbabb2deebbc498c635f690c5283201da549247 19-Oct-2011 Martijn Coenen <maco@google.com> Fix crash when turning screen off and NFC is off.

Bug: 5480404
Change-Id: I52add3c89fc535bfc37bc8c12ed0f8f905cbe304
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
e0b5fcb7e6422d1a788c48dd8f2936832ab8b397 15-Oct-2011 Jeff Hamilton <jham@android.com> Make the crash on screen off less frequent.

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
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
50effe4645b6ea57a1dc90777995f41dd9624e55 30-Sep-2011 Kenny Root <kroot@google.com> Add DUMP permissions check

Bug: 5389201
Change-Id: I8ddb60ebe63bcc01e0695868286ad4c7da4afa69
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
8e85fe445d229fba5d101b4f95fe0dfa34a8601e 28-Sep-2011 mike wakerly <mikey@google.com> NfcService: call enableAppSwitches for additional events.

This addresses the responsiveness issue identified in b/5140941

Change-Id: I8fad061be2e3f1006e4e2910db84c0a3360e2a0a
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
36a1e42f1811692fb734bc5f015e294eab0bed4c 26-Sep-2011 Jeff Hamilton <jham@android.com> Fix NFC to only be enabled when the lockscreen is dismissed.

Bug: 5300713
Change-Id: I93f0d75d159b3456e6fa8fc376d10493f25e3233
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
0fe7049a3224aa7b29cc980be07387e17607b0de 13-Sep-2011 Jeff Hamilton <jham@android.com> Manually port d77e05f7 from gingerbread:

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
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
14a4b124592b50dcec47d9b07232fff0188a4e02 07-Sep-2011 Jeff Hamilton <jham@android.com> Include stopped apps when broadcasting SE events.

Bug: 5249686
Change-Id: I5b3f2708ef28de58655ac2901f85f0575210f01c
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
af9a4d3feabb5e785f8b5de8db60a343396617ef 27-Aug-2011 Nick Pelly <npelly@google.com> Merge "NFC service updates for moving NDEF push to a fragment."
bf6e5d1655d5ad524a8ec007413c7011ed969df8 19-Aug-2011 Martijn Coenen <maco@google.com> Support for getMaxTransceiveLength() API.

Maximum transceive length is enforced in calls to transceive.
Change-Id: I94a4f16283e5fd5df9143b02e52c16f868b1c3ab
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
0b3b8ab69835cb66c96691dae3ba9b75705980a5 24-Aug-2011 Nick Pelly <npelly@google.com> NFC service updates for moving NDEF push to a fragment.

enable()/disable() -> set()
ZeroClick -> NdefPush

Change-Id: I21806665b8fd29e4580bd2e3200858d834605f6f
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
77d0b56bfa6a4e4e1449c476a1141a7486f34ad9 11-Aug-2011 Nick Pelly <npelly@google.com> Decouple P2P link management from P2P UX management.

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
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
d1936808c5f37f97fdb876836194ecbfe1cdfff5 10-Aug-2011 Nick Pelly <npelly@google.com> Address code review comments for "Increase priority of EnableDisableTask..."

Restore THREAD_PRIORITY_BACKGROUND.

Change-Id: Id33b3c9d38e04fd61a758b81e46d26ec22a1aae0
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
4467dca5650a170af5020c10a8ccb25f86f1007f 10-Aug-2011 Nick Pelly <npelly@google.com> Increase priority of EnableDisableTask thread to fix FW download failures.

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
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
ca7e72aaac66ce856c32aaffb8fd2163d7bb486a 10-Aug-2011 Nick Pelly <npelly@google.com> Fix bug where NfcAdapterExtras.get() always fails.

And improve some logging while we're at it.

Change-Id: Ia1f5c1a451690bfcf5b9af75e855c09164460561
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
31949217328bf2357ff044f0d18677fe588c790c 09-Aug-2011 Nick Pelly <npelly@google.com> A bunch of NfcService improvements.

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
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
7de0a268571d786c492e7013d5485fafcc59afbd 07-Aug-2011 Nick Pelly <npelly@google.com> Turn on polling if NFC service restarts with screen on.

There was a bug where mScreenUnlocked is initialized incorrectly
when the screen is on.

Change-Id: Id1bc813f6927d23cc317c0f0da074c0cee160fe3
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
4a61d3b45e81c0070538f94747a70a49c78f12fa 30-Jun-2011 Jeff Hamilton <jham@android.com> Remove the binder interface for LLCP.

Change-Id: I8d5fd546ecb07f005322eb5f173975dff7820439
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
5ce39aec169a275e814286372256277819593829 01-Aug-2011 Nick Pelly <npelly@google.com> Turn off ME Profile sharing & BT Dropbox.

Seems like it won't make the cut.

Change-Id: Iac7aa00debfe0d8118b28e8651abc200ce41d8ef
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
209282e9b744f3b9390154ebb69ad5587ccc2688 01-Aug-2011 Nick Pelly <npelly@google.com> Minor cleanup: change private members to package.

- remove explicit /* package */ comments
- Change some Log.e to Log.w

Change-Id: Ibcebcc63cd5e14f3a3d9d1f2482295115667814c
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
d11251b2d1fed7b7325c4fcb0616b2d1c654320f 28-Jul-2011 Martijn Coenen <maco@google.com> Pop up notification on first succesful Tap to Share.

Change-Id: Id2ddeea908af1159e5738e52a92f7f9818496761
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
0429f95d2f5502b3660bd4e3bd68bd5755960640 27-Jul-2011 Jeff Hamilton <jham@android.com> Merge "Play an animation for outbound NFC P2P."
70bbea61637e3f9eb7202efd243b9d2f9516a06a 26-Jul-2011 Nick Pelly <npelly@google.com> resolved conflicts for merge of 5057a591 to master

While I was there, rework of NativeNfcTag.findAndReadNdef()

Change-Id: I971403d880f281c8f64d2f9ed60756f6e692e9ae
d2d5dddf17ac2008547172cd72faa034a89d569b 22-Jul-2011 Jeff Hamilton <jham@android.com> Play an animation for outbound NFC P2P.

Clean up NFC service sound playing.

Cancel P2P tasks when the LLCP link is broken.

Bug: 4941390
Change-Id: I0710bc7dd9d09ed47a540cb4739890bcc3a4f905
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
5057a59181dc0e814a219fe18fc356b7c72772cc 26-Jul-2011 Daniel Tomas <dtomas.nxp@gmail.com> am 2c3f9be8: Patch to manage TARGET_LOST status in case of Multiple protocol tag

* commit '2c3f9be8111dd454e430ffb327c051ff9d2bba21':
Patch to manage TARGET_LOST status in case of Multiple protocol tag
2c3f9be8111dd454e430ffb327c051ff9d2bba21 15-Jul-2011 Daniel Tomas <dtomas.nxp@gmail.com> Patch to manage TARGET_LOST status in case of Multiple protocol tag

Plumb status codes up through the stack.

Change-Id: Id30e69fff3bb56082ab29d42f166cb12c3061857
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
e063132e40dc788f0b471ed3832f5fbaebd7e463 21-Jul-2011 Martijn Coenen <maco@google.com> Fix synchronisation for 0-click setting.

Change-Id: I25fa9ff4430267dd5822f226d1ac8f19fb9a4c05
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
d9567994fefe21743131adc7390acdb97f81ed67 21-Jul-2011 Martijn Coenen <maco@google.com> Support for enabling/disabling zero-click sharing.

Change-Id: Ibf05dca23174952e412afdd2c90ca9efad31d3a0
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
bb685417895d440e1e3a5f19bbbe36139db3fd9a 21-Jul-2011 Martijn Coenen <maco@google.com> Merge "Support for getTimeout() (NFC service)."
df55e2912aed6fc81b19958f1b825e7d693d5cf3 21-Jul-2011 Jeff Hamilton <jham@android.com> Remove the My Tag handling.

Bug: 5048185
Change-Id: Ic25091ee4975d1c601e0f56abda5ae25c09a62f8
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
8d6a8dce6706c6c6b3158101f2f3e94a1e0ad946 01-Jul-2011 Ben Dodson <bjdodson@google.com> Bluetooth dropbox for out-of-band transfers

Use dropbox for ME profile.

Transiently turn on Bluetooth.

Change-Id: I81556a67872e7e0ac7c66c0376549adc5f0c168d
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
358d8b6ad611aba11e69a3b1dd9d132dbc9a7605 20-Jul-2011 Martijn Coenen <maco@google.com> Support for getTimeout() (NFC service).

Bug: 4492175
Change-Id: I289e40d1527e7b570e8fd46f9968094b92a31902
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
a39fb7629fdaafbf728cc484facac6d64d2f2170 15-Jul-2011 Nick Pelly <npelly@google.com> am 9e6b5d1f: am b3d770c4: Merge "- Properly initialize NfcService.mEeRoutingState to ROUTE_OFF . This allows NfcAdapterExtras.getCardEmulationRoute() to properly return ROUTE_OFF when the service restarts." into gingerbread

* commit '9e6b5d1f092fab35e497f81035586afae529cda6':
- Properly initialize NfcService.mEeRoutingState to ROUTE_OFF . This allows NfcAdapterExtras.getCardEmulationRoute() to properly return ROUTE_OFF when the service restarts.
9e6b5d1f092fab35e497f81035586afae529cda6 15-Jul-2011 Nick Pelly <npelly@google.com> am b3d770c4: Merge "- Properly initialize NfcService.mEeRoutingState to ROUTE_OFF . This allows NfcAdapterExtras.getCardEmulationRoute() to properly return ROUTE_OFF when the service restarts." into gingerbread

* commit 'b3d770c4ff05992f81f2d172e6d2c514443674a5':
- Properly initialize NfcService.mEeRoutingState to ROUTE_OFF . This allows NfcAdapterExtras.getCardEmulationRoute() to properly return ROUTE_OFF when the service restarts.
eab09ad7204fe1f0feaca33efccf75c1bb388708 13-Jul-2011 Robert Tsai <robtsai@google.com> - Properly initialize NfcService.mEeRoutingState to ROUTE_OFF . This allows
NfcAdapterExtras.getCardEmulationRoute() to properly return ROUTE_OFF when
the service restarts.

Change-Id: I833bb2afae06778a0e4bdd5f5d25374636885f42
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
6ec87aa54aad2c340c4ea0247ba4a8e0d9f10573 08-Jul-2011 Nick Pelly <npelly@google.com> Fix issue: NFC polling does not start on screen on with unlocked keyguard

The logic at ACTION_SCREEN_ON was wrong.

Change-Id: I992ec9ac851ce4f803b7c17b6ee3488a8b94aa92
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
1299bfa9e16265e34f7e70066831c8a1fcb26479 01-Jul-2011 Jeff Hamilton <jham@android.com> Merge "Add the NDEF tech for tags coming in over P2P."
aca0d055a82da850c27f6872405602ad5f3fee7b 01-Jul-2011 Jeff Hamilton <jham@android.com> Add the NDEF tech for tags coming in over P2P.

Change-Id: I56a51cf9dbf2b0be7f4e1391188cb8e73fc61be4
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
e941fed258e3b66494238cf75b8baaa2d877e2c5 30-Jun-2011 Nick Pelly <npelly@google.com> resolved conflicts for merge of 23cb1387 to master

Change-Id: Id0fbebca8ace7425a28bd34b5689b3724ccf69fa
23cb1387feb20ac89f08dc2d84840013fe33bb56 29-Jun-2011 Nick Pelly <npelly@google.com> am e7a398f2: Do not change NFC on/off preference while executing SE reset.

* commit 'e7a398f2f0256a4a80a4ee08b70d48dbfd8da6d2':
Do not change NFC on/off preference while executing SE reset.
e7a398f2f0256a4a80a4ee08b70d48dbfd8da6d2 29-Jun-2011 Nick Pelly <npelly@google.com> Do not change NFC on/off preference while executing SE reset.

Bug: 4967769
Change-Id: I7a72cbe831d4b3f44bed7feeea8abaf468cdc19b
Signed-off-by: Nick Pelly <npelly@google.com>
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
442cad40a205a63ea8797fbccaee99b2e8ab89ab 29-Jun-2011 Nick Pelly <npelly@google.com> Properly merge b5165e13 to master.

Change-Id: I3b7019e94346046d4e0834531651c372c754e0a3
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
bcda16f34e26f6458241b7d8452f71206a7b18df 29-Jun-2011 Nick Pelly <npelly@google.com> resolved conflicts for merge of b5165e13 to master

Change-Id: Ie4f9f57b7969979a4db2ddcb795aed9fc3cd592b
b5165e13f6cd0b9857793c243f1659ec0a671ba2 29-Jun-2011 Daniel Tomas <dtomas.nxp@gmail.com> am 2c37e6a8: Patch to support New PN544 firmware events in the NfcService

* commit '2c37e6a839cecf5638911af357a2ea7aec6093a5':
Patch to support New PN544 firmware events in the NfcService
2c37e6a839cecf5638911af357a2ea7aec6093a5 21-Jun-2011 Daniel Tomas <dtomas.nxp@gmail.com> Patch to support New PN544 firmware events in the NfcService

Change-Id: I4fe95c6cff9c50eef64bd99de415e66e7174b46a
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
ce77cf9b062cc749f488994cefd958e23994d60e 23-Jun-2011 Nick Pelly <npelly@google.com> Properly merge SE reset timeout fix.

Change-Id: Id429b51625a4ce19851629b82cbc80f00a8ddd98
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
51d1cb0d642b1ea52d181c8e3f7ef9853c07e2ec 23-Jun-2011 Nick Pelly <npelly@google.com> resolved conflicts for merge of d15714ce to master

Change-Id: Ifd4087685f8ba170af54e0d9c67ae7ae1f49260c
157d22b8be7cd29f10ab324c1b37c7a8714be2fc 23-Jun-2011 Ben Dodson <bjdodson@google.com> Hack to fix broken build

Change-Id: I8337c21e02c9e45365f929b20d1ceb9ef6aebb14
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
7ee8775d5af5851664771e1dcde376b4814f7e2f 23-Jun-2011 Daniel Tomas <dtomas.nxp@gmail.com> am 10577281: am 85a8366a: Set the transceive timeout to 10s when executeSeReset() is called

* commit '1057728122c5fda8988ef39bdbad83d7fda7c0d6':
Set the transceive timeout to 10s when executeSeReset() is called
32cdff503e206b6753c6cf020c545163a43bcaa1 21-Jun-2011 Martijn Coenen <maco@google.com> Exchange me profile over NFC using android SNEP service.

This is Ben's patch with some small modifications:
- Added code to retrieve the me profile and transmit/receive it;
- Moved local SAP definitions for more clarity.
- Removed sending of my tag.

Change-Id: Ica85b4491206526e89bc34c23479f9d4489ed1cf
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
d15714ceaaae6e67b674afac66593683574fd403 21-Jun-2011 Nick Pelly <npelly@google.com> am 5a8844da: NfcService updates for NfcAdapterExtras API change.

* commit '5a8844da9bc569aa7289426bf7b96e7eef90abf5':
NfcService updates for NfcAdapterExtras API change.
1057728122c5fda8988ef39bdbad83d7fda7c0d6 21-Jun-2011 Daniel Tomas <dtomas.nxp@gmail.com> am 85a8366a: Set the transceive timeout to 10s when executeSeReset() is called

* commit '85a8366a75041491a22928f65357c69d112c9925':
Set the transceive timeout to 10s when executeSeReset() is called
5a8844da9bc569aa7289426bf7b96e7eef90abf5 17-Jun-2011 Nick Pelly <npelly@google.com> NfcService updates for NfcAdapterExtras API change.

(removing registerTearDownApdus(), adding authenticate())

Change-Id: Ie1b0f7f088317ff3e52721158b0e588dfda14ce4
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
85a8366a75041491a22928f65357c69d112c9925 17-Jun-2011 Daniel Tomas <dtomas.nxp@gmail.com> Set the transceive timeout to 10s when executeSeReset() is called

Change-Id: Id89207194a87e918aee2493c8c0fa93a97a1ff4a
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
9e52520889fa9ee7d045180504faadf0e3c70264 20-Jun-2011 Jason parks <jparks@google.com> Merge commit '52eadbdd' into nfc

Conflicts:
src/com/android/nfc/NfcService.java

Change-Id: I0cd15dbdc3540cb469d6fc13550006e1ab43b90f
d704c298a5a1e783c71db6f39b2eef0a909b0e88 17-Jun-2011 Jeff Hamilton <jham@android.com> Play sounds for start, end, and error.

This needs some cleanup to handle the
error states better, but works ok for now.

Change-Id: I803c339de593acfe5bb7f1007a965f203e0e1a30
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
52eadbdda8fd2c8fe6f2f6327e5268e3b2b9f3cf 17-Jun-2011 Jason parks <jparks@google.com> am 84e1e0ad: Reset the SE when a package that accessed it is uninstalled.

* commit '84e1e0adc2516afd35ebab029a52e764e0490559':
Reset the SE when a package that accessed it is uninstalled.
84e1e0adc2516afd35ebab029a52e764e0490559 17-Jun-2011 Jason parks <jparks@google.com> Reset the SE when a package that accessed it is uninstalled.

Bug: 4487211
Change-Id: Iad5c641926eb0e121d630d16f8ce02b8b9713cd3
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
9582ec8978fadc48ac78d9b1daafb481f0a787da 17-Jun-2011 Ben Dodson <bjdodson@google.com> Merge "automatically share packages of user apps that don't support nfc"
ece57f1277161ca58b978e3f49310ce440151a41 16-Jun-2011 Ben Dodson <bjdodson@google.com> automatically share packages of user apps that don't support nfc

Change-Id: I531d8cb50a334a93f0e44f90cbab4ebc1f70d4b2
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
2083287b83a587d8f6e9ad829ea18041dc17d842 16-Jun-2011 Nick Pelly <npelly@google.com> resolved conflicts for merge of 8bda4f3e to master

Change-Id: I558cc850a3d799271c733807ca63a66487db2839
8bda4f3eb1e87aa967caed38e21274c6deb40ee6 16-Jun-2011 Nick Pelly <npelly@google.com> am 2edb3ee5: Fix NFC service wake-lock, again.

* commit '2edb3ee5e28ab719a3bb17b8d76b2b588405be9a':
Fix NFC service wake-lock, again.
2ef360deaff9f17aa72d5749ceee283cc80897af 15-Jun-2011 Ben Dodson <bjdodson@google.com> Merge snep p2p to master

Change-Id: Ic629c9a2ad348c1f352f39d7fc2be04edcf627e7
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
f6c56a2191d58e3f9f68e3e7d94908b04b9b66ff 14-Jun-2011 Jeff Hamilton <jham@android.com> First pass at an abstraction of the NFC stack.

This moves some of the stack functionality
behind interfaces that the NFC service uses.

Change-Id: Ia377b8d0b9f57a25ac72a5f650fd25c35df72de0
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
81c476dd93f059d4082c15369894d5d16fbea05d 14-Jun-2011 Jeff Hamilton <jham@android.com> Relocate the libnfc-nxp Java bridge sources.

Change-Id: I0b743245d60bf9c47ce84ec0ab7fd8c5b6202ec9
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
fbd90779b1525b254726eb58d07883ca74e1b21c 09-Jun-2011 Martijn Coenen <maco@google.com> Support for setting the NfcA transceive timeout (NFC Service).

Change-Id: Iec7b949f487f3b9cdd4729ce99c3a4b2718b9b6a
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
2edb3ee5e28ab719a3bb17b8d76b2b588405be9a 13-Jun-2011 Nick Pelly <npelly@google.com> Fix NFC service wake-lock, again.

1) Put a watchdog on the NFC Service disable path.
All the bug-reports show we were stuck in _disable(), watch-dog
this path (10 seconds).

2) Only attempt a SE reset once, even if it fails the first time.
All the bugs reports should the _disable() was due to SE reset
on first boot.

3) Grab the NFC service lock before the wake-lock.
So even if someone has NFC service lock, at least we don't
hold a wake-lock waiting for it.

Bug: 4581084
Change-Id: Ic9829dddde8d0c67cf0e8e4912357fa2902faa11
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
7efbf69a37134ccbd86a1f6b4121f16b4a80eaae 09-Jun-2011 Nick Pelly <npelly@google.com> Moar NfcService cleanup.

- Pulled polling loop configuration out of NfcService, to NativeNfcManager.cpp
- Removed lots of dead code

Change-Id: Id8d3b590feb24e6065d4afa34f004d9afbacbe5a
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
c8288824e2f5513dfe59b78d5f3af7757a1945b4 09-Jun-2011 Nick Pelly <npelly@google.com> resolved conflicts for merge of 8b3098bd to master

Change-Id: I37daa2d765857c007b7b310510afc621a2aa0699
361e9868d0dd529c95b35536c2749bfaf4df34cb 09-Jun-2011 Martijn Coenen <maco@google.com> Merge "Added support for rediscovering a Tag."
8586b104c1cf07c52c739c0afab0ded1bf151859 09-Jun-2011 Nick Pelly <npelly@google.com> resolved conflicts for merge of fe817189 to master

Change-Id: I42b37768e9f66e959b5487e4e5409e517202d63a
e332f38f8a2e419cc1e09316668e436790fa99bf 08-Jun-2011 Nick Pelly <npelly@google.com> Merge "Slay the NfcService beast, part one."
76a412f47ff57ce05d84fd51adbf8e72fd37a448 08-Jun-2011 Nick Pelly <npelly@google.com> Slay the NfcService beast, part one.

Split out dispatch code into NfcDispatcher.java. It can be pulled out
cleanly.

Move URI field construction into framework.

Change-Id: Ia70c06c5f469b370c532905e1c02f71149cb9ecc
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
dfebdbf803bf01404255f964e571056aa84173ca 18-Jan-2011 Martijn Coenen <martijn.coenen@nxp.com> Implement Felica timeout handling (NFC service).

NFC service interface to set the Felica timeout from the API.
Refactored timeout resets to single method - assuming access
to the SE in wired mode is exclusive with normal tag access,
this should be no problem.

Change-Id: I4a4d1c2c6db12582e5ff6cca325fd14fcf286282
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
3fb14d0868594c78a777e805545209636814e223 02-Jun-2011 Martijn Coenen <maco@google.com> Added support for rediscovering a Tag.

This adds basic support for rediscovering the currently connected tag.
At the moment rediscovering the same tag is not well supported by libnfc.
The real usecase for rediscover is actually run-time adding and/or
removing the Ndef and NdefFormatable technologes, and since we detect
these in the upper layers of the stack anyway this makes the
implementation a lot simpler.

This change also required a cleaner split between connected technologies
and connected handles. Connected technologies are something that only
the Java part of the API is concerned with. Each technology is mapped
to a handle, which is how libnfc refers to a tag. Previously we used
the connected technology to derive the connected libnfc handle, but
since this change allows run-time removal of technologies *without*
disconnecting from a handle we need to keep track of them separately.

Bug: 3378764
Change-Id: If4725fa266eb37aa17aa67b31491f4bd77b1ee68
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
8b3098bd06dd781785c33f5bf73318c44181c89c 08-Jun-2011 Nick Pelly <npelly@google.com> am dfac80d2: Fix regression in NFC-EE close() cleanup path for dead applications.

* commit 'dfac80d25dd2816ad5af74cc4131b74134cc81b7':
Fix regression in NFC-EE close() cleanup path for dead applications.
fe817189a246e2b3c4a90d1d84c023e89030e1f2 07-Jun-2011 Nick Pelly <npelly@google.com> am aa122139: Make sure NFC stack is initialized before attempting SE reset.

* commit 'aa122139d77645149c09c9815fd45e7b87ce7170':
Make sure NFC stack is initialized before attempting SE reset.
bad4dcc454a064f0c062f097d567a57633d1cb30 07-Jun-2011 Jeff Hamilton <jham@android.com> am 30f997de: am b8318ada: Merge "Fix a bug with absolute URI processing." into gingerbread

* commit '30f997de5f25657e583eda87de8b56638ec49884':
Fix a bug with absolute URI processing.
74e93e30798ab9b2110f54755bc98423b43a56f5 07-Jun-2011 Nick Pelly <npelly@google.com> resolved conflicts for merge of f9283b76 to master

Change-Id: I49fe4e5c1d331c5b2fb1aa41b13a625e95e8c45a
afd2f415bfe17c572718c28a27e5dcd1cef8f3a8 06-Jun-2011 Martijn Coenen <maco@google.com> Merge "Throw unsupported exception when connecting to NfcB."
c639df04b45232109d7112642fa17c3510b763b6 06-Jun-2011 Jeff Hamilton <jham@android.com> am 389c8d8a: am 21ee4b2e: Add support for TNF_EXTERNAL in NDEF_DISCOVERED intents.

* commit '389c8d8ae8d4fbb8c61ff5b6d29fc17481601d58':
Add support for TNF_EXTERNAL in NDEF_DISCOVERED intents.
30f997de5f25657e583eda87de8b56638ec49884 06-Jun-2011 Jeff Hamilton <jham@android.com> am b8318ada: Merge "Fix a bug with absolute URI processing." into gingerbread

* commit 'b8318ada928026f1d118ec918260796106b83dd2':
Fix a bug with absolute URI processing.
f9283b76369100d9aa1af47d4ab8945950f52465 06-Jun-2011 Nick Pelly <npelly@google.com> am d30c5d61: Merge "Use a hardcoded SE reset script." into gingerbread

* commit 'd30c5d615023201735d251ae14324105b220fe04':
Use a hardcoded SE reset script.
389c8d8ae8d4fbb8c61ff5b6d29fc17481601d58 06-Jun-2011 Jeff Hamilton <jham@android.com> am 21ee4b2e: Add support for TNF_EXTERNAL in NDEF_DISCOVERED intents.

* commit '21ee4b2e782188cbc8e8b7752dd992844a904615':
Add support for TNF_EXTERNAL in NDEF_DISCOVERED intents.
1b1e68327701225b728d43226049ad7a5dee4bcd 06-Jun-2011 Martijn Coenen <maco@google.com> Throw unsupported exception when connecting to NfcB.

Connecting to the NfcB technology is currently not supported.

Also removed ErrorCodes.java, which is obsolete here.

Change-Id: I612dd267b48f0c89479e895edfba3f757fd4bd4c
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
dfac80d25dd2816ad5af74cc4131b74134cc81b7 02-Jun-2011 Nick Pelly <npelly@google.com> Fix regression in NFC-EE close() cleanup path for dead applications.

The regression occured when we switched to certificate based checking
for NFC-EE access control (this switch was only fully completed a few days
ago).

Change-Id: I43d7adfad020446af8e863e876c59caf3b852920
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
88e4efa8598bd0cac2d4a33c14206143022da20a 01-Jun-2011 Jason parks <jparks@google.com> Merge "Enable NFC after the device is unlocked."
aa122139d77645149c09c9815fd45e7b87ce7170 01-Jun-2011 Nick Pelly <npelly@google.com> Make sure NFC stack is initialized before attempting SE reset.

This fixes a regression at about GRJ46 where phones that had NFC
turned off would fail to perform SE reset on first boot of GRJ46
and later. This would prevent NFC from being turned on, and caused
NFC service to eat battery.

Change-Id: I4714f06e8a3c92a5974851dd1be90b797e3058ac
Bug: 4504474
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
160b03be2e1ce574d228a2564d21c5f13f8c7b53 22-Mar-2011 Martijn Coenen <maco@google.com> Check whether an activity is enabled before adding to the chooser.

The RegisteredComponentCache is updated on asynchronous messages
from the PackageManager, which may be delayed for several seconds.
So if an application disables an activity, the activity may still show
up in the activity chooser. Selecting this activity will cause the
NFC service to crash. Prevent this by actually checking whether
an activity is enabled before adding it to the list.

Change-Id: Ibe28b58dd110d93431508cbf728a89743c8fc53b
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
225ae2587712b06a354b4ad4625aadc780fa4e80 31-May-2011 Martijn Coenen <maco@google.com> Backup NFC preferences.

Backs up all NFC shared preferences. Note this only works when doing a
full system restore. Doing just a runtime restore won't trigger the NFC
service to restart and reload the setting.

Bug: 3139537
Change-Id: I40d3e5c5cd39482a292e634a941af6093f639ece
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
275fd2b59ae8a9e3eb6e77e8663aea9ca08f1159 26-May-2011 Jason parks <jparks@google.com> Enable NFC after the device is unlocked.

The current behavior is to enable it on screen on.

Change-Id: Ia9e7a839ee3365ed94494eeb154aadd7bf8f1b9c
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
b8318ada928026f1d118ec918260796106b83dd2 25-May-2011 Jeff Hamilton <jham@android.com> Merge "Fix a bug with absolute URI processing." into gingerbread
5223d6aafa38c8dbbe684f1f8611ee0f46e7ef02 25-May-2011 Jeff Hamilton <jham@android.com> Fix a bug with absolute URI processing.

Change-Id: Ic9dc3f981e6abe52d7732eab35d6cc2c535a2dad
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
d30c5d615023201735d251ae14324105b220fe04 25-May-2011 Nick Pelly <npelly@google.com> Merge "Use a hardcoded SE reset script." into gingerbread
a8b7cca914e4a17f5c432f7bbeed0f1b236c55b4 25-May-2011 Nick Pelly <npelly@google.com> Use a hardcoded SE reset script.

Remove per-package support for tear-down. It just complicates things.

Change-Id: I9ab413df339b2d5407084b2b83c0c2a8feabc0e4
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
21ee4b2e782188cbc8e8b7752dd992844a904615 24-May-2011 Jeff Hamilton <jham@android.com> Add support for TNF_EXTERNAL in NDEF_DISCOVERED intents.

The URN is converted to a URL in the form:

vnd.android.nfc://ext/<domain_name>:<service_name>

so that it can be processed by IntentFilter. For example to
catch all TNF_EXTERNAL entries for example.com you would use
the following in your manifest:

<intent-filter>
<action android:name="android.nfc.action.NDEF_DISCOVERED" />
<category android:name="android.intent.category.DEFAULT"/>
<data android:scheme="vnd.android.nfc"
android:host="ext"
android:pathPrefix="/example.com:" />
</intent-filter>

Change-Id: I5f5b121aa217364611923113985261a5c9a2171e
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
2094515fca0cfa0ac87e9cc260d3953d416afe3e 22-Apr-2011 Jason parks <jparks@google.com> Implement callback interface for Ndef push.

Change-Id: I829c95436b69f41bc473f8085f18247fedac48c5
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
15758e6071881e747019267535ac4ead21b7d0c8 27-Apr-2011 Jeff Hamilton <jham@android.com> am 7a7f8f8f: Only execute the teardown APDUs when a package is being fully removed.

* commit '7a7f8f8fd82936f0ee005ccfa7ac5c36760ed902':
Only execute the teardown APDUs when a package is being fully removed.
7a7f8f8fd82936f0ee005ccfa7ac5c36760ed902 20-Apr-2011 Jeff Hamilton <jham@android.com> Only execute the teardown APDUs when a package is being fully removed.

Bug: 4316508
Change-Id: I498eb09cfb48b3b14268c649936186000f360c16
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
686ea37164e5595578ae0623c0bb2622fb579d47 11-Apr-2011 Jeff Hamilton <jham@android.com> am 5e7b58d9: Don\'t crash when an unregistered package is removed.

* commit '5e7b58d9c95a9074a42c3e4820e2467dfa85af10':
Don't crash when an unregistered package is removed.
3ea1c986d689549b41d6e9c7fdc9c8cadfba63e0 11-Apr-2011 Jason parks <jparks@google.com> Merge commit '613fcd91' into manualmerge

Conflicts:
src/com/android/nfc/NfcService.java

Change-Id: I554e33d89fda1f74fd976263a8c4dc0549303eda
ad3d60fa4d74d20e1abc4ec5d529022b441bde4c 08-Apr-2011 Jeff Hamilton <jham@android.com> am 8afd14d3: Make the NFC UID forward compatible.

* commit '8afd14d3b23d3124c48ee275ba2845aede6542a1':
Make the NFC UID forward compatible.
9d6ad3551038e82a2ff563f0813e64f2e5a19efe 05-Apr-2011 Nick Pelly <npelly@google.com> am 37179222: Merge "Increase wired mode timeout to 10 seconds." into gingerbread

* commit '37179222029075f316d43db89555699c978c79f8':
Increase wired mode timeout to 10 seconds.
5e7b58d9c95a9074a42c3e4820e2467dfa85af10 04-Apr-2011 Jeff Hamilton <jham@android.com> Don't crash when an unregistered package is removed.

Bug: 4205311
Change-Id: I116e7c2e12c7e160d81154d22589b1bdefe93e44
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
613fcd914b6ff4fc50ccb9500db952d2fab5ff88 01-Apr-2011 Jason parks <jparks@google.com> Merge "Implement tear down scripts." into gingerbread
bcd6a9954c5abafc6b14aabcc7768d0f03cc956c 31-Mar-2011 Jason parks <jparks@google.com> Implement tear down scripts.

Change-Id: Ie6d491b4bf1a735d4119f78f252aa14a95536149
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
8afd14d3b23d3124c48ee275ba2845aede6542a1 01-Apr-2011 Jeff Hamilton <jham@android.com> Make the NFC UID forward compatible.

Change-Id: Idebe263500839a0238fd5b0cf732e5ecc477698e
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
1124dc4b6697eb8ddd49511c07b75fe0db54f51e 31-Mar-2011 Jeff Hamilton <jham@android.com> am 93d8a69c: Add com.android.nfc.permission.NFCEE_ADMIN.

* commit '93d8a69ccadfa01b0a5ec3d7edeb921a1da4bce8':
Add com.android.nfc.permission.NFCEE_ADMIN.
37179222029075f316d43db89555699c978c79f8 30-Mar-2011 Nick Pelly <npelly@google.com> Merge "Increase wired mode timeout to 10 seconds." into gingerbread
ba6401757f8017faeb77423f2d08fd51be1d1051 30-Mar-2011 Nick Pelly <npelly@google.com> Increase wired mode timeout to 10 seconds.

Change-Id: I496a74f2fbad55cb8f04a434a386d6d86e7d3636
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
6c4df906af9c9fdd5c8c896f55b581cf73e0d84c 30-Mar-2011 Jeff Hamilton <jham@android.com> am cd46a585: Change the package name to allow using a new cert.

* commit 'cd46a585f77bdfca3e04f61957fe292cf2b40d63':
Change the package name to allow using a new cert.
93d8a69ccadfa01b0a5ec3d7edeb921a1da4bce8 25-Mar-2011 Jeff Hamilton <jham@android.com> Add com.android.nfc.permission.NFCEE_ADMIN.

It controls permissions for NFCEE administration
and is checked based on the signature of Nfc.apk
and the caller.

The NFCEE admin permission checking is currently
set to check the stock NFC permission.

Change-Id: I164511d8f6850034ca0fc1f6f7f75c5ef212fbc2
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
cd46a585f77bdfca3e04f61957fe292cf2b40d63 24-Mar-2011 Jeff Hamilton <jham@android.com> Change the package name to allow using a new cert.

Change-Id: I89243027b25a3904df0e50414b64387d172c181b
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
23514f9e16137364df3282b33c8b5838c0a3aa8b 12-Mar-2011 Nick Pelly <npelly@google.com> am 49d53329: Implement new NFC-EE API\'s (Nfc.apk).

* commit '49d53329a0c720a7e430220d77805bc1763545b1':
Implement new NFC-EE API's (Nfc.apk).
49d53329a0c720a7e430220d77805bc1763545b1 08-Mar-2011 Nick Pelly <npelly@google.com> Implement new NFC-EE API's (Nfc.apk).

Change-Id: Id16b91a9cde25a4f4a746492921250c0834199f1
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
0a0749107462ffe7255cd604a758dd00d781bfe7 22-Feb-2011 Martijn Coenen <martijn.coenen@nxp.com> am 10389c11: Fix race in NFC tag registry/dispatch.

* commit '10389c11abdae4c794082f6c51f11b28b422eddb':
Fix race in NFC tag registry/dispatch.
10389c11abdae4c794082f6c51f11b28b422eddb 03-Feb-2011 Martijn Coenen <martijn.coenen@nxp.com> Fix race in NFC tag registry/dispatch.

The tag handle was only registered after the dispatch; with the "normal"
dispatch the activity would take a while to start and this problem would not be
seen. With foreground dispatch however, if you'd immediately try to connect to a tag,
sometimes the tag handle is not registered yet, causing the connect() to fail.

Change-Id: I92b5e36a5d8f08e410a656d364e88bce2d25c854
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
eeacab3ce12d1b78b068ccf8fe18a9feafc48667 16-Feb-2011 daniel_tomas <dtomas.nxp@gmail.com> am 221b4d6e: Patch to manage the Screen ON/OFF during the wired mode

* commit '221b4d6ee301fbfe19402798f7d3c11e6878c888':
Patch to manage the Screen ON/OFF during the wired mode
b9d444273a3eb0c1be6e8c27e3ce2e2be5813881 16-Feb-2011 daniel_tomas <dtomas.nxp@gmail.com> am 99a1a5cd: Patch to support CE On/Off with Screen On/Off

* commit '99a1a5cd0824585da3b3fa4a3f43a7491342a99e':
Patch to support CE On/Off with Screen On/Off
221b4d6ee301fbfe19402798f7d3c11e6878c888 15-Feb-2011 daniel_tomas <dtomas.nxp@gmail.com> Patch to manage the Screen ON/OFF during the wired mode

Change-Id: I019ad3fc62f49280031320c2c32532e64097d3f9
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
99a1a5cd0824585da3b3fa4a3f43a7491342a99e 15-Feb-2011 daniel_tomas <dtomas.nxp@gmail.com> Patch to support CE On/Off with Screen On/Off

Change-Id: Ic7046ea686b1cf3eb232f6125122dea5d919ac2d
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
30735d1bdacbe0d05e925d8a5065b60124d21ee7 10-Feb-2011 Nick Pelly <npelly@google.com> am bd555ee6: Fix SE permissions.

* commit 'bd555ee64250126b60b24814120a2049943920ca':
Fix SE permissions.
bd555ee64250126b60b24814120a2049943920ca 09-Feb-2011 Nick Pelly <npelly@google.com> Fix SE permissions.

Change-Id: I83f79bc7a5f3227ef4a8222dc879beda53a8ab31
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
75a060ef1ed27bde485a091de49dfafe4aebb356 01-Feb-2011 Nick Pelly <npelly@google.com> am 8d69f520: Update Nfc.apk for final GB MR API changes.

* commit '8d69f5205e3c4a7c2eb869bbf4983d3d9fe45ab0':
Update Nfc.apk for final GB MR API changes.
8d69f5205e3c4a7c2eb869bbf4983d3d9fe45ab0 01-Feb-2011 Nick Pelly <npelly@google.com> Update Nfc.apk for final GB MR API changes.

Change-Id: I0b709084992e8022deacd67e1b8c24f33e8d73fc
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
9dc61c58004f73ca1cee7107492b1a58d5bbf311 29-Jan-2011 Martijn Coenen <martijn.coenen@nxp.com> am ab2b44b9: INfcTag isPresent() should not block and not cause RF activity.

* commit 'ab2b44b97936d2c5dbf6eda1245ca793e840713f':
INfcTag isPresent() should not block and not cause RF activity.
ab2b44b97936d2c5dbf6eda1245ca793e840713f 28-Jan-2011 Martijn Coenen <martijn.coenen@nxp.com> INfcTag isPresent() should not block and not cause RF activity.

Use a cached value instead, which is based on the presence check that is running
anyway.

Change-Id: Ifa50ff38e884fa865bb7ba95dde45da39bebf7e8
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
75a3f8c13fddfdea835e91eaf37b6bbdcd2aacf8 27-Jan-2011 Jeff Hamilton <jham@android.com> am 3ca2b3f9: Don\'t show the same activity multiple times.

* commit '3ca2b3f925d434559300ee2fb10bfcdd365a0fb6':
Don't show the same activity multiple times.
3ca2b3f925d434559300ee2fb10bfcdd365a0fb6 27-Jan-2011 Jeff Hamilton <jham@android.com> Don't show the same activity multiple times.

Bug: 3398076
Change-Id: Ib1a0ac03299f713b00bc93de2e8bb7a3b531711c
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
5f6be630a52605ba957d590813d8645a87d49047 26-Jan-2011 Arnaud Ferir <arnaud.ferir@trusted-logic.com> am e260fc52: Stop tag watchdog before disabling NFC.

* commit 'e260fc52ed2b4e6e1b7394d6f841d01c98888327':
Stop tag watchdog before disabling NFC.
3c40cbf10cefe014d41558ddba891623cc5174a0 26-Jan-2011 Sylvain Fonteneau <sylvain.fonteneau@trusted-logic.com> am 663c0153: Ensure disconnection from remote peer before sleeping, in P2P mode.

* commit '663c0153d74ddbe8e8ec1f9f55780beafa2543fa':
Ensure disconnection from remote peer before sleeping, in P2P mode.
4ec8f123c0c037830859ff608dda6611e8b40fea 26-Jan-2011 Martijn Coenen <martijn.coenen@nxp.com> am 434bb344: Reconnect() after checking for NdefFormatable().

* commit '434bb34457422a9cad664b73ed0d425db4a3093d':
Reconnect() after checking for NdefFormatable().
e260fc52ed2b4e6e1b7394d6f841d01c98888327 25-Jan-2011 Arnaud Ferir <arnaud.ferir@trusted-logic.com> Stop tag watchdog before disabling NFC.

Change-Id: I0a62d1ee539aa6bf9147bed56055a460b9804aea
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
663c0153d74ddbe8e8ec1f9f55780beafa2543fa 25-Jan-2011 Sylvain Fonteneau <sylvain.fonteneau@trusted-logic.com> Ensure disconnection from remote peer before sleeping, in P2P mode.

Change-Id: I0d8fce569f2e6431fe62a299278a0106c86cda9a
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
434bb34457422a9cad664b73ed0d425db4a3093d 25-Jan-2011 Martijn Coenen <martijn.coenen@nxp.com> Reconnect() after checking for NdefFormatable().

Some tags may be left in an inconsistent or "non-responding" state after we
do NdefFormatable checks. For example, tags that identify as DESfire
but don't support the getVersion() command. To make sure the stack can continue
to work with them, we reconnect().

Change-Id: I2890d3c70cc7cf7d15fb98090a031686d434168d
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
ce119070c30c3dc916f0dde0387656cef738b4d2 25-Jan-2011 Jeff Hamilton <jham@android.com> am 24dbea55: Stop using URIs for ACTION_TECHNOLOGY_DISCOVERED

* commit '24dbea55709219e42aa3b6b6578f29ffd447a786':
Stop using URIs for ACTION_TECHNOLOGY_DISCOVERED
24dbea55709219e42aa3b6b6578f29ffd447a786 24-Jan-2011 Jeff Hamilton <jham@android.com> Stop using URIs for ACTION_TECHNOLOGY_DISCOVERED

The pattern matching wasn't sufficient with the
move to identifying technologies with their class
names so now we use a custom dispatching mechanism.

Change-Id: I3e6379d454458bbb65730ade32cdaa1680c5e339
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
8e1568d6362eae6d91689cb92825a02e14aeba31 25-Jan-2011 Arnaud Ferir <arnaud.ferir@trusted-logic.com> am 7f5487be: Do not disconnect P2P target if connect failed.

* commit '7f5487be0414b1f92b41cc5f7b0b7db846d9b1c9':
Do not disconnect P2P target if connect failed.
37a1e9048d0cf2d48b619e2714f1a98f18d85b24 25-Jan-2011 Arnaud Ferir <arnaud.ferir@trusted-logic.com> am 2436ffe9: Fix tag disconnect.

* commit '2436ffe91853535fad87b7a8e03d8883bae20f20':
Fix tag disconnect.
cee3e95c091ac699566b65c002dcc3f9887a4c30 25-Jan-2011 Martijn Coenen <martijn.coenen@nxp.com> am e08c8939: Don\'t throw NdefFormattable technology when Ndef found.

* commit 'e08c8939be916c393a62b995b2dee438cb8cec2f':
Don't throw NdefFormattable technology when Ndef found.
021a5e4d3c5439caddbebf1c90426914e3b166b6 25-Jan-2011 Jeff Hamilton <jham@android.com> am adb527a9: Make the NDEF intent creation more robust.

* commit 'adb527a9ce286d019d766a3b207a2251dea89bd1':
Make the NDEF intent creation more robust.
695e9199326542edd0898af51abe9aeeb361856a 25-Jan-2011 Jeff Hamilton <jham@android.com> am a1935861: Tweak dispatching a bit.

* commit 'a1935861ea244b45e29b0ec9b6f263de3c08a2d6':
Tweak dispatching a bit.
2b08e833a33e20c730995a20d023b1452b80c3c6 24-Jan-2011 Jeff Hamilton <jham@android.com> am 0c322dc2: Update to the new APIs.

* commit '0c322dc2d942285bfcd9fe5c0bba1a5f36a967f5':
Update to the new APIs.
7f5487be0414b1f92b41cc5f7b0b7db846d9b1c9 19-Jan-2011 Arnaud Ferir <arnaud.ferir@trusted-logic.com> Do not disconnect P2P target if connect failed.

If the P2P target connect failed, the P2P target disconnect cannot be done.
However the polling loop must be restarted. This is already done in JNI layer
by the failing connect itself.

Change-Id: I1c3323e4c038c8133e7b6e16b3a238c050427cfc
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
2436ffe91853535fad87b7a8e03d8883bae20f20 24-Jan-2011 Arnaud Ferir <arnaud.ferir@trusted-logic.com> Fix tag disconnect.

This patch fixes the tag disconnect sequence in 2 cases:

1.
When the NFC service disconnects a tag because it is not needed anymore, the
disconnection should be effective immediately and not delayed until the tag is
removed from the field. The NFC service is responsible for discovering again
the same tag if the polling loop is restarted.
The looping "presence check" in native code is then removed.

2.
Before the screen is turned off, the polling loop configuration and - if any
tag is present - the tag disconnection must be done accordingly to the "normal"
tag management. In particular the watchdog must be stopped properly.

Change-Id: I58ee27cede110c419052b4eef07f1e4bd35ae208
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
e08c8939be916c393a62b995b2dee438cb8cec2f 24-Jan-2011 Martijn Coenen <martijn.coenen@nxp.com> Don't throw NdefFormattable technology when Ndef found.

libNFC doesn't support formatting tags that are already NDEF formatted. This
needs to be fixed in libNFC, but as a temporary work-around we will only
throw the NdefFormattable technology if no NDEF has been found on the tag.

Change-Id: I487b875de5fd66fdfec2d1b9c30fa886d8ca1477
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
adb527a9ce286d019d766a3b207a2251dea89bd1 24-Jan-2011 Jeff Hamilton <jham@android.com> Make the NDEF intent creation more robust.

There are lots of ways things could go
wrong when faced with invalid NDEF data
so just got for the catch-all and handle
it properly.

Change-Id: Ia762c8e337aef8fed867beab8159e6ed05bbacea
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
a1935861ea244b45e29b0ec9b6f263de3c08a2d6 23-Jan-2011 Jeff Hamilton <jham@android.com> Tweak dispatching a bit.

Foreground dispatch overrides now interpret
null for the filters as "catch all".

Foreground NDEF push disables standard dispatch
and only honors foreground dispatching so that
two NDEF push apps don't end up just swapping
between each other when the push happens.

Change-Id: Ic305d4a3a593fff732b8d88ae72e09b4a03d6286
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
674c9cf34f06fc678f5e17277029efef2d3bc27b 23-Jan-2011 Nick Pelly <npelly@google.com> am 33eb941f: Merge "Fix 4 second latency starting Tag application when recently using home." into gingerbread

* commit '33eb941f83d64ff14cbf6fa0a0fbe8f48eead2f4':
Fix 4 second latency starting Tag application when recently using home.
a3c8f740d9ab043f63f6a3c01639c9d857d4de37 22-Jan-2011 Martijn Coenen <martijn.coenen@nxp.com> am 9d5511f2: Support for TagLostException (NFC service).

* commit '9d5511f2640903a79d24578a12a93e50a96f0c0e':
Support for TagLostException (NFC service).
094b435ea854961fbf707d0ed3e3e32c88067804 22-Jan-2011 Nick Pelly <npelly@google.com> am bfb74ec4: Don\'t catch ClassCastException and NullPointerException.

* commit 'bfb74ec41fe9d2d1ce72467888432f0b3296425f':
Don't catch ClassCastException and NullPointerException.
b4f72e7d27ce85624f1b3db1a922cc93b80d9ede 22-Jan-2011 Sylvain Fonteneau <sylvain.fonteneau@trusted-logic.com> am f5d6f325: Handle error when accessing a closed socket handle.

* commit 'f5d6f3253dca74631ba78c715f224cfa80e61d29':
Handle error when accessing a closed socket handle.
fb3c24ae679ca6f3518602fa87d9e55e1cba3a78 22-Jan-2011 Sylvain Fonteneau <sylvain.fonteneau@trusted-logic.com> am 6efda9f3: Moved LLCP link parameters configuration to NFC service initialization.

* commit '6efda9f3970382554437be037aed863be9889499':
Moved LLCP link parameters configuration to NFC service initialization.
d96af6025ada6862d46997ee6dfa76c3bee453c4 22-Jan-2011 Sylvain Fonteneau <sylvain.fonteneau@trusted-logic.com> am 1878c7b6: Removed workaround for native socket creation limitation.

* commit '1878c7b6e2cef1e52138ee3a5588913cc165faa5':
Removed workaround for native socket creation limitation.
28f988ad89aa2ef40101c04ac747c21fe3a55a74 21-Jan-2011 Nick Pelly <npelly@google.com> am 0c8bb6d5: Merge "Implement IsoDep timeout handling (NFC service)." into gingerbread

* commit '0c8bb6d59be8f44c53c02febcbfe570a891f33a4':
Implement IsoDep timeout handling (NFC service).
0c322dc2d942285bfcd9fe5c0bba1a5f36a967f5 21-Jan-2011 Jeff Hamilton <jham@android.com> Update to the new APIs.

Change-Id: Ic30625a81e1e0a8f01955cd82b2e75ac2571c6d0
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
1a9eca5f84036d7dd3e28000290caa2f641856de 21-Jan-2011 Nick Pelly <npelly@google.com> Fix 4 second latency starting Tag application when recently using home.

The home screen and other system apps call stopAppSwitches() to prevent
malicious applications from starting their activity again when the user exits.
The startActivity() call is delayed by 4 seconds.

We can override this in NFC service because we are a system service, using
resumeAppSwitches(). If a tag comes into the field we really want to show it
immediately. It feels really laggy otherwise.

Change-Id: I5394647f352e3f49f821b5346cd4c9af103137ca
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
9d5511f2640903a79d24578a12a93e50a96f0c0e 17-Jan-2011 Martijn Coenen <martijn.coenen@nxp.com> Support for TagLostException (NFC service).

libNFC has a distinct return code indicating it can no longer communicate
with the tag - usually because it is no longer in the RF field.
Propagating this to the API allows applications to react to this
specific event and provide more detailed feedback to the user.

Change-Id: I9d82c749f56c5aee8e5baef84c17d28e326842f4
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
bfb74ec41fe9d2d1ce72467888432f0b3296425f 19-Jan-2011 Nick Pelly <npelly@google.com> Don't catch ClassCastException and NullPointerException.

Change-Id: I2ae2884d78af8268852c8812a4ff7cfbece6c53a
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
f5d6f3253dca74631ba78c715f224cfa80e61d29 05-Jan-2011 Sylvain Fonteneau <sylvain.fonteneau@trusted-logic.com> Handle error when accessing a closed socket handle.

When an application tries to access a closed socket, the NFC
service will fail to find it in its internal socket table,
returning a null object which is impossible to cast to a
LLCP socket class, generating a ClassCastException.

This patch handle the exception catching, avoiding a service
crash.

Change-Id: I236652b83a51b78fcfe8258402888a74f3144a7f
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
6efda9f3970382554437be037aed863be9889499 21-Dec-2010 Sylvain Fonteneau <sylvain.fonteneau@trusted-logic.com> Moved LLCP link parameters configuration to NFC service initialization.

With the latest libnfc-nxp library, the LLCP socket internals are
initialized when configuring the LLCP link parameters because it
must be the first LLCP function called.

Due to this, these parameters are now set only once at the NFC
service startup instead of each peer discovery.

As a consequence, the NFC Manager initialization now use the
application properties (which contains link parameters) so these
properties are loaded before initialization.

Change-Id: I8e04c3135646a12a48c392d47cb47d09cd234ea1
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
1878c7b6e2cef1e52138ee3a5588913cc165faa5 17-Dec-2010 Sylvain Fonteneau <sylvain.fonteneau@trusted-logic.com> Removed workaround for native socket creation limitation.

Until now, the NFC native library (libnfc-nxp) had some limitations
on the socket life cycle that made impossible to ensure the local server
socket was listening before the remote client was trying to connect.

The RegisteredSocket class was created to workaround this by enabling
socket creation at the Java layer prior to link establishment. This
solution was not fully satisfactory since there were still some race
conditions.

A fix for these limitations has been submitted in the library project
in a commit named "Allow LLCP socket creation before link establishment"
and this patch takes advantage of it to remove the RegisteredSocket
class and all the associated code.

As a consequence, the socket creation methods have been simplified, the
link activation processes is lighter (no need to recreate native sockets
on link activation).

This patch also includes some cleaning (removed unused variables).

Change-Id: I643509d620105ae7d3ba24ea68eae37f05bc6ef3
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
0c8bb6d59be8f44c53c02febcbfe570a891f33a4 18-Jan-2011 Nick Pelly <npelly@google.com> Merge "Implement IsoDep timeout handling (NFC service)." into gingerbread
ea74287b5b97ca87cbe9179f0bedf49c594d2c2c 18-Jan-2011 Jeff Hamilton <jham@android.com> am ca1a86ec: NDEF Push Protocol implementation.

* commit 'ca1a86ecb8edce740a232c3439355e8d5b706e7a':
NDEF Push Protocol implementation.
1b61f1dee91101e249b9be65d95366fa745b3b78 12-Jan-2011 Martijn Coenen <martijn.coenen@nxp.com> Implement IsoDep timeout handling (NFC service).

Added interface to the NFC service for (re-)setting the IsoDep transaction
timeout. Internally, this is mapped to both the ISO XCHG timer and
the HCI watchdog timer in libnfc (see comments in code).

The timers are reset when the application closes the IsoDep technology.
But they must also be reset if the application crashes (and cannot close
the technology). To cover these cases, whenever discovery is (re)started or
whenever a tag is disconnected, the timeouts are reset to the default values.

Change-Id: I596ef311c3c3b21666b487d16a08642e8a6fc4af
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
ca1a86ecb8edce740a232c3439355e8d5b706e7a 11-Dec-2010 Jeff Hamilton <jham@android.com> NDEF Push Protocol implementation.

The protocol allows pushing NDEF messages
over LLCP in order to simulate a card read
wihtout having to use card emulation. This
also allows for 2 way transfer of meesages.

The protocol allows for a single immediate
message, to be dispatched upon arrival as if
it were read from a tag, and any number of
deferred dispatch messages. The handling of
deferred dispatch messages is up to the
receiver and not implemented in this patch.

Change-Id: Ib99e4fc01532cc741debab370a417f94669b62ac
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
27c07397f28da30826d405b3b2fb90ba62b0c3da 15-Jan-2011 Martijn Coenen <martijn.coenen@nxp.com> am eb488e0b: Improved accuracy of NDEF_FORMATABLE technology detection.

* commit 'eb488e0b323ec2d4fe03528e2b9f3a73e66ae17d':
Improved accuracy of NDEF_FORMATABLE technology detection.
eb488e0b323ec2d4fe03528e2b9f3a73e66ae17d 10-Jan-2011 Martijn Coenen <martijn.coenen@nxp.com> Improved accuracy of NDEF_FORMATABLE technology detection.

Previously, any ISO14443-4 tag would get the NDEF_FORMATABLE technology,
indicating that a format on these tags is possible. In fact libNFC only
supports formatting the DESFire subset of -4, and MF UL / Classic. These
changes do a check for DESFire before adding the FORMATABLE technology.

Change-Id: Ife15a0bd42e1b024bf262788859c88e4ac1dcabe
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
1128ce43f48ffa9c9e8f87b524cb9dfc07e75e7d 15-Jan-2011 Martijn Coenen <martijn.coenen@nxp.com> am 98eb4249: Fixed presence checking in watchdog.

* commit '98eb4249dcec63009b1839c005f0cf9048e1f7be':
Fixed presence checking in watchdog.
98eb4249dcec63009b1839c005f0cf9048e1f7be 07-Jan-2011 Martijn Coenen <martijn.coenen@nxp.com> Fixed presence checking in watchdog.

The presence check timer is not supposed to run during "other" operations
such as transceive. Previously, the presence check timer was simply reset.
If an operation would take longer than the presence check time to complete,
the presence check would run immediately after the operation has released
the concurrency lock. This is undesirable and not necessary - the app may
want to do a long series of transceives, in which case the presence check
gets in the way and delays the app.

This fix will pause() the watchdog completely, and only resume() when the
presence checking is done.

Change-Id: I06b1ab10c015861415cd91d6d5536d27145a885f
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
d1674be5269269c60236c65fe7d233c218af8a63 13-Jan-2011 Jeff Hamilton <jham@android.com> am 05973d55: Implementation of foreground dispatch overriding.

* commit '05973d55daf68a286c932ee4e7ffbd6bb53789e0':
Implementation of foreground dispatch overriding.
05973d55daf68a286c932ee4e7ffbd6bb53789e0 09-Jan-2011 Jeff Hamilton <jham@android.com> Implementation of foreground dispatch overriding.

Change-Id: I1f20036dd45cd6af8f0e2a5199427f403272ee8a
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
a28073ae2688444302e6fa15b016487ec4c17423 13-Jan-2011 daniel_tomas <daniel.tomas@nxp.com> am c9a2ae7c: RF 0N/OFF events management added in the NFC Service

* commit 'c9a2ae7cb238e4c72818d084cba0b05e76cba1ef':
RF 0N/OFF events management added in the NFC Service
c9a2ae7cb238e4c72818d084cba0b05e76cba1ef 07-Jan-2011 daniel_tomas <daniel.tomas@nxp.com> RF 0N/OFF events management added in the NFC Service

Change-Id: Ie32d36949c3520f9ece9bcb3c6f7bab2f9b24023
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
c2a2e969027699f301b4d1282f875f7bc8a516bb 04-Jan-2011 Martijn Coenen <martijn.coenen@nxp.com> am f34ea550: Added getType() to NDEF technology class (NFC service part).

* commit 'f34ea55002a5f7fbe8486c6ab6f4a17481a9558f':
Added getType() to NDEF technology class (NFC service part).
f34ea55002a5f7fbe8486c6ab6f4a17481a9558f 22-Dec-2010 Martijn Coenen <martijn.coenen@nxp.com> Added getType() to NDEF technology class (NFC service part).

Change-Id: I2ac67f2a947704722328e7b2e576b8561e726fa2
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
32e135d9f82fa0051132e16d2bcf37e28624785e 20-Dec-2010 Martijn Coenen <martijn.coenen@nxp.com> am 03ee488a: Implement NDEF makeReadonly().

* commit '03ee488afaa982ce934c5de399db9f9fa88c7d1e':
Implement NDEF makeReadonly().
03ee488afaa982ce934c5de399db9f9fa88c7d1e 16-Dec-2010 Martijn Coenen <martijn.coenen@nxp.com> Implement NDEF makeReadonly().

Change-Id: I2681d7408bfc5b5388eb22dd620ba24a5e26c286
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
62d9da77239a48eba0120c98f65d19a02d9d353b 17-Dec-2010 Martijn Coenen <martijn.coenen@nxp.com> am 0a58617a: Store the libnfc tag type inside the tag object.

* commit '0a58617a63e32d2f43e3aabc705fb7b9de464482':
Store the libnfc tag type inside the tag object.
479fc2466205e4c8ece030baebc8d0cbe92423b2 17-Dec-2010 Martijn Coenen <martijn.coenen@nxp.com> am ae7d8d80: Multi-tag and multi-protocol clean-up and fixes.

* commit 'ae7d8d800ba73502d21e54d1deef16be0f061866':
Multi-tag and multi-protocol clean-up and fixes.
3141a8863038a2a577084d245f9bd474c0a2d1e6 17-Dec-2010 Martijn Coenen <martijn.coenen@nxp.com> am 232eabb7: Check ndef on both protocols of multi-proto if needed.

* commit '232eabb7c6f04506dbf272e06b115178311a57b9':
Check ndef on both protocols of multi-proto if needed.
0a58617a63e32d2f43e3aabc705fb7b9de464482 15-Dec-2010 Martijn Coenen <martijn.coenen@nxp.com> Store the libnfc tag type inside the tag object.

Some functionality in libnfc is different for some technologies
(e.g. reconnect(), transceive()). For these cases, we'll use the libnfc
tag type to deal with them. We don't want to distinguish these cases based on the
Java API technology types, since they may be changed and even mapped to different
libnfc types. Ideally libnfc should abstract this away for us, but that is not
the case now.

Change-Id: I33ea04ca48d16ccf186e3f0882cafdd38a8adb34
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
ae7d8d800ba73502d21e54d1deef16be0f061866 15-Dec-2010 Martijn Coenen <martijn.coenen@nxp.com> Multi-tag and multi-protocol clean-up and fixes.

- The MULTIPLE_TAGS return value from libnfc is now handled:
in case of multiple tags, we just pick and report the first.
- Removed all obsolete calls to nfc_jni_get_nfc_tag_handle;
- Added some safety to CRC checking;
- NfcService interface now allows connecting to a (different) technology;

Still todo:
- Get rid of global reference to connected handle;
- Remove dependency on tech list ordering.

Change-Id: I7176c3c0edf369a8f33f64280dace1c7b1f2b598
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
232eabb7c6f04506dbf272e06b115178311a57b9 13-Dec-2010 Martijn Coenen <martijn.coenen@nxp.com> Check ndef on both protocols of multi-proto if needed.

Change-Id: I04d01ce0c597baaa14d30bb022890e69722e1c87
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
5c0b3fc720cd40ec80994e6236d94c19397bdab3 13-Dec-2010 Sylvain Fonteneau <sylvain.fonteneau@trusted-logic.com> am 1b147b40: Mark link as deactivated before doing anything else.

* commit '1b147b40e00cb6224d07f9185b19e6262c387ed6':
Mark link as deactivated before doing anything else.
f6c56dd92374c62f043aa940777b4036ee08607f 13-Dec-2010 Martijn Coenen <martijn.coenen@nxp.com> am bb78d374: Added support for (re)-connecting to tag technologies.

* commit 'bb78d3749bd0cc3801fdd9d5df06b0f6ee7a400f':
Added support for (re)-connecting to tag technologies.
d298dc7be44f4d8479724060116d11a24acbd059 13-Dec-2010 Jeff Hamilton <jham@android.com> am 3fb30ae5: First pass at advanced NFC tag dispatching APIs and other cleanup.

* commit '3fb30ae5bf51d9ffe6271a345d55905dade8040d':
First pass at advanced NFC tag dispatching APIs and other cleanup.
2fe2ef1c7aed7b3e4f0be51e65631d0a27d2f45a 13-Dec-2010 Martijn Coenen <martijn.coenen@nxp.com> am aae42714: Implemented interface to reconnect to the same tag handle.

* commit 'aae427142dc22e7e419c146bc7748d9daff518e8':
Implemented interface to reconnect to the same tag handle.
af365d3f1af906a581bf0ec92469493ede88b058 13-Dec-2010 Martijn Coenen <martijn.coenen@nxp.com> am 97c6942c: Implemented API and calls into libnfc for raw transceive.

* commit '97c6942c7c7f9df3bb8dbcc01cf7bb6e2e090005':
Implemented API and calls into libnfc for raw transceive.
c68027c1aee4bbb459372f245fd7dfd425359441 13-Dec-2010 Martijn Coenen <martijn.coenen@nxp.com> am 3ba3b108: Store NDEF r/w flags from the capability container in NDEF extras.

* commit '3ba3b10867c36bff57b72ff99c7b56d63d418f3f':
Store NDEF r/w flags from the capability container in NDEF extras.
1b147b40e00cb6224d07f9185b19e6262c387ed6 13-Dec-2010 Sylvain Fonteneau <sylvain.fonteneau@trusted-logic.com> Mark link as deactivated before doing anything else.

Change-Id: I27a2b8742726b7ea49129270afe264248626af55
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
bb78d3749bd0cc3801fdd9d5df06b0f6ee7a400f 13-Dec-2010 Martijn Coenen <martijn.coenen@nxp.com> Added support for (re)-connecting to tag technologies.

- Connect() now takes a technology as an argument.
- NativeNfcTag now knows to which technology it is connected.

The default connected handle is for now always the first in the
tech list; also, NDEF is only checked on the first tech.

Still to be done:
- Check ndef on other techs if not found on first
- Expose the connect(technology) API to the framework
- Fix some calls that still use nfc_jni_get_tag_handle and need to work
on the selected technology instead.
- Get rid of mHandle and the globals for keeping tag handles

Change-Id: If76d4d458565ab0be7ca986c080a59ed8fd0668f
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
3fb30ae5bf51d9ffe6271a345d55905dade8040d 02-Dec-2010 Jeff Hamilton <jham@android.com> First pass at advanced NFC tag dispatching APIs and other cleanup.

Change-Id: I8469af074325fc8731aace1c9681bbddfa55dc89
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
aae427142dc22e7e419c146bc7748d9daff518e8 10-Dec-2010 Martijn Coenen <martijn.coenen@nxp.com> Implemented interface to reconnect to the same tag handle.

This allows applications to reset the "tag" state when they call close().

Change-Id: Iae78d5d0b714b53d52db9a0c21ad084d7a2010ba
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
97c6942c7c7f9df3bb8dbcc01cf7bb6e2e090005 10-Dec-2010 Martijn Coenen <martijn.coenen@nxp.com> Implemented API and calls into libnfc for raw transceive.

Change-Id: Iefd7ddfe2a9e2d32fe48a4c7fc03f2b48fb4b928
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
3ba3b10867c36bff57b72ff99c7b56d63d418f3f 09-Dec-2010 Martijn Coenen <martijn.coenen@nxp.com> Store NDEF r/w flags from the capability container in NDEF extras.

Change-Id: Ib0e16961b376a1d796dc8dc394be80b967119ff2
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
0d5587c2c5b697d92ac20e0dd7356e23c76ad433 08-Dec-2010 Martijn Coenen <martijn.coenen@nxp.com> am 41368d81: Piped through max supported ndef size in NDEF technology extra\'s.

* commit '41368d81f3076ac903693951f1d5cdba756f33fc':
Piped through max supported ndef size in NDEF technology extra's.
41368d81f3076ac903693951f1d5cdba756f33fc 07-Dec-2010 Martijn Coenen <martijn.coenen@nxp.com> Piped through max supported ndef size in NDEF technology extra's.

Change-Id: I74d3197754c7eb769992285e0c9e520c009386a0
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
402a33f3ce18d4f498b183c9a114e7f22c741cc7 08-Dec-2010 Martijn Coenen <martijn.coenen@nxp.com> am 0aac9419: Support for NDEF formatting in the JNI.

* commit '0aac9419555e69512a886a6b7fa6ce2d1947c72f':
Support for NDEF formatting in the JNI.
0aac9419555e69512a886a6b7fa6ce2d1947c72f 08-Dec-2010 Martijn Coenen <martijn.coenen@nxp.com> Support for NDEF formatting in the JNI.

Change-Id: I96ef383d18392dccd2fc765bc48941a43eea4420
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
235b6feb2386a060dc83e0236ac0bcd9f708c7f0 08-Dec-2010 Martijn Coenen <martijn.coenen@nxp.com> am bea54e32: Add collapsed ndef technology to the techlist.

* commit 'bea54e32a10b917cf0589f1bf413c21e8a4ad57e':
Add collapsed ndef technology to the techlist.
bea54e32a10b917cf0589f1bf413c21e8a4ad57e 07-Dec-2010 Martijn Coenen <martijn.coenen@nxp.com> Add collapsed ndef technology to the techlist.

Store the ndef message read in the tech extras. This can be
easily extended to support multiple ndef entries in the techlist.

Change-Id: I6d9a25d1d69e6c90296075b7ed50b40e37d7fd40
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
1e5fe1dd2f4fefa2ac148d02dbcde302e06dd12c 06-Dec-2010 Nick Pelly <npelly@google.com> am f7c313ae: Merge branch gingerbread-nfc into gingerbread.

* commit 'f7c313ae5eb35d68f4d480721c44aa30fa167279': (34 commits)
Fixed error reporting in LLCP receive method.
Fixed error case where dynamic semaphore was not released.
Restart MyTag server if LLCP accept() fails.
Handle errors in LLCP accept() method.
Added traces in JNI list utility.
Revert "Deliver tag in clean state to user app"
Fix to have poll/activation bytes only returned after a connect.
Make traces in MyTagClient/Server more readable.
Close the LLCP socket in any situation in MyTagClient.
Deliver tag in clean state to user app
Fix to manage the disconnect call in P2P Target mode
Fix exception thrown for Jewel/Topaz on activation bytes.
Added Felica Technology extra's.
Initial support for technology tree based on libnfc return type.
Fixed TAG name in NFC service JNI layer.
Fixed packet size in MyTagClient.
Fix in P2P disconnect and in GetStackCapabilities
Fix trace in llcp_transport_listen_socket_callback
Fix to restart the polling loop when a connect failed in P2P
Fixed context management in CheckLlcp and link status callbacks.
...
28f72bd9880d0b00c486603489d3862733eb638f 30-Nov-2010 Sylvain Fonteneau <sylvain.fonteneau@trusted-logic.com> Fixed error reporting in LLCP receive method.

In this method, reporting that zero bytes have been read means
that an error occured. There is no need for error codes.

Change-Id: I14912effe74375a4bda73c20fa8a42cef7c3ef07
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
206090d29789d1232bb706408ce71e75b68d587d 30-Nov-2010 Martijn Coenen <martijn.coenen@nxp.com> Revert "Deliver tag in clean state to user app"

This fix has some unexpected side effects; reconnecting to ISO15693 tags fails,
and on NfcA tags the first present check after the second connect fails. Until
those issues are fixed, revert this change.
This reverts commit 75e511b45b7c236d32cbb8179ae1ccb7a21e3d21.
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
75e511b45b7c236d32cbb8179ae1ccb7a21e3d21 24-Nov-2010 Jan Brands <jan.r.brands@nxp.com> Deliver tag in clean state to user app

Don't leave behind any selected AIDs and files on ISO7816-4 tags, authenticated
sectors on MIFARE tags, etc.

Change-Id: I18c93a4b50213fc9ed6798a18fa93ab1c7dba042
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
4c631cd2aa3ab422d4f9f3404d6f1fabce7bdf4d 19-Nov-2010 daniel_Tomas <daniel.tomas@trusted-logic.com> Fix to restart the polling loop when a connect failed in P2P

Change-Id: Icaeb2ed76d87da64c88b496ba76295aadeb12a7e
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
0bd11735e8a28db1692f28abcc3e065abae0e8dd 17-Nov-2010 Daniel Tomas <daniel.tomas@trusted-logic.com> Secure Element Access implementation

Change-Id: Ia1c006c52aaf312408ef2fba96715b1b6c382ea9
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
b74200f40f9d4f536b8782974d444f1f9178076f 10-Nov-2010 Jeff Hamilton <jham@android.com> Update to API changes.

Change-Id: I8f52bf20f493581aef80201b4b112af28cf3b5fa
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
09f28764768ce0236cc3faf3dba17b1bbd6c8fdf 18-Nov-2010 Kenny Root <kroot@google.com> Use Boolean's static values instead of new Boolean

Since Boolean can only have two values, there are static versions at
Boolean.TRUE and Boolean.FALSE. They can be acquired through
Boolean.valueOf(...) as well. Use those instead of creating our own
instances.

Change-Id: I38bd356836754ae02df5a622b368cbb8ec7a6fa2
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
a989351c7383aa6b3a6086b10f32c39c1d28fa5d 18-Nov-2010 Jeff Hamilton <jham@android.com> Revert "Fix to disable P2P feature in the NFC Service and JNI"

This reverts commit ae66f8e306a46a24e4121b72b30d8beb5e1c08f9.
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
57d376f1ee1a3939977b95759525585abb9601fb 18-Nov-2010 Jeff Hamilton <jham@android.com> Revert "Remove My Tag support."

This reverts commit 825f01522a1d68cadb634c88101e96f842478926.

Change-Id: I75e027c066ba7bddaab87f910083707d8eb380b0
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
d65348455ae09a467f288d65dbf924fc60c8d290 11-Nov-2010 Jeff Hamilton <jham@android.com> Revert "Remove the My Tag feature."

This reverts commit 1fc06b8d4dfd7e92c43cbd4c5aacf8fa66d181d1.
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
ef92efa7fd86d75cc35465b84e8740f941ff0f0a 04-Nov-2010 Jeff Hamilton <jham@android.com> Quiet most logs in NFC by default.

Bug: 3124915
Change-Id: If5a3e6b21fe43d9ce2ff82ee65751baaa1c0e0a2
Signed-off-by: Nick Pelly <npelly@google.com>
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
52028e699e43e6322021098bbefd761fe6596747 04-Nov-2010 Nick Pelly <npelly@google.com> Don't turn on polling loop at NFC service init if screen is off.

NFC service can be restarted with screen off, and we will be put in
polling loop, or worse constant RF, if this happens with a card in field.

Change-Id: I0b8d2ba04f3af47908586cccf7210d9a7abb5d54
Signed-off-by: Nick Pelly <npelly@google.com>
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
ae66f8e306a46a24e4121b72b30d8beb5e1c08f9 04-Nov-2010 Daniel Tomas <daniel.tomas@trusted-logic.com> Fix to disable P2P feature in the NFC Service and JNI

Change-Id: Ie288273526d9e947545dde134ac1d23399a716c4
Signed-off-by: Nick Pelly <npelly@google.com>
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
533043d1003de2f6a20a29201100d94c3c7bc9ca 04-Nov-2010 Nick Pelly <npelly@google.com> Add wakelock around the disable discovery path during SCREEN_OFF.

We're about to also disconnect from tags during SCREEN_OFF, which can take
some time, so we need to make sure to hold the CPU on.

Change-Id: Ie551c028cecfb49faddc95a45ecd8eac07671968
Signed-off-by: Nick Pelly <npelly@google.com>
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
1fc06b8d4dfd7e92c43cbd4c5aacf8fa66d181d1 03-Nov-2010 Jeff Hamilton <jham@android.com> Remove the My Tag feature.

Change-Id: I4f839d20d2be8c816fffedc9f64292008751a7c1
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
363e40d2df0d838076a68370467c0e3b9a68d4bf 03-Nov-2010 Martijn Coenen <martijn.coenen@nxp.com> Implementation of poll bytes / activation bytes API

Change-Id: I92776225eafd39e0c4dad15b46d5e0ce63f7a991
Signed-off-by: Nick Pelly <npelly@google.com>
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
825f01522a1d68cadb634c88101e96f842478926 03-Nov-2010 Jeff Hamilton <jham@android.com> Remove My Tag support.

Change-Id: Ic8f962879dc8c226b0ac10d2a1d4e41ede5d9326
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
73c77aa23abd50752e450a4cf09a867c2571fbe8 03-Nov-2010 Jason parks <jparks@google.com> Don't show the icon if nfc is disabled and someone sets a tag.

Change-Id: I613e5755dea46e6920ab98621d0f8ffb2feeb358
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
e1fac398523a97e3bcf513393a91478d79a8763f 03-Nov-2010 Sylvain Fonteneau <sylvain.fonteneau@trusted-logic.com> Changed LLCP symmetry timeout back to 1.5s (LTO=150).

The LTO was previously set to 250 as a workaround for performance
issues. This is not needed any more with the current RF speed.

Change-Id: Id236b142d3150203781d00434b93387d925abda5
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
8a16166fdec082ab162bf539be0e3163d4e23af0 03-Nov-2010 Jason parks <jparks@google.com> Hide/show the MyTag icon when NFC is enabled/disabled.

Change-Id: I3ca5e6f90d85fdef262874bd9223ca5f49468af4
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
f63da5f0887eba86d877faaee41dc5dfb8fccd50 03-Nov-2010 Jeff Hamilton <jham@android.com> Don't unregister service sockets when they're created.

This allows services to accept multiple times in
a row.

Change-Id: Ifef474cd753d0481f3a9befce91d2fec869d34ad
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
7fa45a3567dabab6125279ea4566780f04d57a4f 02-Nov-2010 Jeff Hamilton <jham@android.com> Enable My Tag server.

Change-Id: I597e4be9051cc30c4432f90bd8399ae4bdd84b83
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
cdab1112486288ee6ccc9eb5c55456f9618f6b9c 03-Nov-2010 Jeff Hamilton <jham@android.com> Don't disconnect when the peer is the initiator.

Change-Id: Ie56036441ea41d9290d33915e3616e9379f6ea98
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
88f552a4ac37af91db1e0c848df347267fcfb26a 03-Nov-2010 Jason parks <jparks@google.com> Log a warning if the bytes to mytag is 0.

Change-Id: I5cddb343bf0cad13768fb4d6d3d00f82f4205afa
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
15151d5453f9b9b3680cb254ccea42458cc51f33 02-Nov-2010 Jeff Hamilton <jham@android.com> Fixes for My Tag server.

- Record the socket parameters for registered
LLCP service sockets since they're used when
accept() is called before a connection is
active.

- Add a missing break when handling mock NDEF
messages to avoid a crash when a My Tag is
scanned.

- Fix up the accept and read loops in My Tag
server.

Change-Id: Ia994c9dacb5e6770ac5c0f1b5b9e0156eea6e5cb
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
93915e1c6fe6d5d16fcebeda610782bf5812c9b4 02-Nov-2010 Nick Pelly <npelly@google.com> Remove timeout support - it was guaranteed to cause deadlock.

sem_timedwait() was unbalanced.

Also remove more dead code, and reduce watchdog timeout from 10 to 5 seconds.

Change-Id: Ica776e4a27905071c1453b2db02f9ffadf6f9461
Signed-off-by: Nick Pelly <npelly@google.com>
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
d3c57c0c2419d595b8de940254814b5935932b28 01-Nov-2010 Martijn Coenen <martijn.coenen@nxp.com> Fix empty or incorrect ndef message not sending Intent.

Will now send an intent with an empty NDEF message array attached

Change-Id: I58d86c9b5cfff127581824ca6af410a503059cbb
Signed-off-by: Nick Pelly <npelly@google.com>
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
21545af22f9b913ec9cb124287aab2fcb0cf2b3b 02-Nov-2010 Nick Pelly <npelly@google.com> CONCURRENCY_LOCK() cleanup.

Rename functions that need to be called with lock held to _locked().
Remove dead code.
Replace asyncDisconnect() with disconnect() - its broken.

Change-Id: I04feb449394750954e202223366a0fa5ea425924
Signed-off-by: Nick Pelly <npelly@google.com>
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
fa746bcc16d57ff12d373b9139558f5bc7164b30 01-Nov-2010 Jason parks <jparks@google.com> Persist mytag in the service.

Change-Id: Ibd553a01f8790d1f38673bd08f90e3c1a847f727
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
2407a9d01fdc8e48f778d2ef070e75a74d3863c4 28-Oct-2010 Nick Pelly <npelly@google.com> Update NFC for modified API's.

Change-Id: Ibd50e30c7f340eed7c84785d2060a8a237f9cd5b
Signed-off-by: Nick Pelly <npelly@google.com>
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
6f7fd8dbda9092e36e58273e843ae3e4a200e2ff 28-Oct-2010 Jeff Hamilton <jham@android.com> Add more logging of LLCP socket actions.

Change-Id: Ib6e8c642a97abab6592200023c1bb0993d0bfdc0
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
b3cdb6612a057373a61521171d99ce4f24b84e1f 28-Oct-2010 Jeff Hamilton <jham@android.com> Track the LLCP link state as it changes.

Change-Id: I6d7756739489b240e2e27c91a1afd8c5bd534342
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
eead88c5e2bdd34eb33fdf2c76717f9edb9e0396 27-Oct-2010 Jeff Hamilton <jham@android.com> Patch from NXP. Avoid overrun when setting timer.

Change-Id: I9f46908d99d05804cd325024fc60da762f5beb1d
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
4acf84356e35861f7df6d07a2b9ff84842a9f221 27-Oct-2010 Nick Pelly <npelly@google.com> Force NFC service to abort() during emergency_recovery().

emergency_recovery() was not able to kill libnfc threads blocked in mutex,
and was just wedging everything. So instead kill the entire NFC service
process. The framework will immediately restart it, and the NFC API's will
rebind to the new service handle.

Also I cleaned up the code to handle boot complete. This is necessary to clean
up because during recovery restart we do not receive a boot complete event.
It turns out we can use FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT on intent
broadcasts, and avoid having to track boot complete at all.

Change-Id: I41c885b441128fd447d6b8c63bb50a13a1d4cdfd
Signed-off-by: Nick Pelly <npelly@google.com>
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
161f84b5487ce4c1ebef9fe24ba4de00f6f756ea 27-Oct-2010 Nick Pelly <npelly@google.com> Another attempt to mitigate loads-of-ANR-when-NFC-wedges.

Do not even take a mutex in SCREEN_ON/OFF receiver. Just schedule the thread.

Bug: 3131975
Change-Id: Ic8763315c815aff63299f77590e61d668d13031b
Signed-off-by: Nick Pelly <npelly@google.com>
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
1be4eb6d61c4b6e02c5a5cb7ac3b3a68cae7d7a2 26-Oct-2010 Jeff Hamilton <jham@android.com> More work on My Tag.

Change-Id: Iba652af8efdec58d04d5e8e5ecc6af8281f57279
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
db7d865e53c4db049bab20a0bcc7cb596e450d9a 26-Oct-2010 Sylvain Fonteneau <sylvain.fonteneau@trusted-logic.com> Fix bug preventing RawTagConnection and NdefTagConnection clases from working.

Added missing native tag registration in NFC service.

Change-Id: Id470fc93fc83a4b9bde6d0bd78500f50635efb48
Signed-off-by: Nick Pelly <npelly@google.com>
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
df4e65b5dacb313e7d68bad797a843a175febbed 26-Oct-2010 Nick Pelly <npelly@google.com> Fix bug in async-screen-on-off.

Use a boxed boolean, not a primitive boolean.
Use the correct array index.

Change-Id: Id3cd16c8d21b9dacd6d167b0458b6583d7fba89f
Signed-off-by: Nick Pelly <npelly@google.com>
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
7c034a7fe7d36b1ab039af2c44717812ea02657e 26-Oct-2010 Nick Pelly <npelly@google.com> Move NFC adapter configuration off the main thread during SCREEN_ON/OFF events.

These should be safe on the main thread, because they involve configuration of
the local NFC adapter, so it should be very quick. However the NFC stack is
currently wedging frequently, and the resulting ANR's during screen on/screen
off are very disruptive.

Bug: 3131975
Change-Id: I06d3ee17a991a95676666300942054797c6adf00
Signed-off-by: Nick Pelly <npelly@google.com>
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
d0ec3981792e38afd119fc1c995f111f6182f6c8 26-Oct-2010 Jeff Hamilton <jham@android.com> Checkpoint work on My Tag.

The tag server has some problems when being
stopped and the client never gets notified
about the LLCP connection.

Change-Id: Ifdfc60d48ed85a9916f8abb085afcf01dd5a0155
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
3ca6ffff72f4599e80f85de5ae8e7f55012f38d6 25-Oct-2010 Jeff Hamilton <jham@android.com> Show an icon in the status bar when the NfcAdapter is in card emulation mode.

Change-Id: Ia54094291726fa4fac152a49b1b182d73ff9958f
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
65945ad77cadb7a3bdf171497877d2325b23def5 25-Oct-2010 Nick Pelly <npelly@google.com> Turn NFC discovery off when screen is off.

Change-Id: Ib122c9a952f7f41798f7e6b2b8e9884b53e67723
Signed-off-by: Nick Pelly <npelly@google.com>
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
2f8ac1e6cdeb32569bc6477d53a2d0d5608758b1 23-Oct-2010 Nick Pelly <npelly@google.com> Start NFC service at Application load time.

- starting at app onCreate() is about 6 seconds before BOOT_COMPLETE
- enable hardware immediately, but do not send any intents until
BOOT_COMPLETE (using mBootComplete to guard).
- add mutex's around some fields that needed it

The fields that are still not thread-safe were non-trivial to fix.

Change-Id: Id1c2bf535610ac594a33d84fe9a32d01d698a321
Signed-off-by: Nick Pelly <npelly@google.com>
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
f348bf5b21c5c39d7b3627327db1e61007d07539 23-Oct-2010 Nick Pelly <npelly@google.com> Don't catch generic Exception.

The diff might look huge but it's just re-tabbing.

Change-Id: I5a69a2410e7cd29b3e274896eec28f2e1824ebc6
Signed-off-by: Nick Pelly <npelly@google.com>
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
1cf8ba9546ba5204af08b8de2c542b6a1bf8f8a0 22-Oct-2010 Nick Pelly <npelly@google.com> Push Tag/NdefTag implementation details into the service.

Tag/NdefTag objects should just be simple data objects. Push the mapping of
internal tag type to public rawTarget/ndefTarget into Nfc Service.

Change-Id: Ic20da465fb22a4250aa28c4bc14636ccb8d82889
Signed-off-by: Nick Pelly <npelly@google.com>
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
d6fdd3fbb880f1503d56616608e6823b51320dc3 22-Oct-2010 Nick Pelly <npelly@google.com> Don't derefence null pointers.

Also added a comment as per feedback on my TBR last night with jham.

Change-Id: I9472f23acc8e8405c59d095cc17db585711f47ef
Signed-off-by: Nick Pelly <npelly@google.com>
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
2f386c612159a48933c12dbcaf6735bd9ad1c660 21-Oct-2010 Brad Fitzpatrick <bradfitz@android.com> NFC: commit -> apply for shared prefs.

Change-Id: I0c559c584a832cfcbda3d89d61b3622f48b26176
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
f5280191c0e422a730504eebeced4acbcfc1bd9f 21-Oct-2010 Nick Pelly <npelly@google.com> Fix regression where TAG discovery always fails.

I forgot to apply the preferences to the Native Manager.

Change-Id: Idaa09758af45df0b6253d8ad185e29445fbc9e96
Signed-off-by: Nick Pelly <npelly@google.com>
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
b230214bcb557184cb54174889cbede53b92d54f 20-Oct-2010 Sylvain Fonteneau <sylvain.fonteneau@trusted-logic.com> Enable NFC tag presence checking and implement background presence checking.

The background presence checking enables to restart the polling loop if
the application do not release the tag (e.g.: coding or runtime error).
The tag presence will be checked if there is no activity on it during 1s.

The message handler has been moved to the NfcService.java file. It was
previously located in NativeNfcManager,java file for historical reasons.

Change-Id: I3ab5c15c75eb81d2814187b47729859064cf011a
Signed-off-by: Nick Pelly <npelly@google.com>
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
0e6a0a0f50132e14d5ecad61c46e07c67fbb26fb 21-Oct-2010 Nick Pelly <npelly@google.com> NFC Settings cleanup.

Move all NFC settings into shared preferences in NFC service.

Service / Binder / BroadcastReceiver cleanup. Re-enable receivers
for internal intents.

misc cleanup.

Change-Id: I73480faea496f6bede2dfdb6fc682c7e84360326
Signed-off-by: Nick Pelly <npelly@google.com>
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
74180bda362a8bc9d2f701d2c17bec0f63c20bbf 18-Oct-2010 Brad Fitzpatrick <bradfitz@android.com> NFC: send a broadcast on adapater state change

Depends on constants in Ie5dc05e3

This change is necessary for the improved Settings UI, in

Bug: 3097279
Change-Id: Iec9596a6f8c8c6551ea8b5a70ec300c9b50789c5
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
bebaa6cc1a1eb2ce0656e17b0e09ed4747878d8e 18-Oct-2010 Nick Pelly <npelly@google.com> Enforce NFC permission model.

Requires no permissions:
- Viewing UID, type of discovered tags and cards.
- Viewing the NDEF message contents of NDEF formatted tags and cards.

Requires android.permission.NFC
- Get/Set the local tag "MyTag"
- Creating or using a RawTagConnection (transceive())
- Creating or using a NdefTagConnection (write()/read())

Change-Id: I31f2336a81a7151063969f9019da9aaf08092d65
Signed-off-by: Nick Pelly <npelly@google.com>
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
13d8819d9d716c8f0ba03288d058f0bd462d70a7 14-Oct-2010 Nick Pelly <npelly@google.com> Enable NFC service as an application service.

Uses ServiceManager.addService() to register the service.

Uses BOOT_COMPLETE to start the service.

Uses sharedUserId com.android.nfc so that it has a fixed uid.

Uses android:persistant so that the process is not killed.

Change-Id: If4264baf5dc457ee0a3ad5788c5945e84173b1ea
Signed-off-by: Nick Pelly <npelly@google.com>
/packages/apps/Nfc/src/com/android/nfc/NfcService.java
f067256d9556b1e01143f9ae2fd824fa5dc03138 14-Oct-2010 Nick Pelly <npelly@google.com> NFC application.

NFC application contains the NFC service code that implements NFC API and
talks to NFC hardware.

This is the first cut at moving NFC service code out of frameworks/base into
application service. Android.mk are renamed to Android.mk.hide at this commit
because it does not work yet.

Signed-off-by: Nick Pelly <npelly@google.com>
/packages/apps/Nfc/src/com/android/nfc/NfcService.java