Merge "resolved conflicts for merge of 3d06b1e0
to honeycomb-plus-aosp" into honeycomb-plus-aosp
This commit is contained in:
@ -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"
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -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.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user