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

Commit 89230667 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "powerstats: Add null checks to clients of power stats api" into sc-dev

parents 50ccbcd5 4b6fa610
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -111,6 +111,8 @@ public class ProtoStreamUtils {
    static class StateResidencyResultUtils {
        public static void adjustTimeSinceBootToEpoch(StateResidencyResult[] stateResidencyResult,
                long startWallTime) {
            if (stateResidencyResult == null) return;

            for (int i = 0; i < stateResidencyResult.length; i++) {
                final int stateLength = stateResidencyResult[i].stateResidencyData.length;
                for (int j = 0; j < stateLength; j++) {
@@ -320,6 +322,8 @@ public class ProtoStreamUtils {
    static class EnergyMeasurementUtils {
        public static void adjustTimeSinceBootToEpoch(EnergyMeasurement[] energyMeasurement,
                long startWallTime) {
            if (energyMeasurement == null) return;

            for (int i = 0; i < energyMeasurement.length; i++) {
                energyMeasurement[i].timestampMs += startWallTime;
            }
@@ -539,6 +543,8 @@ public class ProtoStreamUtils {
    static class EnergyConsumerResultUtils {
        public static void adjustTimeSinceBootToEpoch(EnergyConsumerResult[] energyConsumerResult,
                long startWallTime) {
            if (energyConsumerResult == null) return;

            for (int i = 0; i < energyConsumerResult.length; i++) {
                energyConsumerResult[i].timestampMs += startWallTime;
            }