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

Commit 0cad3d23 authored by Nick Pelly's avatar Nick Pelly
Browse files

resolved conflicts for merge of a701cf85 to honeycomb-merge

Change-Id: I81a63599649a61fc73bf1e7ebcfed4c333903070
parents 50f7830c a701cf85
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -118719,6 +118719,19 @@
 visibility="public"
>
</method>
<method name="setTimeout"
 return="void"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="timeout" type="int">
</parameter>
</method>
<method name="transceive"
 return="byte[]"
 abstract="false"
+3 −0
Original line number Diff line number Diff line
@@ -39,4 +39,7 @@ interface INfcTag
    int ndefMakeReadOnly(int nativeHandle);
    boolean ndefIsWritable(int nativeHandle);
    int formatNdef(int nativeHandle, in byte[] key);

    void setIsoDepTimeout(int timeout);
    void resetIsoDepTimeout();
}
+30 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import android.nfc.NfcAdapter;
import android.nfc.Tag;
import android.os.Bundle;
import android.os.RemoteException;
import android.util.Log;

import java.io.IOException;

@@ -38,6 +39,8 @@ import java.io.IOException;
 * permission.
 */
public final class IsoDep extends BasicTagTechnology {
    private static final String TAG = "NFC";

    /** @hide */
    public static final String EXTRA_HI_LAYER_RESP = "hiresp";
    /** @hide */
@@ -56,6 +59,33 @@ public final class IsoDep extends BasicTagTechnology {
        }
    }

    /**
     * Sets the timeout of an IsoDep transceive transaction in milliseconds.
     * If the transaction has not completed before the timeout,
     * any ongoing {@link BasicTagTechnology#transceive} operation will be
     * aborted and the connection to the tag is lost. This setting is applied
     * only to the {@link Tag} object linked to this technology and will be
     * reset when {@link IsoDep#close} is called.
     * The default transaction timeout is 5 seconds.
     */
    public void setTimeout(int timeout) {
        try {
            mTagService.setIsoDepTimeout(timeout);
        } catch (RemoteException e) {
            Log.e(TAG, "NFC service dead", e);
        }
    }

    @Override
    public void close() {
        try {
            mTagService.resetIsoDepTimeout();
        } catch (RemoteException e) {
            Log.e(TAG, "NFC service dead", e);
        }
        super.close();
    }

    /**
     * Return the historical bytes if the tag is using {@link NfcA}, null otherwise.
     */