Loading services/core/java/com/android/server/ConnectivityService.java +28 −0 Original line number Diff line number Diff line Loading @@ -143,6 +143,7 @@ import com.android.server.connectivity.tethering.TetheringDependencies; import com.android.server.net.BaseNetworkObserver; import com.android.server.net.LockdownVpnTracker; import com.android.server.net.NetworkPolicyManagerInternal; import com.android.server.utils.PriorityDump; import com.google.android.collect.Lists; Loading Loading @@ -682,6 +683,28 @@ public class ConnectivityService extends IConnectivityManager.Stub } private LegacyTypeTracker mLegacyTypeTracker = new LegacyTypeTracker(); /** * Helper class which parses out priority arguments and dumps sections according to their * priority. If priority arguments are omitted, function calls the legacy dump command. */ private final PriorityDump.PriorityDumper mPriorityDumper = new PriorityDump.PriorityDumper() { @Override public void dumpHigh(FileDescriptor fd, PrintWriter pw, String[] args, boolean asProto) { doDump(fd, pw, new String[] {DIAG_ARG}, asProto); doDump(fd, pw, new String[] {SHORT_ARG}, asProto); } @Override public void dumpNormal(FileDescriptor fd, PrintWriter pw, String[] args, boolean asProto) { doDump(fd, pw, args, asProto); } @Override public void dump(FileDescriptor fd, PrintWriter pw, String[] args, boolean asProto) { doDump(fd, pw, args, asProto); } }; public ConnectivityService(Context context, INetworkManagementService netManager, INetworkStatsService statsService, INetworkPolicyManager policyManager) { this(context, netManager, statsService, policyManager, new IpConnectivityLog()); Loading Loading @@ -1862,8 +1885,13 @@ public class ConnectivityService extends IConnectivityManager.Stub @Override protected void dump(FileDescriptor fd, PrintWriter writer, String[] args) { PriorityDump.dump(mPriorityDumper, fd, writer, args); } private void doDump(FileDescriptor fd, PrintWriter writer, String[] args, boolean asProto) { final IndentingPrintWriter pw = new IndentingPrintWriter(writer, " "); if (!DumpUtils.checkDumpPermission(mContext, TAG, pw)) return; if (asProto) return; if (argsContain(args, DIAG_ARG)) { dumpNetworkDiagnostics(pw); Loading services/java/com/android/server/SystemServer.java +3 −1 Original line number Diff line number Diff line Loading @@ -1138,7 +1138,9 @@ public final class SystemServer { try { connectivity = new ConnectivityService( context, networkManagement, networkStats, networkPolicy); ServiceManager.addService(Context.CONNECTIVITY_SERVICE, connectivity); ServiceManager.addService(Context.CONNECTIVITY_SERVICE, connectivity, /* allowIsolated= */ false, DUMP_FLAG_PRIORITY_HIGH | DUMP_FLAG_PRIORITY_NORMAL); networkStats.bindConnectivityManager(connectivity); networkPolicy.bindConnectivityManager(connectivity); } catch (Throwable e) { Loading Loading
services/core/java/com/android/server/ConnectivityService.java +28 −0 Original line number Diff line number Diff line Loading @@ -143,6 +143,7 @@ import com.android.server.connectivity.tethering.TetheringDependencies; import com.android.server.net.BaseNetworkObserver; import com.android.server.net.LockdownVpnTracker; import com.android.server.net.NetworkPolicyManagerInternal; import com.android.server.utils.PriorityDump; import com.google.android.collect.Lists; Loading Loading @@ -682,6 +683,28 @@ public class ConnectivityService extends IConnectivityManager.Stub } private LegacyTypeTracker mLegacyTypeTracker = new LegacyTypeTracker(); /** * Helper class which parses out priority arguments and dumps sections according to their * priority. If priority arguments are omitted, function calls the legacy dump command. */ private final PriorityDump.PriorityDumper mPriorityDumper = new PriorityDump.PriorityDumper() { @Override public void dumpHigh(FileDescriptor fd, PrintWriter pw, String[] args, boolean asProto) { doDump(fd, pw, new String[] {DIAG_ARG}, asProto); doDump(fd, pw, new String[] {SHORT_ARG}, asProto); } @Override public void dumpNormal(FileDescriptor fd, PrintWriter pw, String[] args, boolean asProto) { doDump(fd, pw, args, asProto); } @Override public void dump(FileDescriptor fd, PrintWriter pw, String[] args, boolean asProto) { doDump(fd, pw, args, asProto); } }; public ConnectivityService(Context context, INetworkManagementService netManager, INetworkStatsService statsService, INetworkPolicyManager policyManager) { this(context, netManager, statsService, policyManager, new IpConnectivityLog()); Loading Loading @@ -1862,8 +1885,13 @@ public class ConnectivityService extends IConnectivityManager.Stub @Override protected void dump(FileDescriptor fd, PrintWriter writer, String[] args) { PriorityDump.dump(mPriorityDumper, fd, writer, args); } private void doDump(FileDescriptor fd, PrintWriter writer, String[] args, boolean asProto) { final IndentingPrintWriter pw = new IndentingPrintWriter(writer, " "); if (!DumpUtils.checkDumpPermission(mContext, TAG, pw)) return; if (asProto) return; if (argsContain(args, DIAG_ARG)) { dumpNetworkDiagnostics(pw); Loading
services/java/com/android/server/SystemServer.java +3 −1 Original line number Diff line number Diff line Loading @@ -1138,7 +1138,9 @@ public final class SystemServer { try { connectivity = new ConnectivityService( context, networkManagement, networkStats, networkPolicy); ServiceManager.addService(Context.CONNECTIVITY_SERVICE, connectivity); ServiceManager.addService(Context.CONNECTIVITY_SERVICE, connectivity, /* allowIsolated= */ false, DUMP_FLAG_PRIORITY_HIGH | DUMP_FLAG_PRIORITY_NORMAL); networkStats.bindConnectivityManager(connectivity); networkPolicy.bindConnectivityManager(connectivity); } catch (Throwable e) { Loading