Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c3900531 authored by Aaron Huang's avatar Aaron Huang Committed by android-build-merger
Browse files

Merge "Send message to add/remove NAT-T keepalive packet filter." am: 42e73893e0

am: 99b6c3f485

Change-Id: I7c6bd151cd79309fb5e6869fd83a800e7425581a
parents e3af8a82 5776ad8d
Loading
Loading
Loading
Loading
+4 −9
Original line number Original line Diff line number Diff line
@@ -372,10 +372,6 @@ public class IpClient extends StateMachine {
    private boolean mMulticastFiltering;
    private boolean mMulticastFiltering;
    private long mStartTimeMillis;
    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
     * Reading the snapshot is an asynchronous operation initiated by invoking
     * Callback.startReadPacketFilter() and completed when the WiFi Service responds with an
     * Callback.startReadPacketFilter() and completed when the WiFi Service responds with an
@@ -705,7 +701,7 @@ public class IpClient extends StateMachine {
     * keepalive offload.
     * keepalive offload.
     */
     */
    public void addKeepalivePacketFilter(int slot, @NonNull TcpKeepalivePacketDataParcelable pkt) {
    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,
    public void addNattKeepalivePacketFilter(int slot,
            @NonNull NattKeepalivePacketDataParcelable pkt) {
            @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: {
                case CMD_ADD_KEEPALIVE_PACKET_FILTER_TO_APF: {
                    final int slot = msg.arg1;
                    final int slot = msg.arg1;
                    final int type = msg.arg2;


                    if (mApfFilter != null) {
                    if (mApfFilter != null) {
                        if (type == TYPE_NATT) {
                        if (msg.obj instanceof NattKeepalivePacketDataParcelable) {
                            mApfFilter.addNattKeepalivePacketFilter(slot,
                            mApfFilter.addNattKeepalivePacketFilter(slot,
                                    (NattKeepalivePacketDataParcelable) msg.obj);
                                    (NattKeepalivePacketDataParcelable) msg.obj);
                        } else {
                        } else if (msg.obj instanceof TcpKeepalivePacketDataParcelable) {
                            mApfFilter.addTcpKeepalivePacketFilter(slot,
                            mApfFilter.addTcpKeepalivePacketFilter(slot,
                                    (TcpKeepalivePacketDataParcelable) msg.obj);
                                    (TcpKeepalivePacketDataParcelable) msg.obj);
                        }
                        }