Skip to content

Commit b79173f

Browse files
Martijn Coenenjham
authored andcommitted
Changed technology close() to reconnect to the tag instead of physical disconnect.
Change-Id: I8935e4aae452adeec472c0b3ff3c77f1400a264e
1 parent fc5a3b6 commit b79173f

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

core/java/android/nfc/INfcTag.aidl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ interface INfcTag
2525
{
2626
int close(int nativeHandle);
2727
int connect(int nativeHandle);
28+
int reconnect(int nativeHandle);
2829
int[] getTechList(int nativeHandle);
2930
byte[] getUid(int nativeHandle);
3031
boolean isNdef(int nativeHandle);

core/java/android/nfc/technology/BasicTagTechnology.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,10 @@ public void connect() throws IOException {
162162
public void close() {
163163
mIsConnected = false;
164164
try {
165-
mTagService.close(mTag.getServiceHandle());
165+
/* Note that we don't want to physically disconnect the tag,
166+
* but just reconnect to it to reset its state
167+
*/
168+
mTagService.reconnect(mTag.getServiceHandle());
166169
} catch (RemoteException e) {
167170
attemptDeadServiceRecovery(e);
168171
}

0 commit comments

Comments
 (0)