Support QosCallback for UDP socket: Expose API&CTS

Expose API to use QoSCallback for UDP socket.
- Constructor of QosSocketInfo with DatagramSocket
- matchesProtocol(int protocol) in QosFilter
- Constructor of SocketNotConnectedException &
  SocketRemoteAddressChangedException
Add CTS test cases for exposed API.

Bug: 233292861
Test: atest CtsNetTestCases
Change-Id: I52ff881b71b31c0f97c08200cd811205c25fcb44
This commit is contained in:
sewookseo
2022-05-20 02:50:22 +00:00
committed by Sewook Seo
parent d70c34fef2
commit 4d371bc6c4
7 changed files with 150 additions and 60 deletions

View File

@@ -16,13 +16,18 @@
package android.net;
import android.annotation.SystemApi;
import com.android.internal.annotations.VisibleForTesting;
/**
* Thrown when a previously bound socket becomes unbound.
*
* @hide
*/
@SystemApi
public class SocketNotConnectedException extends Exception {
/** @hide */
@VisibleForTesting
public SocketNotConnectedException() {
super("The socket is not connected");
}