From d364a24856e21ea58f74b3600950fe932b7d03fb Mon Sep 17 00:00:00 2001 From: Erik Kline Date: Fri, 12 May 2017 16:52:48 +0900 Subject: [PATCH] Expand logging capabilities of Tethering subsystem Introduce a SharedLog that can be shared among all Tethering components. All log entries go to the same log, and each includes its subsystem name. Additionally, all entries emitted to the system log shared the same tag, so can easily be watched. More subsystems can inherit a SharedLog, but to minimize cherry-pick conflicts we limit ourselves to these changes only. Test: as follows - built - flashed - booted - log output observed via dumpsys - runtest frameworks-net passes Bug: 32163131 Bug: 36988090 Bug: 38218697 Change-Id: I1229d4c55987402d84b0d4a2c8a595e0c829aa3e --- .../core/java/com/android/server/ConnectivityService.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java index 47026d6815..19badbd605 100644 --- a/services/core/java/com/android/server/ConnectivityService.java +++ b/services/core/java/com/android/server/ConnectivityService.java @@ -183,6 +183,9 @@ public class ConnectivityService extends IConnectivityManager.Stub implements PendingIntent.OnFinished { private static final String TAG = ConnectivityService.class.getSimpleName(); + public static final String DIAG_ARG = "--diag"; + public static final String SHORT_ARG = "--short"; + private static final boolean DBG = true; private static final boolean VDBG = false; @@ -1961,7 +1964,7 @@ public class ConnectivityService extends IConnectivityManager.Stub return; } - if (argsContain(args, "--diag")) { + if (argsContain(args, DIAG_ARG)) { dumpNetworkDiagnostics(pw); return; } @@ -2053,7 +2056,7 @@ public class ConnectivityService extends IConnectivityManager.Stub pw.println(); dumpAvoidBadWifiSettings(pw); - if (argsContain(args, "--short") == false) { + if (argsContain(args, SHORT_ARG) == false) { pw.println(); synchronized (mValidationLogs) { pw.println("mValidationLogs (most recent first):");