diff options
author | Hai Shalom <haishalom@google.com> | 2020-02-12 12:58:22 -0800 |
---|---|---|
committer | Hai Shalom <haishalom@google.com> | 2020-02-12 13:33:47 -0800 |
commit | cbfc666a8b9e74ee5fa6e8e23e4bc03fb03b1592 (patch) | |
tree | edb5eff889fc1fd71e6548d4e1a6564b60d09cdd /service | |
parent | 2d31e13938f2a411998057d16046dafee51a53ed (diff) |
[Passpoint] Add dump info for ANQPRequestManager
Add hold off information from ANQPRequestManager to the Wi-Fi log
dump.
Bug: 139091536
Test: dumpsys wifi - confirm data appears
Change-Id: Ia2063d2fec1f4a69ad007916f0f6b688ff309d05
Diffstat (limited to 'service')
-rw-r--r-- | service/java/com/android/server/wifi/hotspot2/ANQPRequestManager.java | 24 | ||||
-rw-r--r-- | service/java/com/android/server/wifi/hotspot2/PasspointManager.java | 1 |
2 files changed, 23 insertions, 2 deletions
diff --git a/service/java/com/android/server/wifi/hotspot2/ANQPRequestManager.java b/service/java/com/android/server/wifi/hotspot2/ANQPRequestManager.java index 7c5b518be..4e7a0ab22 100644 --- a/service/java/com/android/server/wifi/hotspot2/ANQPRequestManager.java +++ b/service/java/com/android/server/wifi/hotspot2/ANQPRequestManager.java @@ -22,6 +22,7 @@ import com.android.internal.annotations.VisibleForTesting; import com.android.server.wifi.Clock; import com.android.server.wifi.hotspot2.anqp.Constants; +import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; @@ -165,8 +166,9 @@ public class ANQPRequestManager { long currentTime = mClock.getElapsedSinceBootMillis(); HoldOffInfo info = mHoldOffInfo.get(bssid); if (info != null && info.holdOffExpirationTime > currentTime) { - Log.d(TAG, "Not allowed to send ANQP request to " + bssid + " for another " - + (info.holdOffExpirationTime - currentTime) / 1000 + " seconds"); + Log.d(TAG, "Not allowed to send ANQP request to " + Utils.macToString(bssid) + + " for another " + (info.holdOffExpirationTime - currentTime) / 1000 + + " seconds"); return false; } @@ -212,4 +214,22 @@ public class ANQPRequestManager { } return requestList; } + + /** + * Dump the current state of ANQPRequestManager to the provided output stream. + * + * @param pw The output stream to write to + */ + public void dump(PrintWriter pw) { + pw.println("ANQPRequestManager - Begin ---"); + for (Map.Entry<Long, HoldOffInfo> holdOffInfo : mHoldOffInfo.entrySet()) { + long bssid = holdOffInfo.getKey(); + pw.println("For BBSID: " + Utils.macToString(bssid)); + pw.println("holdOffCount: " + holdOffInfo.getValue().holdOffCount); + pw.println("Not allowed to send ANQP request for another " + + (holdOffInfo.getValue().holdOffExpirationTime + - mClock.getElapsedSinceBootMillis()) / 1000 + " seconds"); + } + pw.println("ANQPRequestManager - End ---"); + } } diff --git a/service/java/com/android/server/wifi/hotspot2/PasspointManager.java b/service/java/com/android/server/wifi/hotspot2/PasspointManager.java index 86f7f5a65..755a9b3a9 100644 --- a/service/java/com/android/server/wifi/hotspot2/PasspointManager.java +++ b/service/java/com/android/server/wifi/hotspot2/PasspointManager.java @@ -1080,6 +1080,7 @@ public class PasspointManager { pw.println("PasspointManager - Providers End ---"); pw.println("PasspointManager - Next provider ID to be assigned " + mProviderIndex); mAnqpCache.dump(pw); + mAnqpRequestManager.dump(pw); } /** |