History log of /packages/apps/Nfc/src/com/android/nfc/cardemulation/RegisteredAidCache.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
50c2629198d9302d2d2e2fcbb7e3c863dd7893a4 23-Jan-2015 Martijn Coenen <maco@google.com> Don't allow overlapping AID registrations.

If a service registers a prefix *and* and an
exact AID which falls in the prefix range,
the latter is not ignored as it should be.

Bug: 19144664
Change-Id: Iac0b4e2a7b606483b4d6ae07c9b82045caee84a9
/packages/apps/Nfc/src/com/android/nfc/cardemulation/RegisteredAidCache.java
0ad654d57bf17d73f2a7de5c44c9d69b7b450962 26-Sep-2014 Martijn Coenen <maco@google.com> Fix bugs in AID prefix conflict resolution.

- Should peek() the queue, not poll(), which
would remove an element from it - which is
not always the correct decision.

- Fixes an issue where we don't detect
a conflict between an app asking foreground
preference for an exact AID which conflicts
with a prefix AID of the payment default
(it would only detect exact AID conflicts).

- Fixes not assigning the resolved category
in a few scenarios.

Bug: 16517161
Change-Id: I3fae502a7c39a6e9e5bb056465653f08e73e754f
/packages/apps/Nfc/src/com/android/nfc/cardemulation/RegisteredAidCache.java
bb6da4601c6e106f00b6525d2241ad785dd6019b 19-Sep-2014 Martijn Coenen <maco@google.com> Merge "Remove DBG logging." into lmp-dev
410f4b955283be0187cd2933bdea07c66e101639 19-Sep-2014 Martijn Coenen <maco@google.com> Remove DBG logging.

Bug: 16517161
Change-Id: Idcf53bb7c6e2f68793467b1d4d25bb04068fa5c0
/packages/apps/Nfc/src/com/android/nfc/cardemulation/RegisteredAidCache.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/cardemulation/RegisteredAidCache.java
31208d3ee36f583fd998c89508a3e93bb550cb29 30-Jul-2014 Martijn Coenen <maco@google.com> Support for AID prefix registration.

Bug: 16517161
Change-Id: I8bc58ac0e9fb6684a7ee22d712dbbd91279d4c30
/packages/apps/Nfc/src/com/android/nfc/cardemulation/RegisteredAidCache.java
e6f2dc6731bccc8ea01c8d9d03dd7e90f2c00312 28-May-2014 Martijn Coenen <maco@google.com> Disable HCE debug logging.

Bug: 15194292
Change-Id: Iae790a801cd0676fb14c07ff05e6a3dd49f652d6
/packages/apps/Nfc/src/com/android/nfc/cardemulation/RegisteredAidCache.java
da772582c17e3f5ffe36e4cab3e1ede3cba32060 26-Apr-2014 Martijn Coenen <maco@google.com> HCE/SE foreground support.

- Allow apps to specify a service they'd like to execute while in foreground.
- Refactored code that determines priority into PreferredServices
- Made a generic ForegroundUtils class that use IProcessObserver
to monitor foreground/background state transitions.
- Simplified logic in RegisteredAidCache that determines where an AID goes. Order is:
1) Foreground (if allowed to override)
2) Payment default app
3) Other.
- Added dump() to classes for easier debugging

Change-Id: Idf871ea91d10102b82b170a45b519be98adc9edf
/packages/apps/Nfc/src/com/android/nfc/cardemulation/RegisteredAidCache.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/cardemulation/RegisteredAidCache.java
aead72765abe07bb353817750edffac987b7aa64 09-Jan-2014 Martijn Coenen <maco@google.com> HCE: Stop routing AIDs for non-default payment services.

The logic implemented in KitKat would still route AIDs
for non-default payment services:
1) If there was no AID overlap at all, it would route
AIDs and not ask for any confirmation.
2) If there was AID overlap, it would route AID but
ask the user to confirm to deviate from the default.

In practice this logic is tricky in the transition
scenario we're in, where existing secure-element
based apps may not register their AIDs. This would
cause the conflict-detection mechanism to fail, and
inconsistent behavior to occur.

With this change, only the AIDs of the default selected
payment service are routed. All non-default payment
services won't have their AIDs routed, independent of whether
they are conflicting with the default or not.

Change-Id: Ibc588d7c81f0478a71021064bd63f5f6c91bd2fe
/packages/apps/Nfc/src/com/android/nfc/cardemulation/RegisteredAidCache.java
64470276dd9fbd2676bb6a9fcf554e202a2e1c07 26-Dec-2013 Yuka Anami <yuka.x.anami@sonymobile.com> Fix NPE in RegisteredAidCache

If the specified AID is not matched to any of mAidCache's keys,
the HashMap returns null and then NullPointerException occurs.

Change-Id: I0d97aab0e47a6c6e7cbdb2426173038f4194c457
/packages/apps/Nfc/src/com/android/nfc/cardemulation/RegisteredAidCache.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/cardemulation/RegisteredAidCache.java
8d154680537afa5242edeb98c8f414d6186558cf 04-Oct-2013 Martijn Coenen <maco@google.com> Increase reader mode pull duration.

Also fixed a bug where gActivated is not
properly reset (scenario: turn NFC off
while doing P2P/reader) and moved some
logs to DBG. Will flick the DBG switch
later.

Bug: 10852675
Change-Id: If115ab162ddc4a080166f00cdf5e95ed4da70642
/packages/apps/Nfc/src/com/android/nfc/cardemulation/RegisteredAidCache.java
5b60927762b8512622e5a1d53b93a4b3b49acba2 01-Oct-2013 Martijn Coenen <maco@google.com> Notify NfcService on NFA_DEACTIVATED_EVT.

This event comes when the remote puts us to sleep;
we should notify NfcService in this scenario as well,
so that NfcService in turn can notify HCE applications.

Bug: 10681671
Change-Id: Ice7f33c3385d40793df6f2c5c900ff6d4e7640f3
/packages/apps/Nfc/src/com/android/nfc/cardemulation/RegisteredAidCache.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/cardemulation/RegisteredAidCache.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/cardemulation/RegisteredAidCache.java
a3b2c7944266cbd02afc08ce48ce8259d8a65019 25-Sep-2013 Martijn Coenen <maco@google.com> Latest HCE UX.

Use service description whenever we can.

Bug: 10862185
Bug: 10859925
Change-Id: I1e6f668bec0d2d2e4f96f803ba24ba58088836a3
/packages/apps/Nfc/src/com/android/nfc/cardemulation/RegisteredAidCache.java
6a707e75739696dde62201047158913411e8cd81 12-Sep-2013 Martijn Coenen <maco@google.com> Fix NFCEE access on NCI devices.

Bug: 10690065
Change-Id: I4df41e3197ce8fe0b2fc3f017e78f66968d2692f
/packages/apps/Nfc/src/com/android/nfc/cardemulation/RegisteredAidCache.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/cardemulation/RegisteredAidCache.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/cardemulation/RegisteredAidCache.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/cardemulation/RegisteredAidCache.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/cardemulation/RegisteredAidCache.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/cardemulation/RegisteredAidCache.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/cardemulation/RegisteredAidCache.java