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
Merged-In: Ia9d15f0dcc49ce070f8684eb8c8481310859faa5
Merged-In: I2644f518304a03da469fb9c2aa01a6d8f1a97901
Change-Id: I1229d4c55987402d84b0d4a2c8a595e0c829aa3e
(cherry picked from commit 7747fd4ce055e8e1f6381062a58b867728f57d85)
This commit is contained in:
Erik Kline
2017-05-12 16:52:48 +09:00
parent c34549c34c
commit 14ec7c7a2b

View File

@@ -175,6 +175,9 @@ public class ConnectivityService extends IConnectivityManager.Stub
implements PendingIntent.OnFinished { implements PendingIntent.OnFinished {
private static final String TAG = ConnectivityService.class.getSimpleName(); 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 DBG = true;
private static final boolean VDBG = false; private static final boolean VDBG = false;
@@ -1852,7 +1855,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
final IndentingPrintWriter pw = new IndentingPrintWriter(writer, " "); final IndentingPrintWriter pw = new IndentingPrintWriter(writer, " ");
if (!DumpUtils.checkDumpPermission(mContext, TAG, pw)) return; if (!DumpUtils.checkDumpPermission(mContext, TAG, pw)) return;
if (argsContain(args, "--diag")) { if (argsContain(args, DIAG_ARG)) {
dumpNetworkDiagnostics(pw); dumpNetworkDiagnostics(pw);
return; return;
} }
@@ -1938,7 +1941,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
pw.decreaseIndent(); pw.decreaseIndent();
} }
if (argsContain(args, "--short") == false) { if (argsContain(args, SHORT_ARG) == false) {
pw.println(); pw.println();
synchronized (mValidationLogs) { synchronized (mValidationLogs) {
pw.println("mValidationLogs (most recent first):"); pw.println("mValidationLogs (most recent first):");