Merge "Address API review comments for DhcpOption object"
This commit is contained in:
@@ -1,7 +0,0 @@
|
|||||||
// Baseline format: 1.0
|
|
||||||
NoByteOrShort: android.net.DhcpOption#DhcpOption(byte, byte[]) parameter #0:
|
|
||||||
Should avoid odd sized primitives; use `int` instead of `byte` in parameter type in android.net.DhcpOption(byte type, byte[] value)
|
|
||||||
NoByteOrShort: android.net.DhcpOption#describeContents():
|
|
||||||
Should avoid odd sized primitives; use `int` instead of `byte` in method android.net.DhcpOption.describeContents()
|
|
||||||
NoByteOrShort: android.net.DhcpOption#getType():
|
|
||||||
Should avoid odd sized primitives; use `int` instead of `byte` in method android.net.DhcpOption.getType()
|
|
||||||
@@ -18,6 +18,7 @@ package android.net;
|
|||||||
|
|
||||||
import android.annotation.NonNull;
|
import android.annotation.NonNull;
|
||||||
import android.annotation.Nullable;
|
import android.annotation.Nullable;
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
import android.annotation.SystemApi;
|
import android.annotation.SystemApi;
|
||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
import android.os.Parcelable;
|
import android.os.Parcelable;
|
||||||
@@ -35,12 +36,13 @@ public final class DhcpOption implements Parcelable {
|
|||||||
/**
|
/**
|
||||||
* Constructs a DhcpOption object.
|
* Constructs a DhcpOption object.
|
||||||
*
|
*
|
||||||
* @param type the type of this option
|
* @param type the type of this option. For more information, see
|
||||||
|
* https://www.iana.org/assignments/bootp-dhcp-parameters/bootp-dhcp-parameters.xhtml.
|
||||||
* @param value the value of this option. If {@code null}, DHCP packets containing this option
|
* @param value the value of this option. If {@code null}, DHCP packets containing this option
|
||||||
* will include the option type in the Parameter Request List. Otherwise, DHCP
|
* will include the option type in the Parameter Request List. Otherwise, DHCP
|
||||||
* packets containing this option will include the option in the options section.
|
* packets containing this option will include the option in the options section.
|
||||||
*/
|
*/
|
||||||
public DhcpOption(byte type, @Nullable byte[] value) {
|
public DhcpOption(@SuppressLint("NoByteOrShort") byte type, @Nullable byte[] value) {
|
||||||
mType = type;
|
mType = type;
|
||||||
mValue = value;
|
mValue = value;
|
||||||
}
|
}
|
||||||
@@ -69,6 +71,7 @@ public final class DhcpOption implements Parcelable {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/** Get the type of DHCP option */
|
/** Get the type of DHCP option */
|
||||||
|
@SuppressLint("NoByteOrShort")
|
||||||
public byte getType() {
|
public byte getType() {
|
||||||
return mType;
|
return mType;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user