Merge "[Thread] add error code ERROR_UNKNOWN for forward compatibility" into main

This commit is contained in:
Kangping Dong 2024-01-24 02:20:42 +00:00 • committed by Gerrit Code Review
commit 649571ddf7
2 changed files with 8 additions and 0 deletions

View file

@ -532,6 +532,7 @@ package android.net.thread {
field public static final int ERROR_RESPONSE_BAD_FORMAT = 9; // 0x9
field public static final int ERROR_TIMEOUT = 3; // 0x3
field public static final int ERROR_UNAVAILABLE = 4; // 0x4
field public static final int ERROR_UNKNOWN = 11; // 0xb
field public static final int ERROR_UNSUPPORTED_CHANNEL = 7; // 0x7
}

View file

@ -47,6 +47,7 @@ public class ThreadNetworkException extends Exception {
ERROR_REJECTED_BY_PEER,
ERROR_RESPONSE_BAD_FORMAT,
ERROR_RESOURCE_EXHAUSTED,
ERROR_UNKNOWN,
})
public @interface ErrorCode {}
@ -122,6 +123,12 @@ public class ThreadNetworkException extends Exception {
*/
public static final int ERROR_RESOURCE_EXHAUSTED = 10;
/**
* The operation failed because of an unknown error in the system. This typically indicates
* that the caller doesn't understand error codes added in newer Android versions.
*/
public static final int ERROR_UNKNOWN = 11;
private final int mErrorCode;
/** Creates a new {@link ThreadNetworkException} object with given error code and message. */