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

Commit df6baff6 authored by Bookatz's avatar Bookatz
Browse files

BatteryStats: NETWORK_TYPE_NR support

NETWORK_TYPE_NR was added in ag/5629764.
This cl adds this new type to the human-readable dump output and ensures
that new network types won't crash the dumpsys (instead they'll print
ERROR).

Bug: 120778989
Test: android.dumpsys.cts.BatteryStatsDumpsysTest#testBatterystatsOutput
Change-Id: I9a6b966ca961bde37eadd924ce3ba0166a943ff8
parent 5f48d6bf
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -2283,7 +2283,8 @@ public abstract class BatteryStats implements Parcelable {
    static final String[] DATA_CONNECTION_NAMES = {
        "none", "gprs", "edge", "umts", "cdma", "evdo_0", "evdo_A",
        "1xrtt", "hsdpa", "hsupa", "hspa", "iden", "evdo_b", "lte",
        "ehrpd", "hspap", "gsm", "td_scdma", "iwlan", "lte_ca", "other"
        "ehrpd", "hspap", "gsm", "td_scdma", "iwlan", "lte_ca", "nr",
        "other"
    };

    public static final int NUM_DATA_CONNECTION_TYPES = DATA_CONNECTION_OTHER+1;
@@ -4730,7 +4731,7 @@ public abstract class BatteryStats implements Parcelable {
            sb.append("\n       ");
            sb.append(prefix);
            didOne = true;
            sb.append(DATA_CONNECTION_NAMES[i]);
            sb.append(i < DATA_CONNECTION_NAMES.length ? DATA_CONNECTION_NAMES[i] : "ERROR");
            sb.append(" ");
            formatTimeMs(sb, time/1000);
            sb.append("(");