From cac623e094d707fc6f9bb50b8c2b9bcb3b6be8bf Mon Sep 17 00:00:00 2001 From: Lorenzo Colitti Date: Thu, 19 Mar 2020 05:35:28 +0000 Subject: [PATCH] Document the arguments to SocketUtils.makePacketSocketAddress. Test: m Fix: 149015112 Change-Id: I4e0fb6fc66ef488cfa8a57a2c2536c2a625a4512 (cherry picked from commit 24593b0061757e47830463878b5a325da1f63cb9) --- core/java/android/net/util/SocketUtils.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/core/java/android/net/util/SocketUtils.java b/core/java/android/net/util/SocketUtils.java index e9ea99f84f905..696708408c225 100644 --- a/core/java/android/net/util/SocketUtils.java +++ b/core/java/android/net/util/SocketUtils.java @@ -66,6 +66,10 @@ public final class SocketUtils { /** * Make socket address that packet sockets can bind to. + * + * @param protocol the layer 2 protocol of the packets to receive. One of the {@code ETH_P_*} + * constants in {@link android.system.OsConstants}. + * @param ifIndex the interface index on which packets will be received. */ @NonNull public static SocketAddress makePacketSocketAddress(int protocol, int ifIndex) { @@ -78,6 +82,9 @@ public final class SocketUtils { /** * Make a socket address that packet socket can send packets to. * @deprecated Use {@link #makePacketSocketAddress(int, int, byte[])} instead. + * + * @param ifIndex the interface index on which packets will be sent. + * @param hwAddr the hardware address to which packets will be sent. */ @Deprecated @NonNull @@ -89,7 +96,12 @@ public final class SocketUtils { } /** - * Make a socket address that packet socket can send packets to. + * Make a socket address that a packet socket can send packets to. + * + * @param protocol the layer 2 protocol of the packets to send. One of the {@code ETH_P_*} + * constants in {@link android.system.OsConstants}. + * @param ifIndex the interface index on which packets will be sent. + * @param hwAddr the hardware address to which packets will be sent. */ @NonNull public static SocketAddress makePacketSocketAddress(int protocol, int ifIndex,