From 1c1418a33d4303f54ecfcf8335b908072630c31c Mon Sep 17 00:00:00 2001 From: Ecco Park Date: Thu, 8 Nov 2018 09:57:56 -0800 Subject: passpoint-r2: unregister ConnectivityCallbacks when it disconnects OSU AP Currently when we connect to OSU AP, we register ConnectivityCallbacks function to the network to listen for connection/disconnection event. The problem is that we never unregister the network callback even after we disconnect the OSU AP, which causes internal state of OsuNetworkConnection to be connected state all the time. Due to this, user no longer be able to start provisioning flow next time. It blocks us to run Provisioning test continously with following sequences: Testcase: 1) OSU Provisioning to get a passpoint profile 2) Connecting to Passpoint AP 3) Delete Passpoint profile Test results: 1) It failed without this CL: First try passed, but second try failed. 2) It passed with this CL. Firt try, second and subsequenet try all passed. Bug: 119257536 Test: ./frameworks/opt/net/wifi/tests/wifitests/runtests.sh Test: live test with Passpoint R2 service provider AP Change-Id: I82377d54d545a918dbd491e570a7f6fb61edb3aa Signed-off-by: Ecco Park --- service/java/com/android/server/wifi/hotspot2/OsuNetworkConnection.java | 1 + 1 file changed, 1 insertion(+) (limited to 'service') diff --git a/service/java/com/android/server/wifi/hotspot2/OsuNetworkConnection.java b/service/java/com/android/server/wifi/hotspot2/OsuNetworkConnection.java index 367a80dc6..0de441434 100644 --- a/service/java/com/android/server/wifi/hotspot2/OsuNetworkConnection.java +++ b/service/java/com/android/server/wifi/hotspot2/OsuNetworkConnection.java @@ -136,6 +136,7 @@ public class OsuNetworkConnection { } return; } + mConnectivityManager.unregisterNetworkCallback(mConnectivityCallbacks); mWifiManager.removeNetwork(mNetworkId); mNetworkId = -1; mNetwork = null; -- cgit v1.2.3