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

am: 6279c5ab6e

Change-Id: I87d7381370a0b5e140768d1080481619b16438f7
This commit is contained in:
Peeyush Agarwal
2018-03-08 15:42:19 +00:00
committed by android-build-merger

View File

@@ -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.