Changed technology close() to reconnect to the tag instead of physical disconnect.

Change-Id: I8935e4aae452adeec472c0b3ff3c77f1400a264e
This commit is contained in:
Martijn Coenen
2010-12-10 11:54:26 -08:00
committed by Jeff Hamilton
parent fc5a3b6cfb
commit b79173f660
2 changed files with 5 additions and 1 deletions

View File

@ -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);

View File

@ -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);
}