From b79173f6602359d00a1a89f4d6505a44d461d796 Mon Sep 17 00:00:00 2001 From: Martijn Coenen Date: Fri, 10 Dec 2010 11:54:26 -0800 Subject: Changed technology close() to reconnect to the tag instead of physical disconnect. Change-Id: I8935e4aae452adeec472c0b3ff3c77f1400a264e --- core/java/android/nfc/INfcTag.aidl | 1 + core/java/android/nfc/technology/BasicTagTechnology.java | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'core/java') diff --git a/core/java/android/nfc/INfcTag.aidl b/core/java/android/nfc/INfcTag.aidl index 69e5bc7..852ab5e 100644 --- a/core/java/android/nfc/INfcTag.aidl +++ b/core/java/android/nfc/INfcTag.aidl @@ -25,6 +25,7 @@ interface INfcTag { int close(int nativeHandle); int connect(int nativeHandle); + int reconnect(int nativeHandle); int[] getTechList(int nativeHandle); byte[] getUid(int nativeHandle); boolean isNdef(int nativeHandle); diff --git a/core/java/android/nfc/technology/BasicTagTechnology.java b/core/java/android/nfc/technology/BasicTagTechnology.java index ba8bd55..a50c10b 100644 --- a/core/java/android/nfc/technology/BasicTagTechnology.java +++ b/core/java/android/nfc/technology/BasicTagTechnology.java @@ -162,7 +162,10 @@ import android.util.Log; public void close() { mIsConnected = false; try { - mTagService.close(mTag.getServiceHandle()); + /* Note that we don't want to physically disconnect the tag, + * but just reconnect to it to reset its state + */ + mTagService.reconnect(mTag.getServiceHandle()); } catch (RemoteException e) { attemptDeadServiceRecovery(e); } -- cgit v1.1