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

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

Merge "ParceledListSlice shouldn't be created with null" into pi-dev

parents 8d15ff04 db860eb1
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -69,6 +69,7 @@ import java.nio.charset.StandardCharsets;
import java.util.ArrayDeque;
import java.util.ArrayList;

import java.util.Collections;
import java.util.Deque;
import java.util.HashMap;
import java.util.Map;
@@ -657,7 +658,10 @@ public class BrightnessTracker {
    }

    public ParceledListSlice<AmbientBrightnessDayStats> getAmbientBrightnessStats(int userId) {
        return new ParceledListSlice<>(mAmbientBrightnessStatsTracker.getUserStats(userId));
        ArrayList<AmbientBrightnessDayStats> stats = mAmbientBrightnessStatsTracker.getUserStats(
                userId);
        return (stats != null) ? new ParceledListSlice<>(stats) : new ParceledListSlice<>(
                Collections.EMPTY_LIST);
    }

    // Not allowed to keep the SensorEvent so used to copy the data we care about.