Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ee363c4e authored by Erik Kline's avatar Erik Kline
Browse files

Support "dumpsys connectivity tethering"

Also print current upstream interface in tethering dump output.

Test: as follows
    - build
    - flashed
    - booted
    - runtest frameworks-net passes
    - "dumpsys connectivity tethering" shows just tethering info
Bug: 32163131
Bug: 36504926
Bug: 36988090
Bug: 38152109
Bug: 38186915
Bug: 38218697
Change-Id: I7f185fd71946a032e7f815207016294892df135d
parent 39ce589f
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -185,6 +185,7 @@ public class ConnectivityService extends IConnectivityManager.Stub

    public static final String DIAG_ARG = "--diag";
    public static final String SHORT_ARG = "--short";
    public static final String TETHERING_ARG = "tethering";

    private static final boolean DBG = true;
    private static final boolean VDBG = false;
@@ -1929,7 +1930,7 @@ public class ConnectivityService extends IConnectivityManager.Stub

    private boolean argsContain(String[] args, String target) {
        for (String arg : args) {
            if (arg.equals(target)) return true;
            if (target.equals(arg)) return true;
        }
        return false;
    }
@@ -1967,6 +1968,9 @@ public class ConnectivityService extends IConnectivityManager.Stub
        if (argsContain(args, DIAG_ARG)) {
            dumpNetworkDiagnostics(pw);
            return;
        } else if (argsContain(args, TETHERING_ARG)) {
            mTethering.dump(fd, pw, args);
            return;
        }

        pw.print("NetworkFactories for:");
+2 −1
Original line number Diff line number Diff line
@@ -1685,6 +1685,7 @@ public class Tethering extends BaseNetworkObserver implements IControlsTethering
                pw.println(" - lastError = " + tetherState.lastError);
            }
            pw.println("Upstream wanted: " + upstreamWanted());
            pw.println("Current upstream interface: " + mCurrentUpstreamIface);
            pw.decreaseIndent();
        }

@@ -1702,7 +1703,7 @@ public class Tethering extends BaseNetworkObserver implements IControlsTethering

    private static boolean argsContain(String[] args, String target) {
        for (String arg : args) {
            if (arg.equals(target)) return true;
            if (target.equals(arg)) return true;
        }
        return false;
    }