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

Commit d7030f12 authored by Michele Berionne's avatar Michele Berionne Committed by Android (Google) Code Review
Browse files

Merge "Improved mechanism to retrieve metrics"

parents ea51b182 4b677c10
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -44,8 +44,9 @@ public class DebugService {
     */
    public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
        if (args != null && args.length > 0) {
            if (TextUtils.equals(args[0], "--metrics") ||
                    TextUtils.equals(args[0], "--metricsproto"))
            if (TextUtils.equals(args[0], "--metrics")
                    || TextUtils.equals(args[0], "--metricsproto")
                    || TextUtils.equals(args[0], "--metricsprototext"))
            {
                log("Collecting telephony metrics..");
                TelephonyMetrics.getInstance().dump(fd, pw, args);
+11 −1
Original line number Diff line number Diff line
@@ -241,13 +241,23 @@ public class TelephonyMetrics {
     */
    public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
        if (args != null && args.length > 0) {
            boolean reset = true;
            if (args.length > 1 && "--keep".equals(args[1])) {
                reset = false;
            }

            switch (args[0]) {
                case "--metrics":
                    printAllMetrics(pw);
                    break;
                case "--metricsproto":
                    pw.println(convertProtoToBase64String(buildProto()));
                    if (reset) {
                        reset();
                    }
                    break;
                case "--metricsprototext":
                    pw.println(buildProto().toString());
                    break;
            }
        }