diff options
author | Lorenzo Colitti <lorenzo@google.com> | 2014-08-19 11:45:46 -0700 |
---|---|---|
committer | Lorenzo Colitti <lorenzo@google.com> | 2014-08-19 20:03:35 -0700 |
commit | aea43f5901e6591c390b83b10d3dd9b515a6442a (patch) | |
tree | a052018d5cb427e165b3f2e047cb5c908d78a27a | |
parent | 41a372f13a7d19807d91e09f2e955b8a61f02d5c (diff) | |
download | android_frameworks_opt_net_ethernet-aea43f5901e6591c390b83b10d3dd9b515a6442a.tar.gz android_frameworks_opt_net_ethernet-aea43f5901e6591c390b83b10d3dd9b515a6442a.tar.bz2 android_frameworks_opt_net_ethernet-aea43f5901e6591c390b83b10d3dd9b515a6442a.zip |
Actually provide useful output in Ethernet service dump.
Bug: 17133859
Change-Id: Ic8424004e48712e4dd906d5bb6a48ce7d38ff9d8
-rw-r--r-- | java/com/android/server/ethernet/EthernetNetworkFactory.java | 20 | ||||
-rw-r--r-- | java/com/android/server/ethernet/EthernetServiceImpl.java | 10 |
2 files changed, 28 insertions, 2 deletions
diff --git a/java/com/android/server/ethernet/EthernetNetworkFactory.java b/java/com/android/server/ethernet/EthernetNetworkFactory.java index c65a5b2..26e8264 100644 --- a/java/com/android/server/ethernet/EthernetNetworkFactory.java +++ b/java/com/android/server/ethernet/EthernetNetworkFactory.java @@ -45,8 +45,11 @@ import android.os.ServiceManager; import android.text.TextUtils; import android.util.Log; +import com.android.internal.util.IndentingPrintWriter; import com.android.server.net.BaseNetworkObserver; +import java.io.FileDescriptor; +import java.io.PrintWriter; import java.net.Inet4Address; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; @@ -413,4 +416,21 @@ class EthernetNetworkFactory { mNetworkCapabilities.setLinkUpstreamBandwidthKbps(100 * 1000); mNetworkCapabilities.setLinkDownstreamBandwidthKbps(100 * 1000); } + + synchronized void dump(FileDescriptor fd, IndentingPrintWriter pw, String[] args) { + if (!TextUtils.isEmpty(mIface)) { + pw.println("Tracking interface: " + mIface); + pw.increaseIndent(); + pw.println("MAC address: " + mHwAddr); + pw.println("Link state: " + (mLinkUp ? "up" : "down")); + pw.decreaseIndent(); + } else { + pw.println("Not tracking any interface"); + } + + pw.println(); + pw.println("NetworkInfo: " + mNetworkInfo); + pw.println("LinkProperties: " + mLinkProperties); + pw.println("NetworkAgent: " + mNetworkAgent); + } } diff --git a/java/com/android/server/ethernet/EthernetServiceImpl.java b/java/com/android/server/ethernet/EthernetServiceImpl.java index 1534aab..42d98f6 100644 --- a/java/com/android/server/ethernet/EthernetServiceImpl.java +++ b/java/com/android/server/ethernet/EthernetServiceImpl.java @@ -67,7 +67,7 @@ public class EthernetServiceImpl extends IEthernetManager.Stub { private Handler mHandler; private NetworkInfo mNetworkInfo; - private EthernetNetworkFactory mTracker; + private final EthernetNetworkFactory mTracker; public EthernetServiceImpl(Context context) { mContext = context; @@ -160,8 +160,14 @@ public class EthernetServiceImpl extends IEthernetManager.Stub { + ", uid=" + Binder.getCallingUid()); return; } - pw.println("Stored Ethernet configuration: "); + pw.println("Current Ethernet state: "); + pw.increaseIndent(); + mTracker.dump(fd, pw, args); + pw.decreaseIndent(); + + pw.println(); + pw.println("Stored Ethernet configuration: "); pw.increaseIndent(); pw.println(mIpConfiguration); pw.decreaseIndent(); |