From 056eb1fbefe20c04501072fbd6469ca34bb49c2a Mon Sep 17 00:00:00 2001 From: David Su Date: Fri, 29 May 2020 12:21:19 -0700 Subject: WifiConfigManager: dump ConfigurationMap Dump ConfigurationMap for debugging. Bug: 157609789 Test: adb shell dumpsys wifi Change-Id: I9f493f95810a875742d07b197b84fdb960e71205 --- service/java/com/android/server/wifi/ConfigurationMap.java | 11 +++++++++++ service/java/com/android/server/wifi/WifiConfigManager.java | 3 +++ 2 files changed, 14 insertions(+) diff --git a/service/java/com/android/server/wifi/ConfigurationMap.java b/service/java/com/android/server/wifi/ConfigurationMap.java index 1f21891e3..c8f17e44e 100644 --- a/service/java/com/android/server/wifi/ConfigurationMap.java +++ b/service/java/com/android/server/wifi/ConfigurationMap.java @@ -21,6 +21,8 @@ import android.net.wifi.WifiConfiguration; import android.os.UserHandle; import android.os.UserManager; +import java.io.FileDescriptor; +import java.io.PrintWriter; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; @@ -41,6 +43,15 @@ public class ConfigurationMap { mUserManager = userManager; } + /** Dump internal state for debugging. */ + public void dump(FileDescriptor fd, PrintWriter pw, String[] args) { + pw.println("mPerId=" + mPerID); + pw.println("mPerIDForCurrentUser=" + mPerIDForCurrentUser); + pw.println("mScanResultMatchInfoMapForCurrentUser=" + + mScanResultMatchInfoMapForCurrentUser); + pw.println("mCurrentUserId=" + mCurrentUserId); + } + // RW methods: public WifiConfiguration put(WifiConfiguration config) { final WifiConfiguration current = mPerID.put(config.networkId, config); diff --git a/service/java/com/android/server/wifi/WifiConfigManager.java b/service/java/com/android/server/wifi/WifiConfigManager.java index 209044a65..d66fbb1bd 100644 --- a/service/java/com/android/server/wifi/WifiConfigManager.java +++ b/service/java/com/android/server/wifi/WifiConfigManager.java @@ -3222,6 +3222,9 @@ public class WifiConfigManager { pw.println(network); } pw.println("WifiConfigManager - Configured networks End ----"); + pw.println("WifiConfigManager - ConfigurationMap Begin ----"); + mConfiguredNetworks.dump(fd, pw, args); + pw.println("WifiConfigManager - ConfigurationMap End ----"); pw.println("WifiConfigManager - Next network ID to be allocated " + mNextNetworkId); pw.println("WifiConfigManager - Last selected network ID " + mLastSelectedNetworkId); pw.println("WifiConfigManager - PNO scan frequency culling enabled = " -- cgit v1.2.3