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

Commit 0d6c308c authored by Remi NGUYEN VAN's avatar Remi NGUYEN VAN Committed by Gerrit Code Review
Browse files

Merge "Add API to set the sll_protocol on PacketSocket"

parents 80c3a5db 51038e8b
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -4432,7 +4432,8 @@ package android.net.util {
    method public static void closeSocket(@Nullable java.io.FileDescriptor) throws java.io.IOException;
    method @NonNull public static java.net.SocketAddress makeNetlinkSocketAddress(int, int);
    method @NonNull public static java.net.SocketAddress makePacketSocketAddress(int, int);
    method @NonNull public static java.net.SocketAddress makePacketSocketAddress(int, @NonNull byte[]);
    method @Deprecated @NonNull public static java.net.SocketAddress makePacketSocketAddress(int, @NonNull byte[]);
    method @NonNull public static java.net.SocketAddress makePacketSocketAddress(int, int, @NonNull byte[]);
  }
}
+2 −1
Original line number Diff line number Diff line
@@ -1654,7 +1654,8 @@ package android.net.util {
    method public static void closeSocket(@Nullable java.io.FileDescriptor) throws java.io.IOException;
    method @NonNull public static java.net.SocketAddress makeNetlinkSocketAddress(int, int);
    method @NonNull public static java.net.SocketAddress makePacketSocketAddress(int, int);
    method @NonNull public static java.net.SocketAddress makePacketSocketAddress(int, @NonNull byte[]);
    method @Deprecated @NonNull public static java.net.SocketAddress makePacketSocketAddress(int, @NonNull byte[]);
    method @NonNull public static java.net.SocketAddress makePacketSocketAddress(int, int, @NonNull byte[]);
  }

}
+14 −0
Original line number Diff line number Diff line
@@ -77,7 +77,9 @@ public final class SocketUtils {

    /**
     * Make a socket address that packet socket can send packets to.
     * @deprecated Use {@link #makePacketSocketAddress(int, int, byte[])} instead.
     */
    @Deprecated
    @NonNull
    public static SocketAddress makePacketSocketAddress(int ifIndex, @NonNull byte[] hwAddr) {
        return new PacketSocketAddress(
@@ -86,6 +88,18 @@ public final class SocketUtils {
                hwAddr /* sll_addr */);
    }

    /**
     * Make a socket address that packet socket can send packets to.
     */
    @NonNull
    public static SocketAddress makePacketSocketAddress(int protocol, int ifIndex,
            @NonNull byte[] hwAddr) {
        return new PacketSocketAddress(
                protocol /* sll_protocol */,
                ifIndex /* sll_ifindex */,
                hwAddr /* sll_addr */);
    }

    /**
     * @see IoBridge#closeAndSignalBlockedThreads(FileDescriptor)
     */