Merge "[Thread] add error code ERROR_UNKNOWN for forward compatibility" into main
diff --git a/framework-t/api/system-current.txt b/framework-t/api/system-current.txt
index 3513573..d346af3 100644
--- a/framework-t/api/system-current.txt
+++ b/framework-t/api/system-current.txt
@@ -532,6 +532,7 @@
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
}
diff --git a/thread/framework/java/android/net/thread/ThreadNetworkException.java b/thread/framework/java/android/net/thread/ThreadNetworkException.java
index c5e1e97..4fd445b 100644
--- a/thread/framework/java/android/net/thread/ThreadNetworkException.java
+++ b/thread/framework/java/android/net/thread/ThreadNetworkException.java
@@ -47,6 +47,7 @@
ERROR_REJECTED_BY_PEER,
ERROR_RESPONSE_BAD_FORMAT,
ERROR_RESOURCE_EXHAUSTED,
+ ERROR_UNKNOWN,
})
public @interface ErrorCode {}
@@ -122,6 +123,12 @@
*/
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. */