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

Commit 850c6570 authored by Peeyush Agarwal's avatar Peeyush Agarwal Committed by android-build-merger
Browse files

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

am: 6279c5ab

Change-Id: I87d7381370a0b5e140768d1080481619b16438f7
parents 1e4188ca 6279c5ab
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.