Merge changes from topic "QosCallbackException"

* changes:
  CTS test for QosCallbackException
  Expose constructor of Exceptions.
This commit is contained in:
Sewook Seo
2022-03-19 00:35:28 +00:00
committed by Gerrit Code Review
6 changed files with 120 additions and 9 deletions

View File

@@ -18,6 +18,8 @@ package android.net;
import android.annotation.SystemApi;
import com.android.internal.annotations.VisibleForTesting;
/**
* Indicates that the {@link Network} was released and is no longer available.
*
@@ -25,7 +27,7 @@ import android.annotation.SystemApi;
*/
@SystemApi
public class NetworkReleasedException extends Exception {
/** @hide */
@VisibleForTesting
public NetworkReleasedException() {
super("The network was released and is no longer available");
}

View File

@@ -21,6 +21,8 @@ import android.annotation.NonNull;
import android.annotation.SystemApi;
import android.util.Log;
import com.android.internal.annotations.VisibleForTesting;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@@ -94,16 +96,12 @@ public final class QosCallbackException extends Exception {
}
}
/**
* @hide
*/
@VisibleForTesting
public QosCallbackException(@NonNull final String message) {
super(message);
}
/**
* @hide
*/
@VisibleForTesting
public QosCallbackException(@NonNull final Throwable cause) {
super(cause);
}

View File

@@ -18,6 +18,8 @@ package android.net;
import android.annotation.SystemApi;
import com.android.internal.annotations.VisibleForTesting;
/**
* Thrown when the local address of the socket has changed.
*
@@ -25,7 +27,7 @@ import android.annotation.SystemApi;
*/
@SystemApi
public class SocketLocalAddressChangedException extends Exception {
/** @hide */
@VisibleForTesting
public SocketLocalAddressChangedException() {
super("The local address of the socket changed");
}

View File

@@ -18,6 +18,8 @@ package android.net;
import android.annotation.SystemApi;
import com.android.internal.annotations.VisibleForTesting;
/**
* Thrown when a previously bound socket becomes unbound.
*
@@ -25,7 +27,7 @@ import android.annotation.SystemApi;
*/
@SystemApi
public class SocketNotBoundException extends Exception {
/** @hide */
@VisibleForTesting
public SocketNotBoundException() {
super("The socket is unbound");
}