summaryrefslogtreecommitdiff
path: root/src/android/net/apf
diff options
context:
space:
mode:
authorjunyulai <junyulai@google.com>2019-01-08 20:04:33 +0800
committerChalard Jean <jchalard@google.com>2019-02-06 22:51:42 +0900
commitcd924e577e2360ce9e4ff9934ec52856e91d6c1a (patch)
tree94ae6592868e1d76e107e7558c703b383cf1c717 /src/android/net/apf
parent00ca6045e503cbf6326a09f325eabb0b683978d1 (diff)
[KA04] Expose TCP socket keepalive API
The new set of API allows applications to request keepalives offload for established TCP sockets over wifi. However, the application must not write to or read from the socket after calling this method, until specific callbacks are called. Bug: 114151147 Test: atest FrameworksNetTests FrameworksWifiTests NetworkStackTests Change-Id: I3880505dbc35fefa34ef6c79555458ecf5d296a4
Diffstat (limited to 'src/android/net/apf')
-rw-r--r--src/android/net/apf/ApfFilter.java24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/android/net/apf/ApfFilter.java b/src/android/net/apf/ApfFilter.java
index 4fa7d64..8801741 100644
--- a/src/android/net/apf/ApfFilter.java
+++ b/src/android/net/apf/ApfFilter.java
@@ -38,6 +38,7 @@ import android.content.Intent;
import android.content.IntentFilter;
import android.net.LinkAddress;
import android.net.LinkProperties;
+import android.net.TcpKeepalivePacketDataParcelable;
import android.net.apf.ApfGenerator.IllegalInstructionException;
import android.net.apf.ApfGenerator.Register;
import android.net.ip.IpClient.IpClientCallbacksWrapper;
@@ -1489,6 +1490,29 @@ public class ApfFilter {
installNewProgramLocked();
}
+ /**
+ * Add keepalive packet filter.
+ *
+ * @param slot The index used to access the filter.
+ * @param pkt Parameters needed to compose the filter.
+ */
+ public synchronized void addKeepalivePacketFilter(int slot,
+ TcpKeepalivePacketDataParcelable pkt) {
+ // TODO: implement this.
+ Log.e(TAG, "APF function is not implemented: addKeepalivePacketFilter(" + slot + ", "
+ + pkt + ")");
+ }
+
+ /**
+ * Remove keepalive packet filter.
+ *
+ * @param slot The index used to access the filter.
+ */
+ public synchronized void removeKeepalivePacketFilter(int slot) {
+ // TODO: implement this.
+ Log.e(TAG, "APF function is not implemented: removeKeepalivePacketFilter(" + slot + ")");
+ }
+
static public long counterValue(byte[] data, Counter counter)
throws ArrayIndexOutOfBoundsException {
// Follow the same wrap-around addressing scheme of the interpreter.