Add static IpClient logging
Support keeping IpClient logs around and dumping them
during dumpsys. Previously we got this benefit for
wifi by virtue of WifiStateMachine's long-lived nature.
Now that this is changing we need to be sure we have
logs, and this method gets us Ethernet logs as well.
Bug: 62476366
Bug: 77999594
Test: as follows
- built
- flashed
- booted
- runtest frameworks-net passes
- dumpsys connmetrics [ipclient] works
Change-Id: I1136a83de8097fdb4130debe1eaf689be7132fe5
This commit is contained in:
@@ -132,6 +132,7 @@ import com.android.internal.net.NetworkStatsFactory;
|
||||
import com.android.internal.net.VpnConfig;
|
||||
import com.android.internal.net.VpnInfo;
|
||||
import com.android.internal.net.VpnProfile;
|
||||
import com.android.internal.util.ArrayUtils;
|
||||
import com.android.internal.util.AsyncChannel;
|
||||
import com.android.internal.util.DumpUtils;
|
||||
import com.android.internal.util.IndentingPrintWriter;
|
||||
@@ -1992,13 +1993,6 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
||||
return ret;
|
||||
}
|
||||
|
||||
private boolean argsContain(String[] args, String target) {
|
||||
for (String arg : args) {
|
||||
if (target.equals(arg)) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void dumpNetworkDiagnostics(IndentingPrintWriter pw) {
|
||||
final List<NetworkDiagnostics> netDiags = new ArrayList<NetworkDiagnostics>();
|
||||
final long DIAG_TIME_MS = 5000;
|
||||
@@ -2027,10 +2021,10 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
||||
if (!DumpUtils.checkDumpPermission(mContext, TAG, pw)) return;
|
||||
if (asProto) return;
|
||||
|
||||
if (argsContain(args, DIAG_ARG)) {
|
||||
if (ArrayUtils.contains(args, DIAG_ARG)) {
|
||||
dumpNetworkDiagnostics(pw);
|
||||
return;
|
||||
} else if (argsContain(args, TETHERING_ARG)) {
|
||||
} else if (ArrayUtils.contains(args, TETHERING_ARG)) {
|
||||
mTethering.dump(fd, pw, args);
|
||||
return;
|
||||
}
|
||||
@@ -2098,7 +2092,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
||||
pw.println();
|
||||
mMultipathPolicyTracker.dump(pw);
|
||||
|
||||
if (argsContain(args, SHORT_ARG) == false) {
|
||||
if (ArrayUtils.contains(args, SHORT_ARG) == false) {
|
||||
pw.println();
|
||||
synchronized (mValidationLogs) {
|
||||
pw.println("mValidationLogs (most recent first):");
|
||||
|
||||
Reference in New Issue
Block a user