Revert QosCallbackException constant values
The constants are used for the NetworkAgent.sendQosCallbackError system
API, so changing their values changes the behavior of that API. This is
observed when running S CTS against the latest version of the
connectivity module: testQosCallbackOnError fails because a
SocketNotConnectedException ends up being reported, instead of an
UnsupportedOperationException.
Revert the constants to their values before change ID:
I7102ae9ba7cb9e1cc8d06b252aad4dad75860f3e
Bug: 238061856
Test: cts-tradefed run cts -m CtsNetTestCases \
-t android.net.cts.NetworkAgentTest
using a CTS v12.1 package.
Change-Id: Iaa12729d9e7dc627a6654a6fa47b8248e0cd3049
diff --git a/framework/src/android/net/QosCallbackException.java b/framework/src/android/net/QosCallbackException.java
index b80cff4..72430d2 100644
--- a/framework/src/android/net/QosCallbackException.java
+++ b/framework/src/android/net/QosCallbackException.java
@@ -57,6 +57,9 @@
private static final String TAG = "QosCallbackException";
// Types of exceptions supported //
+ // The constants are used for the sendQosCallbackError system API, so they must not be changed
+ // as there may be callers relying on their historical values to call that API.
+ // TODO: mark the constants as @SystemApi, since they are necessary to call a system API.
/** {@hide} */
public static final int EX_TYPE_FILTER_NONE = 0;
@@ -67,13 +70,13 @@
public static final int EX_TYPE_FILTER_SOCKET_NOT_BOUND = 2;
/** {@hide} */
- public static final int EX_TYPE_FILTER_SOCKET_NOT_CONNECTED = 3;
+ public static final int EX_TYPE_FILTER_NOT_SUPPORTED = 3;
/** {@hide} */
- public static final int EX_TYPE_FILTER_NOT_SUPPORTED = 4;
+ public static final int EX_TYPE_FILTER_SOCKET_LOCAL_ADDRESS_CHANGED = 4;
/** {@hide} */
- public static final int EX_TYPE_FILTER_SOCKET_LOCAL_ADDRESS_CHANGED = 5;
+ public static final int EX_TYPE_FILTER_SOCKET_NOT_CONNECTED = 5;
/** {@hide} */
public static final int EX_TYPE_FILTER_SOCKET_REMOTE_ADDRESS_CHANGED = 6;