From fffc50f24d3a0e7f250a91e40e758a4247560b8c Mon Sep 17 00:00:00 2001 From: Michael Plass Date: Tue, 18 Feb 2020 15:02:20 -0800 Subject: [WifiConfigManager] Log the disable reason when re-enabling. A network may have been disabled a long time ago, and re-enabling it wipes out the reason it was disabled in the first place. This can be an important clue for diagnosing problems from a bug report, so log the previous status and reason before re-enabling a network. Bug: 149238341 Test: atest com.android.server.wifi Test: manual - check that the logging is present dumpsys output: adb shell dumpsys wifi | grep -10 '^WifiConfigManager' Change-Id: Id895918790a58e901b043bf607f83b30df9e8ebc Merged-In: Id895918790a58e901b043bf607f83b30df9e8ebc --- service/java/com/android/server/wifi/WifiConfigManager.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/service/java/com/android/server/wifi/WifiConfigManager.java b/service/java/com/android/server/wifi/WifiConfigManager.java index a2f10914a..9472367fb 100644 --- a/service/java/com/android/server/wifi/WifiConfigManager.java +++ b/service/java/com/android/server/wifi/WifiConfigManager.java @@ -1558,6 +1558,12 @@ public class WifiConfigManager { */ private void setNetworkSelectionEnabled(WifiConfiguration config) { NetworkSelectionStatus status = config.getNetworkSelectionStatus(); + if (status.getNetworkSelectionStatus() + != NetworkSelectionStatus.NETWORK_SELECTION_ENABLED) { + localLog("setNetworkSelectionEnabled: configKey=" + config.configKey() + + " old networkStatus=" + status.getNetworkStatusString() + + " disableReason=" + status.getNetworkDisableReasonString()); + } status.setNetworkSelectionStatus( NetworkSelectionStatus.NETWORK_SELECTION_ENABLED); status.setDisableTime( -- cgit v1.2.3