summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuang Luong <qal@google.com>2020-09-22 23:13:50 -0700
committerQuang Luong <qal@google.com>2020-09-22 23:20:45 -0700
commit801e4e9db30a337e3c38715df736868af44aa78b (patch)
treed2f1dfc9aba21b54438be25dde5b255e73e9dbf3
parent61e8b970ef8390b431a386a37d6ea9d9e6eced2f (diff)
[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
-rw-r--r--libs/WifiTrackerLib/src/com/android/wifitrackerlib/BaseWifiTracker.java3
1 files changed, 3 insertions, 0 deletions
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);