summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorRobert Greenwalt <rgreenwalt@google.com>2014-05-13 15:36:27 -0700
committerRobert Greenwalt <rgreenwalt@google.com>2014-05-14 13:12:23 +0000
commitc9c90c771c9cd1381a49b714df9a2bc392959fcc (patch)
tree1a886899bb613e5c30cc5512407af4fdc245f0ac /services
parent98e8c26b90ed3cbe3910617b906d412ffa55d234 (diff)
downloadframeworks_base-c9c90c771c9cd1381a49b714df9a2bc392959fcc.zip
frameworks_base-c9c90c771c9cd1381a49b714df9a2bc392959fcc.tar.gz
frameworks_base-c9c90c771c9cd1381a49b714df9a2bc392959fcc.tar.bz2
Add networks and requests to CS.dump
Adds debugging. Change-Id: I352dfe970c990fd210f3d1598519e321bbdd6ed5 (cherry picked from commit 9bdf6bd99db56c652ba9a62d91f258d11d19ca9f)
Diffstat (limited to 'services')
-rw-r--r--services/core/java/com/android/server/ConnectivityService.java53
1 files changed, 24 insertions, 29 deletions
diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java
index 7123120..1857aa9 100644
--- a/services/core/java/com/android/server/ConnectivityService.java
+++ b/services/core/java/com/android/server/ConnectivityService.java
@@ -2834,44 +2834,39 @@ public class ConnectivityService extends IConnectivityManager.Stub {
return;
}
- // TODO: add locking to get atomic snapshot
- pw.println();
- for (int i = 0; i < mNetTrackers.length; i++) {
- final NetworkStateTracker nst = mNetTrackers[i];
- if (nst != null) {
- pw.println("NetworkStateTracker for " + getNetworkTypeName(i) + ":");
- pw.increaseIndent();
- if (nst.getNetworkInfo().isConnected()) {
- pw.println("Active network: " + nst.getNetworkInfo().
- getTypeName());
- }
- pw.println(nst.getNetworkInfo());
- pw.println(nst.getLinkProperties());
- pw.println(nst);
- pw.println();
- pw.decreaseIndent();
- }
+ NetworkAgentInfo defaultNai = mNetworkForRequestId.get(mDefaultRequest.requestId);
+ pw.print("Active default network: ");
+ if (defaultNai == null) {
+ pw.println("none");
+ } else {
+ pw.println(defaultNai.network.netId);
}
-
- pw.print("Active default network: "); pw.println(getNetworkTypeName(mActiveDefaultNetwork));
pw.println();
- pw.println("Network Requester Pids:");
+ pw.println("Current Networks:");
pw.increaseIndent();
- for (int net : mPriorityList) {
- String pidString = net + ": ";
- for (Integer pid : mNetRequestersPids[net]) {
- pidString = pidString + pid.toString() + ", ";
+ for (NetworkAgentInfo nai : mNetworkAgentInfos.values()) {
+ pw.println(nai.toString());
+ pw.increaseIndent();
+ pw.println("Requests:");
+ pw.increaseIndent();
+ for (int i = 0; i < nai.networkRequests.size(); i++) {
+ pw.println(nai.networkRequests.valueAt(i).toString());
}
- pw.println(pidString);
+ pw.decreaseIndent();
+ pw.println("Lingered:");
+ pw.increaseIndent();
+ for (NetworkRequest nr : nai.networkLingered) pw.println(nr.toString());
+ pw.decreaseIndent();
+ pw.decreaseIndent();
}
- pw.println();
pw.decreaseIndent();
+ pw.println();
- pw.println("FeatureUsers:");
+ pw.println("Network Requests:");
pw.increaseIndent();
- for (Object requester : mFeatureUsers) {
- pw.println(requester.toString());
+ for (NetworkRequestInfo nri : mNetworkRequests.values()) {
+ pw.println(nri.toString());
}
pw.println();
pw.decreaseIndent();