diff options
author | Lorenzo Colitti <lorenzo@google.com> | 2015-06-03 11:18:24 +0900 |
---|---|---|
committer | Lorenzo Colitti <lorenzo@google.com> | 2015-06-03 11:29:41 +0900 |
commit | e380546aedb727a7a5f1f7b460124c3e57d5ac49 (patch) | |
tree | 29a918c42c24e4e563f9bd9438b42b030c96942c /services/core/java/com/android/server/connectivity/Tethering.java | |
parent | 233241f13d5d7f841d3db80408429d4d0a528c78 (diff) | |
download | frameworks_base-e380546aedb727a7a5f1f7b460124c3e57d5ac49.zip frameworks_base-e380546aedb727a7a5f1f7b460124c3e57d5ac49.tar.gz frameworks_base-e380546aedb727a7a5f1f7b460124c3e57d5ac49.tar.bz2 |
Make the dumpsys connectivity shorter and easier to read.
- Print NetworkFactories on one line.
- Only print LegacyTypeTracker networks if they are connected,
and record supported network types on a separate summary line.
- Print all tethering upstreams on one line.
- Summarize the state of the transition wakelock on one line.
- Don't print Inet condition reports if there are none.
(Currently there can never be any.)
Bug: 21449922
Change-Id: Ib4b29a7fd882e6c105839a255fffecf4f346cf7e
Diffstat (limited to 'services/core/java/com/android/server/connectivity/Tethering.java')
-rw-r--r-- | services/core/java/com/android/server/connectivity/Tethering.java | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/services/core/java/com/android/server/connectivity/Tethering.java b/services/core/java/com/android/server/connectivity/Tethering.java index bb4ff1e..897300f 100644 --- a/services/core/java/com/android/server/connectivity/Tethering.java +++ b/services/core/java/com/android/server/connectivity/Tethering.java @@ -48,6 +48,7 @@ import com.android.internal.telephony.IccCardConstants; import com.android.internal.telephony.Phone; import com.android.internal.telephony.PhoneConstants; import com.android.internal.telephony.TelephonyIntents; +import com.android.internal.util.IndentingPrintWriter; import com.android.internal.util.IState; import com.android.internal.util.State; import com.android.internal.util.StateMachine; @@ -1684,7 +1685,9 @@ public class Tethering extends BaseNetworkObserver { } } - public void dump(FileDescriptor fd, PrintWriter pw, String[] args) { + public void dump(FileDescriptor fd, PrintWriter writer, String[] args) { + final IndentingPrintWriter pw = new IndentingPrintWriter(writer, " "); + if (mContext.checkCallingOrSelfPermission( android.Manifest.permission.DUMP) != PackageManager.PERMISSION_GRANTED) { pw.println("Permission Denial: can't dump ConnectivityService.Tether " + @@ -1693,19 +1696,23 @@ public class Tethering extends BaseNetworkObserver { return; } + pw.println("Tethering:"); + pw.increaseIndent(); + pw.print("mUpstreamIfaceTypes:"); synchronized (mPublicSync) { - pw.println("mUpstreamIfaceTypes: "); for (Integer netType : mUpstreamIfaceTypes) { - pw.println(" " + netType); + pw.print(" " + ConnectivityManager.getNetworkTypeName(netType)); } - pw.println(); + pw.println("Tether state:"); + pw.increaseIndent(); for (Object o : mIfaces.values()) { - pw.println(" " + o); + pw.println(o); } + pw.decreaseIndent(); } - pw.println(); + pw.decreaseIndent(); return; } } |