am a71354d7: Enable presence check at application level using RawTagConnection.isConnected() method.

Merge commit 'a71354d76689802152c33af257092d639c03c421' into gingerbread-plus-aosp

* commit 'a71354d76689802152c33af257092d639c03c421':
  Enable presence check at application level using
This commit is contained in:
Sylvain Fonteneau
2010-10-21 09:38:49 -07:00
committed by Android Git Automerger
2 changed files with 11 additions and 4 deletions

View File

@ -28,6 +28,7 @@ interface INfcTag
String getType(int nativeHandle);
byte[] getUid(int nativeHandle);
boolean isNdef(int nativeHandle);
boolean isPresent(int nativeHandle);
byte[] transceive(int nativeHandle, in byte[] data);
int getLastError(int nativeHandle);

View File

@ -95,10 +95,16 @@ public class RawTagConnection {
* returns true.
*/
public boolean isConnected() {
// TODO(nxp): update mIsConnected when tag goes out of range -
// but do not do an active prescence check in
// isConnected()
return mIsConnected;
if (!mIsConnected) {
return false;
}
try {
return mTagService.isPresent(mTag.mNativeHandle);
} catch (RemoteException e) {
Log.e(TAG, "NFC service died", e);
return false;
}
}
/**