diff options
author | 2016-07-22 00:30:57 +0000 | |
---|---|---|
committer | 2016-07-22 00:30:59 +0000 | |
commit | 3f2b42d9d1a4252db6a19aad9b676c74fa1101c4 (patch) | |
tree | 70bf0c6b6bb57b72ba337e1079de00f9c2f25c89 | |
parent | 57d3de8954e46149538e477ff86294e7b391242b (diff) | |
parent | 04e1a246f93f7935c448336c1d0393d5f114dea8 (diff) |
Merge "[NAN] Fix TlvElement member names - reflect public access. am: e40b4d344e"
-rw-r--r-- | wifi/java/android/net/wifi/nan/TlvBufferUtils.java | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/wifi/java/android/net/wifi/nan/TlvBufferUtils.java b/wifi/java/android/net/wifi/nan/TlvBufferUtils.java index 7ce24d543c94..2c5aab482823 100644 --- a/wifi/java/android/net/wifi/nan/TlvBufferUtils.java +++ b/wifi/java/android/net/wifi/nan/TlvBufferUtils.java @@ -295,75 +295,75 @@ public class TlvBufferUtils { * formatted byte-arrays (i.e. TLV whose Type/T size is 0) the value of * this field is undefined. */ - public int mType; + public int type; /** * The Length (L) field of the current TLV element. */ - public int mLength; + public int length; /** * The Value (V) field - a raw byte array representing the current TLV - * element where the entry starts at {@link TlvElement#mOffset}. + * element where the entry starts at {@link TlvElement#offset}. */ - public byte[] mRefArray; + public byte[] refArray; /** - * The offset to be used into {@link TlvElement#mRefArray} to access the + * The offset to be used into {@link TlvElement#refArray} to access the * raw data representing the current TLV element. */ - public int mOffset; + public int offset; private TlvElement(int type, int length, @Nullable byte[] refArray, int offset) { - mType = type; - mLength = length; - mRefArray = refArray; - mOffset = offset; + this.type = type; + this.length = length; + this.refArray = refArray; + this.offset = offset; } /** * Utility function to return a byte representation of a TLV element of * length 1. Note: an attempt to call this function on a TLV item whose - * {@link TlvElement#mLength} is != 1 will result in an exception. + * {@link TlvElement#length} is != 1 will result in an exception. * * @return byte representation of current TLV element. */ public byte getByte() { - if (mLength != 1) { + if (length != 1) { throw new IllegalArgumentException( - "Accesing a byte from a TLV element of length " + mLength); + "Accesing a byte from a TLV element of length " + length); } - return mRefArray[mOffset]; + return refArray[offset]; } /** * Utility function to return a short representation of a TLV element of * length 2. Note: an attempt to call this function on a TLV item whose - * {@link TlvElement#mLength} is != 2 will result in an exception. + * {@link TlvElement#length} is != 2 will result in an exception. * * @return short representation of current TLV element. */ public short getShort() { - if (mLength != 2) { + if (length != 2) { throw new IllegalArgumentException( - "Accesing a short from a TLV element of length " + mLength); + "Accesing a short from a TLV element of length " + length); } - return Memory.peekShort(mRefArray, mOffset, ByteOrder.BIG_ENDIAN); + return Memory.peekShort(refArray, offset, ByteOrder.BIG_ENDIAN); } /** * Utility function to return an integer representation of a TLV element * of length 4. Note: an attempt to call this function on a TLV item - * whose {@link TlvElement#mLength} is != 4 will result in an exception. + * whose {@link TlvElement#length} is != 4 will result in an exception. * * @return integer representation of current TLV element. */ public int getInt() { - if (mLength != 4) { + if (length != 4) { throw new IllegalArgumentException( - "Accesing an int from a TLV element of length " + mLength); + "Accesing an int from a TLV element of length " + length); } - return Memory.peekInt(mRefArray, mOffset, ByteOrder.BIG_ENDIAN); + return Memory.peekInt(refArray, offset, ByteOrder.BIG_ENDIAN); } /** @@ -372,7 +372,7 @@ public class TlvBufferUtils { * @return String repersentation of the current TLV element. */ public String getString() { - return new String(mRefArray, mOffset, mLength); + return new String(refArray, offset, length); } } @@ -426,21 +426,21 @@ public class TlvBufferUtils { first = false; builder.append(" ("); if (mTypeSize != 0) { - builder.append("T=" + tlv.mType + ","); + builder.append("T=" + tlv.type + ","); } - builder.append("L=" + tlv.mLength + ") "); - if (tlv.mLength == 0) { + builder.append("L=" + tlv.length + ") "); + if (tlv.length == 0) { builder.append("<null>"); - } else if (tlv.mLength == 1) { + } else if (tlv.length == 1) { builder.append(tlv.getByte()); - } else if (tlv.mLength == 2) { + } else if (tlv.length == 2) { builder.append(tlv.getShort()); - } else if (tlv.mLength == 4) { + } else if (tlv.length == 4) { builder.append(tlv.getInt()); } else { builder.append("<bytes>"); } - if (tlv.mLength != 0) { + if (tlv.length != 0) { builder.append(" (S='" + tlv.getString() + "')"); } } |