Make PrefixInformationOption struct constructor visible for testing.
PrefixInformationOption#build always gives the correct option length and type, visible constructor is easiler to verify the incorrect parameters in the test, for example, we will verify the code that parses the PIO option in RA as a ND user option in netlink message. Bug: 315069348 Test: TH Change-Id: I6b88e6718cb873b15936c1f518d357c36c41ffde
This commit is contained in:
parent
ced8412a19
commit
f0959a78a2
1 changed files with 3 additions and 1 deletions
|
|
@ -21,6 +21,7 @@ import static com.android.net.module.util.NetworkStackConstants.ICMPV6_ND_OPTION
|
|||
import android.net.IpPrefix;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.VisibleForTesting;
|
||||
|
||||
import com.android.net.module.util.Struct;
|
||||
import com.android.net.module.util.Struct.Field;
|
||||
|
|
@ -71,7 +72,8 @@ public class PrefixInformationOption extends Struct {
|
|||
@Field(order = 7, type = Type.ByteArray, arraysize = 16)
|
||||
public final byte[] prefix;
|
||||
|
||||
PrefixInformationOption(final byte type, final byte length, final byte prefixLen,
|
||||
@VisibleForTesting
|
||||
public PrefixInformationOption(final byte type, final byte length, final byte prefixLen,
|
||||
final byte flags, final long validLifetime, final long preferredLifetime,
|
||||
final int reserved, @NonNull final byte[] prefix) {
|
||||
this.type = type;
|
||||
|
|
|
|||
Loading…
Reference in a new issue