Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2b26c8b9 authored by Cody Kesting's avatar Cody Kesting
Browse files

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
parent d5b9b267
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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(
+1 −1
Original line number Diff line number Diff line
@@ -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);