diff options
author | Aaron Huang <huangaaron@google.com> | 2019-05-10 07:19:27 -0700 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2019-05-10 07:19:27 -0700 |
commit | 5776ad8de8eba234847c3812b2e4428131a3122f (patch) | |
tree | 77b9c21407608530502514a02a6106109b626088 /src/android/net/ip/IpClient.java | |
parent | da4897101c5dc8388b9450f38195350cc78e30c1 (diff) | |
parent | d59607ba640b15795edb90db82ab52756b3819b9 (diff) |
Merge "Send message to add/remove NAT-T keepalive packet filter."
am: 42e73893e0
Change-Id: I3e35d73a38cfbd0a29ad3f1f859b2d6fdb514ff1
Diffstat (limited to 'src/android/net/ip/IpClient.java')
-rw-r--r-- | src/android/net/ip/IpClient.java | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/android/net/ip/IpClient.java b/src/android/net/ip/IpClient.java index dc74c04..266b1b0 100644 --- a/src/android/net/ip/IpClient.java +++ b/src/android/net/ip/IpClient.java @@ -372,10 +372,6 @@ public class IpClient extends StateMachine { private boolean mMulticastFiltering; private long mStartTimeMillis; - /* This must match the definition in KeepaliveTracker.KeepaliveInfo */ - private static final int TYPE_NATT = 1; - private static final int TYPE_TCP = 2; - /** * Reading the snapshot is an asynchronous operation initiated by invoking * Callback.startReadPacketFilter() and completed when the WiFi Service responds with an @@ -705,7 +701,7 @@ public class IpClient extends StateMachine { * keepalive offload. */ public void addKeepalivePacketFilter(int slot, @NonNull TcpKeepalivePacketDataParcelable pkt) { - sendMessage(CMD_ADD_KEEPALIVE_PACKET_FILTER_TO_APF, slot, TYPE_TCP, pkt); + sendMessage(CMD_ADD_KEEPALIVE_PACKET_FILTER_TO_APF, slot, 0 /* Unused */, pkt); } /** @@ -714,7 +710,7 @@ public class IpClient extends StateMachine { */ public void addNattKeepalivePacketFilter(int slot, @NonNull NattKeepalivePacketDataParcelable pkt) { - sendMessage(CMD_ADD_KEEPALIVE_PACKET_FILTER_TO_APF, slot, TYPE_NATT, pkt); + sendMessage(CMD_ADD_KEEPALIVE_PACKET_FILTER_TO_APF, slot, 0 /* Unused */ , pkt); } /** @@ -1626,13 +1622,12 @@ public class IpClient extends StateMachine { case CMD_ADD_KEEPALIVE_PACKET_FILTER_TO_APF: { final int slot = msg.arg1; - final int type = msg.arg2; if (mApfFilter != null) { - if (type == TYPE_NATT) { + if (msg.obj instanceof NattKeepalivePacketDataParcelable) { mApfFilter.addNattKeepalivePacketFilter(slot, (NattKeepalivePacketDataParcelable) msg.obj); - } else { + } else if (msg.obj instanceof TcpKeepalivePacketDataParcelable) { mApfFilter.addTcpKeepalivePacketFilter(slot, (TcpKeepalivePacketDataParcelable) msg.obj); } |