summaryrefslogtreecommitdiff
path: root/core/java
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2020-03-17 09:22:12 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2020-03-17 09:22:12 +0000
commit488efe3350e8272e0be7e19c6038326b69aa12cb (patch)
tree30d62d732d0281d9acde2189929d2b0c50a5ce60 /core/java
parentfdf46978ab5dc4f776e5bc96a0e112603479778d (diff)
parenteb7edd5620a3e51fdd107734ddcf9b083596137f (diff)
Merge "services.net: Add a static library needed by wifi module"
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/net/KeepalivePacketData.java22
1 files changed, 3 insertions, 19 deletions
diff --git a/core/java/android/net/KeepalivePacketData.java b/core/java/android/net/KeepalivePacketData.java
index 2b8b7e69dec9..6c0ba2f63a80 100644
--- a/core/java/android/net/KeepalivePacketData.java
+++ b/core/java/android/net/KeepalivePacketData.java
@@ -22,7 +22,6 @@ import static android.net.InvalidPacketException.ERROR_INVALID_PORT;
import android.annotation.NonNull;
import android.annotation.SystemApi;
import android.net.util.IpUtils;
-import android.os.Parcel;
import android.util.Log;
import java.net.InetAddress;
@@ -30,7 +29,6 @@ import java.net.InetAddress;
/**
* Represents the actual packets that are sent by the
* {@link android.net.SocketKeepalive} API.
- *
* @hide
*/
@SystemApi
@@ -54,6 +52,9 @@ public class KeepalivePacketData {
/** Packet data. A raw byte string of packet data, not including the link-layer header. */
private final byte[] mPacket;
+ // Note: If you add new fields, please modify the parcelling code in the child classes.
+
+
// This should only be constructed via static factory methods, such as
// nattKeepalivePacket.
/**
@@ -87,21 +88,4 @@ public class KeepalivePacketData {
return mPacket.clone();
}
- /** @hide */
- public void writeToParcel(Parcel out, int flags) {
- out.writeString(srcAddress.getHostAddress());
- out.writeString(dstAddress.getHostAddress());
- out.writeInt(srcPort);
- out.writeInt(dstPort);
- out.writeByteArray(mPacket);
- }
-
- /** @hide */
- protected KeepalivePacketData(Parcel in) {
- srcAddress = NetworkUtils.numericToInetAddress(in.readString());
- dstAddress = NetworkUtils.numericToInetAddress(in.readString());
- srcPort = in.readInt();
- dstPort = in.readInt();
- mPacket = in.createByteArray();
- }
}