Dump mNetworkToIfaces in NetworkPolicyManagerService

Dump last interfaces of the network information in dumpsys of
netpolicy.

Output:
Network to interfaces:
  100: {rmnet_data1}]
  101: {v4-wlan0, wlan0}]

Bug: 237640200
Test: FrameworksNetTests
Change-Id: I258f5565e62666cd71222073c692e45e2e5828e2
This commit is contained in:
Aaron Huang
2022-07-11 18:47:39 +08:00
parent 6db478c840
commit 309257255a

View File

@@ -4049,6 +4049,14 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub {
}
fout.decreaseIndent();
fout.println("Network to interfaces:");
fout.increaseIndent();
for (int i = 0; i < mNetworkToIfaces.size(); ++i) {
final int key = mNetworkToIfaces.keyAt(i);
fout.println(key + ": " + mNetworkToIfaces.get(key));
}
fout.decreaseIndent();
fout.println();
mStatLogger.dump(fout);