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

Commit b8d428e3 authored by Mat Bevilacqua's avatar Mat Bevilacqua
Browse files

Return empty array rather than null

Be consistent with PowerStats HAL return values.

Bug: 178414923
Test: atest FrameworksServicesTests:PowerStatsServiceTest
Change-Id: I4aa8bf09779f2e0023b7ad76db6c8e66f16a1158
parent 1ee02141
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -295,14 +295,14 @@ public final class PowerStatsHALWrapper {
        @Override
        public android.hardware.power.stats.EnergyConsumer[] getEnergyConsumerInfo() {
            if (DEBUG) Slog.d(TAG, "Energy consumer info is not supported");
            return null;
            return new android.hardware.power.stats.EnergyConsumer[0];
        }

        @Override
        public android.hardware.power.stats.EnergyConsumerResult[] getEnergyConsumed(
                int[] energyConsumerIds) {
            if (DEBUG) Slog.d(TAG, "Energy consumer results are not supported");
            return null;
            return new android.hardware.power.stats.EnergyConsumerResult[0];
        }

        @Override