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

Commit a65a4ce5 authored by Dhavalkumar Chaudhary's avatar Dhavalkumar Chaudhary Committed by Android (Google) Code Review
Browse files

Merge "Add duration limit for batterystats real checkin format" into main

parents 37400aec 5dd8f6c0
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -70,5 +70,9 @@
    It only affects the `dumpsys batterystats -c` command, The checkin Format -->
    <integer name="config_batteryHistoryDumpCheckinWindowSize">0</integer>

    <!-- Time span of battery history dump, in milliseconds, default value is 24 hours in millis.
    It only affects the `dumpsys batterystats -\-checkin` command, The real checkin Format -->
    <integer name="config_batteryHistoryDumpRealCheckinWindowSize">86400000</integer>


</resources>
+1 −0
Original line number Diff line number Diff line
@@ -5467,6 +5467,7 @@
  <java-symbol type="integer" name="config_batteryHistoryStorageSize" />
  <java-symbol type="integer" name="config_batteryHistoryDumpWindowSize" />
  <java-symbol type="integer" name="config_batteryHistoryDumpCheckinWindowSize" />
  <java-symbol type="integer" name="config_batteryHistoryDumpRealCheckinWindowSize" />

  <!--Dynamic Tokens-->
  <java-symbol name="system_accent1_0_light" type="color"/>
+12 −0
Original line number Diff line number Diff line
@@ -3105,6 +3105,18 @@ public final class BatteryStatsService extends IBatteryStats.Stub
                if ("--checkin".equals(arg)) {
                    useCheckinFormat = true;
                    isRealCheckin = true;
                    if (Flags.realCheckinHistoryStartTime()) {
                        long realCheckinDurationLimit = mContext.getResources().getInteger(
                                com.android.internal.R.integer
                                .config_batteryHistoryDumpRealCheckinWindowSize);
                        if (realCheckinDurationLimit > 0) {
                            monotonicClockStartTime =
                                mMonotonicClock.monotonicTime() - realCheckinDurationLimit;
                            if (monotonicClockStartTime < 0) {
                                monotonicClockStartTime = 0;
                            }
                        }
                    }
                } else if ("--history".equals(arg)) {
                    flags |= BatteryStats.DUMP_HISTORY_ONLY;
                } else if ("--history-start".equals(arg)) {
+8 −0
Original line number Diff line number Diff line
@@ -46,3 +46,11 @@ flag {
     bug: "403599628"
     is_fixed_read_only: true
}

flag {
     namespace: "backstage_power"
     name: "real_checkin_history_start_time"
     description: "Add duration limit to battery stats real check in (csv) format"
     bug: "403599628"
     is_fixed_read_only: true
}