power: Support max-level-dependent initial brightness.

To make it possible to use a single image in conjunction
with different backlight hardware, extend the format of
powerd's internal_backlight_no_als_ac_brightness and
internal_backlight_no_als_battery_brightness prefs to
support defining multiple initial brightness percentages.

For example, using:

60.0 250
50.0 500

indicates that 60% should be used when the backlight's
maximum brightness level is reported as 250, while 50%
should be used for 500.

Note that the former single-percentage format is still
allowed (and should be used in almost all cases).

Also note that when defining multiple percentages, all
possible maximum levels must be supplied.

BUG=chrome-os-partner:28715
TEST=added unit tests; manually checked that powerd starts
     up happily on lumpy

Change-Id: Icfb901c91ca7b25ee36a1c5d1f2d6aa5875fcae0
Reviewed-on: https://chromium-review.googlesource.com/199159
Commit-Queue: Daniel Erat <derat@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
Reviewed-by: Chris Masone <cmasone@chromium.org>
3 files changed