diff options
| -rw-r--r-- | nfc/api/current.txt | 3 | ||||
| -rw-r--r-- | nfc/java/android/nfc/cardemulation/PollingFrame.java | 18 |
2 files changed, 12 insertions, 9 deletions
diff --git a/nfc/api/current.txt b/nfc/api/current.txt index da292a818396..80b2be2567a7 100644 --- a/nfc/api/current.txt +++ b/nfc/api/current.txt @@ -268,10 +268,9 @@ package android.nfc.cardemulation { } @FlaggedApi("android.nfc.nfc_read_polling_loop") public final class PollingFrame implements android.os.Parcelable { - ctor public PollingFrame(int, @Nullable byte[], int, int, boolean); method public int describeContents(); method @NonNull public byte[] getData(); - method public int getTimestamp(); + method public long getTimestamp(); method public boolean getTriggeredAutoTransact(); method public int getType(); method public int getVendorSpecificGain(); diff --git a/nfc/java/android/nfc/cardemulation/PollingFrame.java b/nfc/java/android/nfc/cardemulation/PollingFrame.java index af63a6e4350b..654e8cc574ba 100644 --- a/nfc/java/android/nfc/cardemulation/PollingFrame.java +++ b/nfc/java/android/nfc/cardemulation/PollingFrame.java @@ -16,6 +16,7 @@ package android.nfc.cardemulation; +import android.annotation.DurationMillisLong; import android.annotation.FlaggedApi; import android.annotation.IntDef; import android.annotation.NonNull; @@ -148,7 +149,8 @@ public final class PollingFrame implements Parcelable{ private final int mType; private final byte[] mData; private final int mGain; - private final int mTimestamp; + @DurationMillisLong + private final long mTimestamp; private final boolean mTriggeredAutoTransact; public static final @NonNull Parcelable.Creator<PollingFrame> CREATOR = @@ -180,16 +182,18 @@ public final class PollingFrame implements Parcelable{ * @param type the type of the frame * @param data a byte array of the data contained in the frame * @param gain the vendor-specific gain of the field - * @param timestamp the timestamp in millisecones + * @param timestampMillis the timestamp in millisecones * @param triggeredAutoTransact whether or not this frame triggered the device to start a * transaction automatically + * + * @hide */ public PollingFrame(@PollingFrameType int type, @Nullable byte[] data, - int gain, int timestamp, boolean triggeredAutoTransact) { + int gain, @DurationMillisLong long timestampMillis, boolean triggeredAutoTransact) { mType = type; mData = data == null ? new byte[0] : data; mGain = gain; - mTimestamp = timestamp; + mTimestamp = timestampMillis; mTriggeredAutoTransact = triggeredAutoTransact; } @@ -230,7 +234,7 @@ public final class PollingFrame implements Parcelable{ * frames relative to each other. * @return the timestamp in milliseconds */ - public int getTimestamp() { + public @DurationMillisLong long getTimestamp() { return mTimestamp; } @@ -264,7 +268,7 @@ public final class PollingFrame implements Parcelable{ frame.putInt(KEY_POLLING_LOOP_GAIN, (byte) getVendorSpecificGain()); } frame.putByteArray(KEY_POLLING_LOOP_DATA, getData()); - frame.putInt(KEY_POLLING_LOOP_TIMESTAMP, getTimestamp()); + frame.putLong(KEY_POLLING_LOOP_TIMESTAMP, getTimestamp()); frame.putBoolean(KEY_POLLING_LOOP_TRIGGERED_AUTOTRANSACT, getTriggeredAutoTransact()); return frame; } @@ -273,7 +277,7 @@ public final class PollingFrame implements Parcelable{ public String toString() { return "PollingFrame { Type: " + (char) getType() + ", gain: " + getVendorSpecificGain() - + ", timestamp: " + Integer.toUnsignedString(getTimestamp()) + + ", timestamp: " + Long.toUnsignedString(getTimestamp()) + ", data: [" + HexFormat.ofDelimiter(" ").formatHex(getData()) + "] }"; } } |