Expose constructor of Exceptions.

Exposing constructor of Exceptions for test purpose.

CTS-Coverage-Bug: 224059548
BUG: 215240597
BUG: 216368595
Test: build
Change-Id: I20af104a891e94873715ab46ecabc3e775638c8c
This commit is contained in:
sewookseo
2022-03-10 03:06:43 +00:00
parent edf80c2da8
commit e7c481452e
5 changed files with 18 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");
}