Merge "ParceledListSlice shouldn't be created with null" into pi-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
6279c5ab6e
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user