summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorPuneet Mishra <puneetm@codeaurora.org>2015-11-24 14:37:38 +0000
committerGerrit Code Review <gerrit@cyanogenmod.org>2016-05-23 07:56:39 -0700
commit20e7bcc0e947c424cba0ac26eeab49c2c6b35168 (patch)
tree2bcda0137dc059d40a7a85352d07fbc65f9c00d7 /core
parentcb48836d7c007cadc848ffe5f37c79068fbe62ea (diff)
downloadframeworks_base-20e7bcc0e947c424cba0ac26eeab49c2c6b35168.zip
frameworks_base-20e7bcc0e947c424cba0ac26eeab49c2c6b35168.tar.gz
frameworks_base-20e7bcc0e947c424cba0ac26eeab49c2c6b35168.tar.bz2
frameworks/base: Support for third party NFC features
Integration of below modifications are necessary to support third party NFC software: * a new interface in INfcAdapter.aidl allowing vendor specific extensions and features * a new size for MIFARE Classic tags * a modified constructor to distinguish MIFARE Classic tags from NfcA tags * allowing extensions to AidGroup and changing the protection of the instance variables to package protected Change-Id: Ic11dc68c4ea83262c705ec50b75b5808aa064f82 (integrated from commit 57a001b7851c97d41f042dda643f9a87aa6306e5)
Diffstat (limited to 'core')
-rw-r--r--core/java/android/nfc/INfcAdapter.aidl5
-rw-r--r--core/java/android/nfc/cardemulation/AidGroup.java11
-rw-r--r--core/java/android/nfc/tech/MifareClassic.java6
-rw-r--r--core/java/android/nfc/tech/NfcA.java13
4 files changed, 29 insertions, 6 deletions
diff --git a/core/java/android/nfc/INfcAdapter.aidl b/core/java/android/nfc/INfcAdapter.aidl
index 961a3f4..0107d93 100644
--- a/core/java/android/nfc/INfcAdapter.aidl
+++ b/core/java/android/nfc/INfcAdapter.aidl
@@ -1,4 +1,7 @@
/*
+ * Copyright (c) 2015, The Linux Foundation. All rights reserved.
+ * Not a Contribution.
+ *
* Copyright (C) 2010 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -28,6 +31,7 @@ import android.nfc.INfcTag;
import android.nfc.INfcCardEmulation;
import android.nfc.INfcUnlockHandler;
import android.os.Bundle;
+import android.os.IBinder;
/**
* @hide
@@ -37,6 +41,7 @@ interface INfcAdapter
INfcTag getNfcTagInterface();
INfcCardEmulation getNfcCardEmulationInterface();
INfcAdapterExtras getNfcAdapterExtrasInterface(in String pkg);
+ IBinder getNfcAdapterVendorInterface(in String vendor);
int getState();
boolean disable(boolean saveState);
diff --git a/core/java/android/nfc/cardemulation/AidGroup.java b/core/java/android/nfc/cardemulation/AidGroup.java
index 78a9401..9abf325 100644
--- a/core/java/android/nfc/cardemulation/AidGroup.java
+++ b/core/java/android/nfc/cardemulation/AidGroup.java
@@ -1,6 +1,9 @@
/*
* Copyright (C) 2015 The Android Open Source Project
*
+ * Copyright (c) 2015, The Linux Foundation. All rights reserved.
+ * Not a Contribution.
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -37,7 +40,7 @@ import android.util.Log;
*
* @hide
*/
-public final class AidGroup implements Parcelable {
+public class AidGroup implements Parcelable {
/**
* The maximum number of AIDs that can be present in any one group.
*/
@@ -45,9 +48,9 @@ public final class AidGroup implements Parcelable {
static final String TAG = "AidGroup";
- final List<String> aids;
- final String category;
- final String description;
+ protected List<String> aids;
+ protected String category;
+ protected String description;
/**
* Creates a new AidGroup object.
diff --git a/core/java/android/nfc/tech/MifareClassic.java b/core/java/android/nfc/tech/MifareClassic.java
index 8c92288..302c02d 100644
--- a/core/java/android/nfc/tech/MifareClassic.java
+++ b/core/java/android/nfc/tech/MifareClassic.java
@@ -1,4 +1,6 @@
/*
+ * Copyright (C) 2015 NXP Semiconductors
+ * The original Work has been changed by NXP Semiconductors.
* Copyright (C) 2010 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -173,6 +175,10 @@ public final class MifareClassic extends BasicTagTechnology {
mType = TYPE_CLASSIC;
mSize = SIZE_4K;
break;
+ case 0x19:
+ mType = TYPE_CLASSIC;
+ mSize = SIZE_2K;
+ break;
case 0x28:
mType = TYPE_CLASSIC;
mSize = SIZE_1K;
diff --git a/core/java/android/nfc/tech/NfcA.java b/core/java/android/nfc/tech/NfcA.java
index 88730f9..b7fa455 100644
--- a/core/java/android/nfc/tech/NfcA.java
+++ b/core/java/android/nfc/tech/NfcA.java
@@ -1,4 +1,6 @@
/*
+ * Copyright (C) 2015 NXP Semiconductors
+ * The original Work has been changed by NXP Semiconductors.
* Copyright (C) 2010 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -66,8 +68,15 @@ public final class NfcA extends BasicTagTechnology {
/** @hide */
public NfcA(Tag tag) throws RemoteException {
super(tag, TagTechnology.NFC_A);
- Bundle extras = tag.getTechExtras(TagTechnology.NFC_A);
- mSak = extras.getShort(EXTRA_SAK);
+ Bundle extras;
+ mSak = 0;
+ if(tag.hasTech(TagTechnology.MIFARE_CLASSIC))
+ {
+ extras = tag.getTechExtras(TagTechnology.MIFARE_CLASSIC);
+ mSak = extras.getShort(EXTRA_SAK);
+ }
+ extras = tag.getTechExtras(TagTechnology.NFC_A);
+ mSak |= extras.getShort(EXTRA_SAK);
mAtqa = extras.getByteArray(EXTRA_ATQA);
}