History log of /packages/apps/Nfc/src/com/android/nfc/DeviceHost.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
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/DeviceHost.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/DeviceHost.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/DeviceHost.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/DeviceHost.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/DeviceHost.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/DeviceHost.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/DeviceHost.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/DeviceHost.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/DeviceHost.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/DeviceHost.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/DeviceHost.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/DeviceHost.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/DeviceHost.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/DeviceHost.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/DeviceHost.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/DeviceHost.java
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/DeviceHost.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/DeviceHost.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/DeviceHost.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/DeviceHost.java
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/DeviceHost.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/DeviceHost.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/DeviceHost.java
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/DeviceHost.java
5438ab0e17064e20870ac893a2dd2b9e1219eef1 18-Aug-2011 Nick Pelly <npelly@google.com> 0-click UI update

o New start sound
o Vibrate only when
- starting send
- send success
- receive success
o Play sound only when
- starting send
- send success
- send failure (out of range before complete)
- receive success
o Introduce HoldingItWrongUi with the new image
o P2pAnimationActivity -> SendUi, and a huge cleanup of it
- no longer an activity. It took 350ms to inflate the views on
first onCreate() as an activity, but we can cache this ahead
of time as a window.
- Use ObjectAnimator instead of ViewAnimator, much less code
o Use ACCELEROMETER instead of GRAVITY to get faster tilt detection.

TODO (in order of priority)
o LLCP has started crashing a lot again. About 1/10 times I come into
P2P range the stack crashes now on my Nexus S TMO.
At first I thought it was because I was doing animations during LLCP
send, which might affect timing to pn544 due to CPU load. So I changed
my first implementation (one animation) to split it into a pre-send
and post-send, so we don't do any work during the actual send. Still
seems to crash though. We really need to make it solid again.
o Change notification text and settings text+image as per Rachel's email
o Do some simple low-pass filter on ACCELEROMETER so we don't get caught
out when the user shakes the phone
o Plumb through a starting receive callback, and play sound + vibrate
o Prevent touch during send animations. Not a big deal right now because
we complete it so fast.
o Prevent notification shade from being pulled during HoldingItWrongUi
and SendUi
o Prevent orientation change during SendUi

Change-Id: Ieec1efb741244c68270e34a712c15c58621b1446
/packages/apps/Nfc/src/com/android/nfc/DeviceHost.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/DeviceHost.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/DeviceHost.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/DeviceHost.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/DeviceHost.java