diff options
author | Cody Kesting <ckesting@google.com> | 2020-02-10 09:48:56 -0800 |
---|---|---|
committer | Cody Kesting <ckesting@google.com> | 2020-02-10 10:31:51 -0800 |
commit | 2b26c8b92017626f3d8b35cf74d266d5d59924f9 (patch) | |
tree | 8d1b75786cd62201460475c5b5a99341d7f26e05 | |
parent | d5b9b267f6d0cfd2bbf10fcb4bc5ef57de7e3101 (diff) |
Update version check for notifyNetworkTested() call.
NetworkMonitor checks the version of INetworkMonitorCallbacks used by
the platform before invoking notifyNetworkTested() or
notifyNetworkTestedWithExtras(). The version number used for checking is
currently 5. However, this should be changed to 4, as the functionality
for notifyNetworkTestedWithExtras() is actually being added in version 5
of the callback.
Bug: 148032944
Test: atest NetworkStackTests
Test: atest android.net.cts.ConnectivityDiagnosticsManagerTest
Change-Id: I2337120fe70f75c072a9286038e66065fddcf857
-rw-r--r-- | src/com/android/server/connectivity/NetworkMonitor.java | 2 | ||||
-rw-r--r-- | tests/unit/src/com/android/server/connectivity/NetworkMonitorTest.java | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/com/android/server/connectivity/NetworkMonitor.java b/src/com/android/server/connectivity/NetworkMonitor.java index 6fc146d..e5f21eb 100644 --- a/src/com/android/server/connectivity/NetworkMonitor.java +++ b/src/com/android/server/connectivity/NetworkMonitor.java @@ -593,7 +593,7 @@ public class NetworkMonitor extends StateMachine { private void notifyNetworkTested( int result, @Nullable String redirectUrl, PersistableBundle extras) { try { - if (mCallbackVersion <= 5) { + if (mCallbackVersion <= 4) { mCallback.notifyNetworkTested(result, redirectUrl); } else { mCallback.notifyNetworkTestedWithExtras( diff --git a/tests/unit/src/com/android/server/connectivity/NetworkMonitorTest.java b/tests/unit/src/com/android/server/connectivity/NetworkMonitorTest.java index b376386..cee57e3 100644 --- a/tests/unit/src/com/android/server/connectivity/NetworkMonitorTest.java +++ b/tests/unit/src/com/android/server/connectivity/NetworkMonitorTest.java @@ -1278,7 +1278,7 @@ public class NetworkMonitorTest { public void testNotifyNetwork_NotifyNetworkTestedOldInterfaceVersion() throws Exception { // Use old interface version so notifyNetworkTested is used over // notifyNetworkTestedWithExtras - resetCallbacks(5); + resetCallbacks(4); // Trigger Network validation setStatus(mHttpsConnection, 204); |