Skip to content
Snippets Groups Projects
Commit 2040d8bc authored by Xiao Ma's avatar Xiao Ma
Browse files

Make StructRtMsg constructor visible for testing.

Refactor IpClientTest by parsing the netlink message directly instead
of netd callbacks, so we have to initialize a StructRtMsg instance to
fill in the RtNetlinkRouteMessage constructor.

Bug: 318764217
Test: atest NetworkStackTests
Change-Id: I1481cb8fab29ae94d48fa342ecf2b303a9701a31
parent 4dfc6da5
No related branches found
No related tags found
No related merge requests found
......@@ -18,6 +18,7 @@ package com.android.net.module.util.netlink;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;
import com.android.net.module.util.Struct;
import com.android.net.module.util.Struct.Field;
......@@ -57,8 +58,9 @@ public class StructRtMsg extends Struct {
@Field(order = 8, type = Type.U32)
public final long flags;
StructRtMsg(short family, short dstLen, short srcLen, short tos, short table, short protocol,
short scope, short type, long flags) {
@VisibleForTesting
public StructRtMsg(short family, short dstLen, short srcLen, short tos, short table,
short protocol, short scope, short type, long flags) {
this.family = family;
this.dstLen = dstLen;
this.srcLen = srcLen;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment