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

Commit a71354d7 authored by Sylvain Fonteneau's avatar Sylvain Fonteneau Committed by Nick Pelly
Browse files

Enable presence check at application level using


RawTagConnection.isConnected() method.

Also needs packages/apps/Nfc to be updated.

Change-Id: I726e88853e2c4b348f3b87b7574bc6eded7f5b7c
Signed-off-by: default avatarNick Pelly <npelly@google.com>
parent 7ea5c45e
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;
        }
    }

    /**