Question

I know HCE capability was introduced only in KitKat, but since the entire concept is only at a software level, shouldn't it be possible to explore into the AOSP code and pull out the changes related to HCE and create that as some kind of library so that every Android phone that supports NFC but is lesser than 4.4 can potentially be HCE compatible?

Was it helpful?

Solution

I would assume that it's not that easy. On Android all interaction with the NFC contactless front-end is handled by the NFC system service (which interacts with the NFC interface library (libnfc-nxp or libnfc-nci). The overall NFC stack looks about like this:

+----------------------------------------------------------------+
| App using NFC functionality (reader/writer, peer-to-peer, HCE) |
+----------------------------------------------------------------+
                               |
                               |
+----------------------------------------------------------------+
|               Android NFC API (Framework/Java)                 |
+----------------------------------------------------------------+
|         NFC system service (Java + native components)          |
+----------------------------------------------------------------+
|        NFC interface library (libnfc-n__, native code)         |
+----------------------------------------------------------------+
|                NFC interface driver (Kernel)                   |
+----------------------------------------------------------------+
                               |
                               |
+----------------------------------------------------------------+
|         NFC contactless frontend chip (Broadcom, NXP)          |
+----------------------------------------------------------------+

In order to add HCE, parts of the NFC interface library (?), the NFC system service and the Android NFC API need to be changed. While it should be possible to integrate the relevant code from the API layer to the application and directly interface to the NFC system service, you cannot change the NFC system service (and the libnfc-n__) without modifying the Android operating system itself.

You could, however try to root the device and modify all these components. (The relevant components are all in user-space, so this should not be a problem.) But then you could also directly install Android 4.4+ on that device.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top