From 801e4e9db30a337e3c38715df736868af44aa78b Mon Sep 17 00:00:00 2001 From: Quang Luong Date: Tue, 22 Sep 2020 23:13:50 -0700 Subject: [WifiTrackerLib] Reset default route booleans in BaseWifiTracker#onStart The default route booleans must be reset to false in onStart() if there is no default route. Otherwise these booleans may still hold an out-of-date "true" value and the actual false->true update will not trigger handleOnDefaultRouteChanged, causing the X in the wifi signal icon to never disappear. Bug: 168885802 Test: Connect to network in wifi picker, open network details and disconnect, go back to wifi picker and connect to same network. Observe X in wifi signal icon to disappear after validation. Change-Id: Ifde41ec0436ae67c59f5b935b5bc4ff1cd357f57 --- .../WifiTrackerLib/src/com/android/wifitrackerlib/BaseWifiTracker.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libs') diff --git a/libs/WifiTrackerLib/src/com/android/wifitrackerlib/BaseWifiTracker.java b/libs/WifiTrackerLib/src/com/android/wifitrackerlib/BaseWifiTracker.java index 28b1a4907..8eaef6e5a 100644 --- a/libs/WifiTrackerLib/src/com/android/wifitrackerlib/BaseWifiTracker.java +++ b/libs/WifiTrackerLib/src/com/android/wifitrackerlib/BaseWifiTracker.java @@ -273,6 +273,9 @@ public class BaseWifiTracker implements LifecycleObserver { if (defaultNetworkCapabilities != null) { mIsWifiDefaultRoute = defaultNetworkCapabilities.hasTransport(TRANSPORT_WIFI); mIsCellDefaultRoute = defaultNetworkCapabilities.hasTransport(TRANSPORT_CELLULAR); + } else { + mIsWifiDefaultRoute = false; + mIsCellDefaultRoute = false; } if (isVerboseLoggingEnabled()) { Log.v(mTag, "Wifi is the default route: " + mIsWifiDefaultRoute); -- cgit v1.2.3