From dc03a42f583af38731589078844de40f74c2cc9e Mon Sep 17 00:00:00 2001 From: Michael Plass Date: Mon, 20 Apr 2020 12:26:51 -0700 Subject: [WifiScoreReport] Forget the NetworkAgent on disconnect Bug: 122133502 Test: atest WifiScoreCardTest Change-Id: I540540f51ef5eda1167c7ef2edae634df97b5a75 --- tests/wifitests/src/com/android/server/wifi/WifiScoreReportTest.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests') diff --git a/tests/wifitests/src/com/android/server/wifi/WifiScoreReportTest.java b/tests/wifitests/src/com/android/server/wifi/WifiScoreReportTest.java index 5fe8eaac7..674ff8c9d 100644 --- a/tests/wifitests/src/com/android/server/wifi/WifiScoreReportTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WifiScoreReportTest.java @@ -661,8 +661,12 @@ public class WifiScoreReportTest extends WifiBaseTest { mWifiScoreReport.setWifiConnectedNetworkScorer(mAppBinder, mWifiConnectedNetworkScorer); when(mNetwork.getNetId()).thenReturn(TEST_NETWORK_ID); mWifiScoreReport.startConnectedNetworkScorer(TEST_NETWORK_ID); + verify(mWifiConnectedNetworkScorer).onStart(TEST_SESSION_ID); mWifiScoreReport.stopConnectedNetworkScorer(); verify(mWifiConnectedNetworkScorer).onStop(TEST_SESSION_ID); + // After the session stops, it should not start again (without a new NetworkAgent) + mWifiScoreReport.startConnectedNetworkScorer(TEST_NETWORK_ID); + verify(mWifiConnectedNetworkScorer).onStart(anyInt()); } /** -- cgit v1.2.3