Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 82a8a2aa authored by Sylvain Fonteneau's avatar Sylvain Fonteneau Committed by Android Git Automerger
Browse files

am 4fc9ecf2: am a71354d7: Enable presence check at application level using...

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

Merge commit '4fc9ecf2'

* commit '4fc9ecf2':
  Enable presence check at application level using
parents 886fd918 4fc9ecf2
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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);
+10 −4
Original line number Diff line number Diff line
@@ -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;
        }
    }

    /**