Loading nfc/api/current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -268,9 +268,9 @@ package android.nfc.cardemulation { ctor public PollingFrame(int, @Nullable byte[], int, int); method public int describeContents(); method @NonNull public byte[] getData(); method public int getGain(); method public int getTimestamp(); method public int getType(); method public int getVendorSpecificGain(); method public void writeToParcel(@NonNull android.os.Parcel, int); field @NonNull public static final android.os.Parcelable.Creator<android.nfc.cardemulation.PollingFrame> CREATOR; field @FlaggedApi("android.nfc.nfc_read_polling_loop") public static final int POLLING_LOOP_TYPE_A = 65; // 0x41 Loading nfc/java/android/nfc/cardemulation/PollingFrame.java +11 −4 Original line number Diff line number Diff line Loading @@ -157,7 +157,11 @@ public final class PollingFrame implements Parcelable{ mType = frame.getInt(KEY_POLLING_LOOP_TYPE); byte[] data = frame.getByteArray(KEY_POLLING_LOOP_DATA); mData = (data == null) ? new byte[0] : data; if (frame.containsKey(KEY_POLLING_LOOP_GAIN)) { mGain = frame.getByte(KEY_POLLING_LOOP_GAIN); } else { mGain = -1; } mTimestamp = frame.getInt(KEY_POLLING_LOOP_TIMESTAMP); } Loading Loading @@ -194,8 +198,9 @@ public final class PollingFrame implements Parcelable{ /** * Returns the gain representing the field strength of the NFC field when this polling loop * frame was observed. * @return the gain or -1 if there is no gain measurement associated with this frame. */ public int getGain() { public int getVendorSpecificGain() { return mGain; } Loading Loading @@ -227,7 +232,9 @@ public final class PollingFrame implements Parcelable{ public Bundle toBundle() { Bundle frame = new Bundle(); frame.putInt(KEY_POLLING_LOOP_TYPE, getType()); frame.putByte(KEY_POLLING_LOOP_GAIN, (byte) getGain()); if (getVendorSpecificGain() != -1) { frame.putByte(KEY_POLLING_LOOP_GAIN, (byte) getVendorSpecificGain()); } frame.putByteArray(KEY_POLLING_LOOP_DATA, getData()); frame.putInt(KEY_POLLING_LOOP_TIMESTAMP, getTimestamp()); return frame; Loading @@ -236,7 +243,7 @@ public final class PollingFrame implements Parcelable{ @Override public String toString() { return "PollingFrame { Type: " + (char) getType() + ", gain: " + getGain() + ", gain: " + getVendorSpecificGain() + ", timestamp: " + Integer.toUnsignedString(getTimestamp()) + ", data: [" + HexFormat.ofDelimiter(" ").formatHex(getData()) + "] }"; } Loading Loading
nfc/api/current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -268,9 +268,9 @@ package android.nfc.cardemulation { ctor public PollingFrame(int, @Nullable byte[], int, int); method public int describeContents(); method @NonNull public byte[] getData(); method public int getGain(); method public int getTimestamp(); method public int getType(); method public int getVendorSpecificGain(); method public void writeToParcel(@NonNull android.os.Parcel, int); field @NonNull public static final android.os.Parcelable.Creator<android.nfc.cardemulation.PollingFrame> CREATOR; field @FlaggedApi("android.nfc.nfc_read_polling_loop") public static final int POLLING_LOOP_TYPE_A = 65; // 0x41 Loading
nfc/java/android/nfc/cardemulation/PollingFrame.java +11 −4 Original line number Diff line number Diff line Loading @@ -157,7 +157,11 @@ public final class PollingFrame implements Parcelable{ mType = frame.getInt(KEY_POLLING_LOOP_TYPE); byte[] data = frame.getByteArray(KEY_POLLING_LOOP_DATA); mData = (data == null) ? new byte[0] : data; if (frame.containsKey(KEY_POLLING_LOOP_GAIN)) { mGain = frame.getByte(KEY_POLLING_LOOP_GAIN); } else { mGain = -1; } mTimestamp = frame.getInt(KEY_POLLING_LOOP_TIMESTAMP); } Loading Loading @@ -194,8 +198,9 @@ public final class PollingFrame implements Parcelable{ /** * Returns the gain representing the field strength of the NFC field when this polling loop * frame was observed. * @return the gain or -1 if there is no gain measurement associated with this frame. */ public int getGain() { public int getVendorSpecificGain() { return mGain; } Loading Loading @@ -227,7 +232,9 @@ public final class PollingFrame implements Parcelable{ public Bundle toBundle() { Bundle frame = new Bundle(); frame.putInt(KEY_POLLING_LOOP_TYPE, getType()); frame.putByte(KEY_POLLING_LOOP_GAIN, (byte) getGain()); if (getVendorSpecificGain() != -1) { frame.putByte(KEY_POLLING_LOOP_GAIN, (byte) getVendorSpecificGain()); } frame.putByteArray(KEY_POLLING_LOOP_DATA, getData()); frame.putInt(KEY_POLLING_LOOP_TIMESTAMP, getTimestamp()); return frame; Loading @@ -236,7 +243,7 @@ public final class PollingFrame implements Parcelable{ @Override public String toString() { return "PollingFrame { Type: " + (char) getType() + ", gain: " + getGain() + ", gain: " + getVendorSpecificGain() + ", timestamp: " + Integer.toUnsignedString(getTimestamp()) + ", data: [" + HexFormat.ofDelimiter(" ").formatHex(getData()) + "] }"; } Loading