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

Commit 21467670 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

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

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13804575

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I4aa7d252d924392bae37abb1ab4aa1c626216262
parents fd0e8515 89230667
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;
            }