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:
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user