aboutsummaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorGaurav Singhal <gsinghal@codeaurora.org>2019-07-02 13:26:05 +0530
committerGaurav Singhal <gsinghal@codeaurora.org>2019-07-02 13:26:05 +0530
commitd1f15da576686b78add1de4bff2a2b512d5a878a (patch)
treeb32ec25867087a05efa8c79c32bb1362ffd8d2f3 /src/com
parentf0a7b1a101ca53ef2512a3edc2820874671626d7 (diff)
parent3fc8f917078bcd8de801ca9f5d0ad54ca9cf8735 (diff)
downloadandroid_vendor_nxp_opensource_packages_apps_Nfc-d1f15da576686b78add1de4bff2a2b512d5a878a.tar.gz
android_vendor_nxp_opensource_packages_apps_Nfc-d1f15da576686b78add1de4bff2a2b512d5a878a.tar.bz2
android_vendor_nxp_opensource_packages_apps_Nfc-d1f15da576686b78add1de4bff2a2b512d5a878a.zip
NFC: Merge branch 'caf/caf/nxpnfc-project/br_android_ncihalx_q' into nfc.sys.lnx.1.0
* caf/caf/nxpnfc-project/br_android_ncihalx_q: (32 commits) Fix for multiple protocol entries present during dual UICC switch. During dual UICC switch , multiple ISO-DEP protocol is found in routing table.The entries are merged in registerProtoEntries function and set again. The ORRing of protocol in JNI layer is removed. Fix for NFC service die observed after tapping multiprotocal tag 3 -4 times. Fix for kovio technology in poll mode. Revert "[artf662124]: Nfc enable and disable API synchronized." Nfc enable and disable API synchronized. Field Detect feature Implementation {Q_AOSP} : Stop statically including legacy-android-test Fix for DUAL UICC switching during Rf session.. Send RAM_TO_FLASH during NFC init. RAM_TO_FLASH command must be sent after HCI initialization during NFC on. This is called before startRfDiscovery during doInitialize in doStartUpConfig. Fix for DEFAULT_FELICA_CLT_PWR_STATE value is not getting updated as defined in conf file Added support for extended NFCEE action notification code cleanup Cleanup APDU pattern related changes Fixed coverity warnings Fixed coverity warnings. {Q-Beta1}: Convert Android.mk file to Android.bp artf667547{Q_Beta2}: Fix beam share preference on policy change Updated UICC precondition check for PreferredSimSlot/selectUicc API. {Q_DP2}: Backward compatibilty for OffHostSecureElements Fix empty AID route power state is wrong in Overflow use case. ... Change-Id: Ie8bf456c2bf812eb076d3cdffcaebd3f3852c64c
Diffstat (limited to 'src/com')
-rwxr-xr-xsrc/com/android/nfc/DeviceHost.java7
-rw-r--r--src/com/android/nfc/NfcService.java145
-rwxr-xr-xsrc/com/android/nfc/cardemulation/AidRoutingManager.java51
-rw-r--r--src/com/android/nfc/cardemulation/CardEmulationManager.java3
-rwxr-xr-xsrc/com/android/nfc/cardemulation/RegisteredAidCache.java50
-rwxr-xr-xsrc/com/android/nfc/cardemulation/RegisteredServicesCache.java18
6 files changed, 64 insertions, 210 deletions
diff --git a/src/com/android/nfc/DeviceHost.java b/src/com/android/nfc/DeviceHost.java
index 37c03179..67992416 100755
--- a/src/com/android/nfc/DeviceHost.java
+++ b/src/com/android/nfc/DeviceHost.java
@@ -269,8 +269,6 @@ public interface DeviceHost {
public int getLfT3tMax();
- public boolean routeApduPattern(int route, int powerState, byte[] apduData, byte[] apduMask);
-
public LlcpConnectionlessSocket createLlcpConnectionlessSocket(int nSap, String sn)
throws LlcpException;
@@ -280,8 +278,6 @@ public interface DeviceHost {
public LlcpSocket createLlcpSocket(int sap, int miu, int rw,
int linearBufferLength) throws LlcpException;
- public boolean unrouteApduPattern(byte[] apduData);
-
public boolean doCheckLlcp();
public boolean doActivateLlcp();
@@ -363,5 +359,6 @@ public interface DeviceHost {
public int doselectUicc(int uiccSlot);
public int doGetSelectedUicc();
public int setPreferredSimSlot(int uiccSlot);
-
+ public int doSetFieldDetectMode(boolean mode);
+ public boolean isFieldDetectEnabled();
}
diff --git a/src/com/android/nfc/NfcService.java b/src/com/android/nfc/NfcService.java
index f74eb440..2d1b68a5 100644
--- a/src/com/android/nfc/NfcService.java
+++ b/src/com/android/nfc/NfcService.java
@@ -187,12 +187,11 @@ public class NfcService implements DeviceHostListener {
static final int MSG_ETSI_SWP_TIMEOUT = 50;
static final int MSG_SWP_READER_RESTART = 58;
static final int MSG_SE_INIT = 59;
- static final int MSG_ROUTE_APDU = 60;
- static final int MSG_UNROUTE_APDU = 61;
static final int MSG_CLEAR_ROUTING = 62;
static final int MSG_INIT_WIREDSE = 63;
static final int MSG_COMPUTE_ROUTING_PARAMS = 64;
static final int MSG_RESET_AND_UPDATE_ROUTING_PARAMS = 65;
+ static final int MSG_DEINIT_WIREDSE = 66;
// Update stats every 4 hours
static final long STATS_UPDATE_INTERVAL_MS = 4 * 60 * 60 * 1000;
static final long MAX_POLLING_PAUSE_TIMEOUT = 40000;
@@ -418,7 +417,8 @@ public class NfcService implements DeviceHostListener {
Class mWiredSeClass;
Method mWiredSeInitMethod, mWiredSeDeInitMethod;
Object mWiredSeObj;
-
+ Class mNfcExtnsClass;
+ Object mNfcExtnsObj;
Class mNfcExtraClass;
Object mNfcExtraObj;
@@ -620,6 +620,20 @@ public class NfcService implements DeviceHostListener {
mContentResolver = mContext.getContentResolver();
mDeviceHost = new NativeNfcManager(mContext, this);
+ try {
+ Object[] objargs = new Object[] {mContext};
+ mNfcExtnsClass = Class.forName("com.android.nfc.NfcExtnsService");
+ Constructor mNfcConstr = mNfcExtnsClass.getDeclaredConstructor(Context.class);
+ mNfcExtnsObj = mNfcConstr.newInstance(objargs);
+ } catch(ClassNotFoundException | IllegalAccessException e) {
+ Log.d(TAG, "NfcExtnsService not found");
+ } catch (InstantiationException e) {
+ Log.e(TAG, "NfcExtnsService object Instantaiation failed");
+ } catch (NoSuchMethodException e ) {
+ Log.e(TAG, " NoSuchMethodException");
+ } catch (InvocationTargetException e) {
+ Log.e(TAG, " InvocationTargetException");
+ }
Object[] args = new Object[] {mDeviceHost, mContext};
try {
mNfcExtraClass = Class.forName("com.android.nfc.NfcAdapterExtrasService");
@@ -950,10 +964,7 @@ public class NfcService implements DeviceHostListener {
mDeviceHost.setPreferredSimSlot(uiccSlot);
nci_version = getNciVersion();
Log.d(TAG, "NCI_Version: " + nci_version);
- if (nci_version == NCI_VERSION_1_0) {
- /*reset default AID route shared preference while enabling NFC*/
- mNxpPrefsEditor.remove("PREF_SET_DEFAULT_ROUTE_ID").commit();
- }
+ mNxpPrefsEditor.remove("PREF_SET_DEFAULT_ROUTE_ID").commit();
if (mIsHceCapable) {
// Generate the initial card emulation routing table
mCardEmulationManager.onNfcEnabled();
@@ -997,18 +1008,7 @@ public class NfcService implements DeviceHostListener {
}
Log.i(TAG, "Disabling NFC");
updateState(NfcAdapter.STATE_TURNING_OFF);
-
- try{
- mWiredSeDeInitMethod = mWiredSeClass.getDeclaredMethod("wiredSeDeInitialize");
- mWiredSeDeInitMethod.invoke(mWiredSeObj);
- } catch (NoSuchElementException | NoSuchMethodException e) {
- Log.i(TAG, "No such Method WiredSeInitialize");
- } catch (RuntimeException | IllegalAccessException | InvocationTargetException e) {
- Log.e(TAG, "Error in invoking wiredSeInitialize invocation");
- } catch (Exception e) {
- Log.e(TAG, "caught Exception during wiredSeInitialize");
- e.printStackTrace();
- }
+ deInitWiredSe();
/* Sometimes mDeviceHost.deinitialize() hangs, use a watch-dog.
* Implemented with a new thread (instead of a Handler or AsyncTask),
* because the UI Thread and AsyncTask thread-pools can also get hung
@@ -1947,6 +1947,18 @@ public class NfcService implements DeviceHostListener {
}
return mDeviceHost.doGetSelectedUicc();
}
+
+ @Override
+ public int setFieldDetectMode(boolean mode) {
+ NfcPermissions.enforceUserPermissions(mContext);
+ return mDeviceHost.doSetFieldDetectMode(mode);
+ }
+
+ @Override
+ public boolean isFieldDetectEnabled() {
+ NfcPermissions.enforceUserPermissions(mContext);
+ return mDeviceHost.isFieldDetectEnabled();
+ }
}
final class ReaderModeDeathRecipient implements IBinder.DeathRecipient {
@@ -2401,10 +2413,7 @@ public class NfcService implements DeviceHostListener {
boolean _nfcEeReset() throws IOException {
synchronized (NfcService.this) {
- if (!isNfcEnabledOrShuttingDown()) {
- throw new IOException("NFC adapter is disabled");
- }
- return mSecureElement.doReset(EE_HANDLE_0xF3);
+ return mSecureElement.doReset(EE_HANDLE_0xF3);
}
}
@@ -2616,7 +2625,7 @@ public class NfcService implements DeviceHostListener {
TechSeId = (techRoute >> ROUTE_LOC_MASK);
TechFSeId = (techfRoute >> ROUTE_LOC_MASK);
/* Technology types are masked internally depending on the capability of SE */
- if(TechSeId == TechFSeId)
+ if(techRoute == techfRoute)
{
TechRoute = 0x07;
mDeviceHost.setRoutingEntry(TECH_ENTRY,TechRoute, TechSeId, techRoute & 0x3F);
@@ -2755,7 +2764,6 @@ public class NfcService implements DeviceHostListener {
"please disable other servives in Settings Menu", 20);
Log.d(TAG, "notify aid routing table full to the user here");
- ComponentName prevPaymentComponent = mAidCache.getPreviousPreferredPaymentService();
mNxpPrefsEditor = mNxpPrefs.edit();
mNxpPrefsEditor.putInt("PREF_SET_AID_ROUTING_TABLE_FULL",0x01);
mNxpPrefsEditor.commit();
@@ -2766,7 +2774,6 @@ public class NfcService implements DeviceHostListener {
Log.d(TAG, "notify aid routing table full to the user");
}
mContext.sendBroadcastAsUser(aidTableFull, UserHandle.CURRENT);
- mAidCache.setPreviousPreferredPaymentService(null);
}
public void routeAids(String aid, int route, int aidInfo, int power) {
@@ -2807,25 +2814,6 @@ public class NfcService implements DeviceHostListener {
sendMessage(MSG_UNROUTE_AID, aid);
}
- public void routeApduPattern(String apdu, String mask ,int route, int powerState) {
- Message msg = mHandler.obtainMessage();
- msg.what = MSG_ROUTE_APDU;
- msg.arg1 = route;
- msg.arg2 = powerState;
- Bundle apduPatternbundle = new Bundle();
- apduPatternbundle.putString("apduData",apdu);
- apduPatternbundle.putString("apduMask",mask);
- msg.setData(apduPatternbundle);
- mHandler.sendMessage(msg);
- }
-
- public void unrouteApduPattern(String apdu) {
- Message msg = mHandler.obtainMessage();
- msg.what = MSG_UNROUTE_APDU;
- msg.obj = apdu;
- mHandler.sendMessage(msg);
- }
-
public int getNciVersion() {
return mDeviceHost.getNciVersion();
}
@@ -2873,6 +2861,10 @@ public class NfcService implements DeviceHostListener {
Log.d(TAG, "Init wired Se");
mHandler.sendEmptyMessage(MSG_INIT_WIREDSE);
}
+ public void deInitWiredSe() {
+ Log.d(TAG, "DeInit wired Se");
+ mHandler.sendEmptyMessage(MSG_DEINIT_WIREDSE);
+ }
/**
* get default Aid route entry in case application does not configure this route entry
*/
@@ -3102,20 +3094,10 @@ public class NfcService implements DeviceHostListener {
break;
}
case MSG_COMMIT_ROUTING: {
- boolean commit = false;
Log.d(TAG, "commitRouting >>>");
- synchronized (NfcService.this) {
- int defaultRoute=mNxpPrefs.getInt("PREF_SET_DEFAULT_ROUTE_ID", GetDefaultRouteEntry());
- mDeviceHost.setEmptyAidRoute(defaultRoute >> ROUTE_LOC_MASK);
- if (mCurrentDiscoveryParameters.shouldEnableDiscovery()) {
- commit = true;
- } else {
- Log.d(TAG, "Not committing routing because discovery is disabled.");
- }
- }
- if (commit) {
- mDeviceHost.commitRouting();
- }
+ int defaultRoute=mNxpPrefs.getInt("PREF_SET_DEFAULT_ROUTE_ID", GetDefaultRouteEntry());
+ mDeviceHost.setEmptyAidRoute(defaultRoute >> ROUTE_LOC_MASK);
+ mDeviceHost.commitRouting();
break;
}
case MSG_RESET_AND_UPDATE_ROUTING_PARAMS: {
@@ -3420,26 +3402,7 @@ public class NfcService implements DeviceHostListener {
}
break;
- case MSG_ROUTE_APDU:{
- int route = msg.arg1;
- int power = msg.arg2;
- String apduData = null;
- String apduMask = null;
- Bundle dataBundle = msg.getData();
- if (dataBundle != null) {
- apduData = dataBundle.getString("apduData");
- apduMask = dataBundle.getString("apduMask");
- }
- // Send the APDU
- if(apduData != null && dataBundle != null)
- mDeviceHost.routeApduPattern(route, power, hexStringToBytes(apduData) ,hexStringToBytes(apduMask));
- break;
- }
- case MSG_UNROUTE_APDU: {
- String apdu = (String) msg.obj;
- mDeviceHost.unrouteApduPattern(hexStringToBytes(apdu));
- break;
- }
+
case MSG_INIT_WIREDSE: {
try {
mWiredSeInitMethod = mWiredSeClass.getDeclaredMethod("wiredSeInitialize");
@@ -3454,6 +3417,20 @@ public class NfcService implements DeviceHostListener {
}
break;
}
+ case MSG_DEINIT_WIREDSE: {
+ try {
+ mWiredSeInitMethod = mWiredSeClass.getDeclaredMethod("wiredSeDeInitialize");
+ mWiredSeInitMethod.invoke(mWiredSeObj);
+ } catch (NoSuchElementException | NoSuchMethodException e) {
+ Log.i(TAG, "No such Method wiredSeDeInitialize");
+ } catch (RuntimeException | IllegalAccessException | InvocationTargetException e) {
+ Log.e(TAG, "Error in invoking wiredSeDeInitialize invocation");
+ } catch (Exception e) {
+ Log.e(TAG, "caught Exception during wiredSeDeInitialize");
+ e.printStackTrace();
+ }
+ break;
+ }
default:
Log.e(TAG, "Unknown message received");
break;
@@ -3917,18 +3894,8 @@ public class NfcService implements DeviceHostListener {
mDeviceHost.dump(fd);
}
}
- /**
- * Update the status of all the services which were populated to commit to routing table
- */
- public void updateStatusOfServices(boolean commitStatus) {
- if(commitStatus == true)
- {
- mAidCache.setPreviousPreferredPaymentService(null);
- }
- mCardEmulationManager.updateStatusOfServices(commitStatus);
- }
- public void updateDefaultAidRouteForNci_1_0(int routeLoc) {
+ public void updateDefaultAidRoute(int routeLoc) {
mNxpPrefsEditor = mNxpPrefs.edit();
Log.d(TAG, "writing to preferences setDefaultAidRouteLoc :" + routeLoc);
if (mNxpPrefs.getInt("PREF_SET_DEFAULT_ROUTE_ID", 0xFF) == routeLoc) {
diff --git a/src/com/android/nfc/cardemulation/AidRoutingManager.java b/src/com/android/nfc/cardemulation/AidRoutingManager.java
index b291ce60..a1339eb0 100755
--- a/src/com/android/nfc/cardemulation/AidRoutingManager.java
+++ b/src/com/android/nfc/cardemulation/AidRoutingManager.java
@@ -214,17 +214,6 @@ public class AidRoutingManager {
}
}
- public boolean configureApduPatternRouting(List<ApduPatternResolveInfo> apduPatternList) {
- NfcService.getInstance().unrouteApduPattern("FFFFFFFFFFFFFFEF");
- if(apduPatternList.size() == 0x00 || apduPatternList == null)
- return false;
- for(ApduPatternResolveInfo apduPatternInfo : apduPatternList) {
- NfcService.getInstance().routeApduPattern(apduPatternInfo.referenceData,apduPatternInfo.mask,
- apduPatternInfo.route,apduPatternInfo.powerState);
- }
- return true;
- }
-
private int getRouteForSecureElement(String se) {
if (se == null || se.length() <= 3) {
return 0;
@@ -240,8 +229,8 @@ public class AidRoutingManager {
if (mOffHostRouteUicc.length >= index && index > 0) {
return mOffHostRouteUicc[index - 1] & 0xFF;
}
- if (mOffHostRouteEse == null && mOffHostRouteUicc == null)
- return mDefaultOffHostRoute;
+ if (mOffHostRouteEse == null && mOffHostRouteUicc == null)
+ return mDefaultOffHostRoute;
}
} catch (NumberFormatException e) {
}
@@ -296,15 +285,7 @@ public class AidRoutingManager {
synchronized (mLock) {
if (routeForAid.equals(mRouteForAid) && !force) {
- if (DBG) Log.d(TAG, "Routing table unchanged, but commit the routing");
- if(mLastCommitStatus == false){
- NfcService.getInstance().updateStatusOfServices(false);
- }
- else
- {/*If last commit status was success, And a new service is added whose AID's are
- already resolved by previously installed services, service state of newly installed app needs to be updated*/
- NfcService.getInstance().updateStatusOfServices(true);
- }
+ if (DBG) Log.d(TAG, "Routing table unchanged, not updating");
return false;
}
@@ -398,19 +379,6 @@ public class AidRoutingManager {
}
}
}
- if(NfcService.getInstance().getNciVersion() != NfcService.getInstance().NCI_VERSION_1_0) {
- String emptyAid = "";
- AidEntry entry = new AidEntry();
- entry.route = mDefaultRoute;
- if(mDefaultRoute==ROUTE_HOST) {
- entry.isOnHost = true;
- } else {
- entry.isOnHost = false;
- }
- entry.aidInfo = RegisteredAidCache.AID_ROUTE_QUAL_PREFIX;
- aidRoutingTableCache.put(emptyAid, entry);
- if (DBG) Log.d(TAG, "Add emptyAid into AidRoutingTable");
- }
if( calculateAidRouteSize(aidRoutingTableCache) <= mMaxAidRoutingTableSize) {
aidRouteResolved = true;
break;
@@ -418,15 +386,11 @@ public class AidRoutingManager {
}
if(aidRouteResolved == true) {
commit(aidRoutingTableCache);
- NfcService.getInstance().updateStatusOfServices(true);
- if (NfcService.getInstance().getNciVersion() == NfcService.NCI_VERSION_1_0) {
- NfcService.getInstance().updateDefaultAidRouteForNci_1_0(mDefaultRoute);
- }
+ NfcService.getInstance().updateDefaultAidRoute(mDefaultRoute);
mLastCommitStatus = true;
} else {
Log.e(TAG, "RoutingTable unchanged because it's full, not updating");
NfcService.getInstance().notifyRoutingTableFull();
- NfcService.getInstance().updateStatusOfServices(false);
mLastCommitStatus = false;
}
}
@@ -472,13 +436,6 @@ public class AidRoutingManager {
return mLastCommitStatus;
}
- final class ApduPatternResolveInfo {
- public String mask;
- public String referenceData;
- public int route;
- public int powerState;
- }
-
public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
pw.println("Routing table:");
pw.println(" Default route: " + ((mDefaultRoute == 0x00) ? "host" : "secure element"));
diff --git a/src/com/android/nfc/cardemulation/CardEmulationManager.java b/src/com/android/nfc/cardemulation/CardEmulationManager.java
index 133849f7..943f63f3 100644
--- a/src/com/android/nfc/cardemulation/CardEmulationManager.java
+++ b/src/com/android/nfc/cardemulation/CardEmulationManager.java
@@ -644,7 +644,4 @@ public class CardEmulationManager implements RegisteredServicesCache.Callback,
int userId = ActivityManager.getCurrentUser();
return mServiceCache.getServices(userId);
}
- public void updateStatusOfServices(boolean commitStatus) {
- mServiceCache.updateStatusOfServices(commitStatus);
- }
}
diff --git a/src/com/android/nfc/cardemulation/RegisteredAidCache.java b/src/com/android/nfc/cardemulation/RegisteredAidCache.java
index 8f2809d6..a3cf204d 100755
--- a/src/com/android/nfc/cardemulation/RegisteredAidCache.java
+++ b/src/com/android/nfc/cardemulation/RegisteredAidCache.java
@@ -63,7 +63,6 @@ public class RegisteredAidCache {
// is authoritative for the current set of services and defaults.
// It is only valid for the current user.
final TreeMap<String, AidResolveInfo> mAidCache = new TreeMap<String, AidResolveInfo>();
- final TreeMap<String, ServiceApduInfo> mapduPatternList= new TreeMap<String, ServiceApduInfo>();
//FIXME: directly use the declaration in ApduServerInfo in framework
static final int POWER_STATE_SWITCH_ON = 1;
static final int POWER_STATE_SWITCH_OFF = 2;
@@ -110,10 +109,6 @@ public class RegisteredAidCache {
}
}
- final class ServiceApduInfo {
- NfcApduServiceInfo service;
- NfcAidGroup.ApduPattern apdu;
- }
// Represents a list of services, an optional default and a category that
// an AID was resolved to.
final class AidResolveInfo {
@@ -142,7 +137,6 @@ public class RegisteredAidCache {
ComponentName mPreferredPaymentService;
ComponentName mPreferredForegroundService;
- ComponentName mPreviousPreferredPaymentService;
boolean mNfcEnabled = false;
boolean mSupportsPrefixes = false;
boolean mSupportsSubset = false;
@@ -216,9 +210,7 @@ public class RegisteredAidCache {
return resolveInfo;
}
}
- public void setPreviousPreferredPaymentService(ComponentName mPrevPaymentService) {
- mPreviousPreferredPaymentService = mPrevPaymentService;
- }
+
public ComponentName getPreferredPaymentService(){
return mPreferredPaymentService;
}
@@ -420,7 +412,6 @@ public class RegisteredAidCache {
void generateServiceMapLocked(List<NfcApduServiceInfo> services) {
// Easiest is to just build the entire tree again
mAidServices.clear();
- mapduPatternList.clear();
for (NfcApduServiceInfo service : services) {
if (DBG) Log.d(TAG, "generateServiceMap component: " + service.getComponent());
List<String> prefixAids = service.getPrefixAids();
@@ -492,21 +483,6 @@ public class RegisteredAidCache {
mAidServices.put(serviceAidInfo.aid, serviceAidInfos);
}
}
- for(NfcAidGroup group : service.getNfcAidGroups()) {
- ArrayList<NfcAidGroup.ApduPattern> apduPattern = group.getApduPatternList();
- if(apduPattern == null || apduPattern.size() == 0x00)
- continue;
- for(NfcAidGroup.ApduPattern apdu : apduPattern) {
- ServiceApduInfo serviceApduInfo = new ServiceApduInfo();
- serviceApduInfo.apdu = apdu;
- serviceApduInfo.service = service;
- if (mapduPatternList.containsKey(apdu.getreferenceData())) {
- Log.e(TAG," Ignoring APDU pattern which is already registered");
- } else {
- mapduPatternList.put(apdu.getreferenceData(), serviceApduInfo);
- }
- }
- }
}
}
@@ -940,28 +916,9 @@ public class RegisteredAidCache {
routingEntries.put(aid, aidType);
}
}
- addApduPatternEntries();
mRoutingManager.configureRouting(routingEntries, force);
}
- public void addApduPatternEntries() {
- List<AidRoutingManager.ApduPatternResolveInfo> apduPatternRouting = new ArrayList<AidRoutingManager.ApduPatternResolveInfo>();
- for(Map.Entry<String , ServiceApduInfo> entry : mapduPatternList.entrySet()) {
- AidRoutingManager.ApduPatternResolveInfo apduEntry = mRoutingManager.new ApduPatternResolveInfo();
- NfcApduServiceInfo service = entry.getValue().service;
- NfcApduServiceInfo.ESeInfo seInfo = service.getSEInfo();
-
- apduEntry.referenceData = entry.getValue().apdu.getreferenceData();
- apduEntry.mask = entry.getValue().apdu.getMask();
- apduEntry.route = seInfo.getSeId();
- apduEntry.powerState = seInfo.getPowerState() & POWER_STATE_ALL;
- apduEntry.powerState |= SCREEN_STATE_ON_LOCKED | SCREEN_STATE_OFF_UNLOCKED | SCREEN_STATE_OFF_LOCKED;
-
- apduPatternRouting.add(apduEntry);
- }
- mRoutingManager.configureApduPatternRouting(apduPatternRouting);
- }
-
public void onServicesUpdated(int userId, List<NfcApduServiceInfo> services) {
if (DBG) Log.d(TAG, "onServicesUpdated");
synchronized (mLock) {
@@ -979,13 +936,10 @@ public class RegisteredAidCache {
if (DBG) Log.d(TAG, "Preferred payment service changed.");
synchronized (mLock) {
mPreferredPaymentService = service;
- mPreviousPreferredPaymentService = mPreferredPaymentService;
generateAidCacheLocked();
}
}
- public ComponentName getPreviousPreferredPaymentService() {
- return mPreviousPreferredPaymentService;
- }
+
public void onPreferredForegroundServiceChanged(ComponentName service) {
if (DBG) Log.d(TAG, "Preferred foreground service changed.");
synchronized (mLock) {
diff --git a/src/com/android/nfc/cardemulation/RegisteredServicesCache.java b/src/com/android/nfc/cardemulation/RegisteredServicesCache.java
index ede16b1c..2e7a8e7a 100755
--- a/src/com/android/nfc/cardemulation/RegisteredServicesCache.java
+++ b/src/com/android/nfc/cardemulation/RegisteredServicesCache.java
@@ -935,22 +935,4 @@ public class RegisteredServicesCache {
}
pw.println("");
}
-
- public void updateStatusOfServices(boolean commitStatus) {
- final UserServices userServices = mUserServices.get(ActivityManager.getCurrentUser());
- if (userServices != null && userServices.services != null) {
- for (NfcApduServiceInfo serviceInfo : userServices.services.values()) {
- if (!serviceInfo.hasCategory(CardEmulation.CATEGORY_OTHER)) {
- continue;
- }
- serviceInfo.updateServiceCommitStatus(CardEmulation.CATEGORY_OTHER, commitStatus);
- }
- Log.e(TAG,
- "3" + Thread.currentThread().getStackTrace()[2].getMethodName()
- + ":WriteServiceStateToFile");
- writeServiceStateToFile(ActivityManager.getCurrentUser());
- } else {
- Log.e(TAG, "updateStatusOfServices failed... ");
- }
- }
}