Handle invalid empty args to createAutoBrightnessSpline

BUG: 18572096
Change-Id: I9dfc2215994a4f7a70ef6bdd04b620917e4ec034
This commit is contained in:
Erik Wolsheimer
2016-06-28 14:51:07 -07:00
parent 25242a7bbc
commit ad82aca96b

View File

@@ -1181,6 +1181,10 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call
}
private static Spline createAutoBrightnessSpline(int[] lux, int[] brightness) {
if (lux == null || lux.length == 0 || brightness == null || brightness.length == 0) {
Slog.e(TAG, "Could not create auto-brightness spline.");
return null;
}
try {
final int n = brightness.length;
float[] x = new float[n];