power: Make min_visible_backlight_level pref optional.

Make powerd's min_visible_backlight_level preference
optional instead of defaulting to 1. If it's set, it's used
unconditionally (after clamping to [1, max]). Otherwise, a
computed default (0.0065 * max) is used.

Previously, the max of the pref and the computed default
were used, meaning that the pref could be used to increase
the minimum level beyond the computed default but not to
decrease it. I think that powerd may not have supported
optional prefs initially.

BUG=chrome-os-partner:36196
TEST=added a test

Change-Id: Icd26fddc4ee2260b24df14f1e9d1ade76291f681
Reviewed-on: https://chromium-review.googlesource.com/245880
Commit-Queue: Dan Erat <derat@chromium.org>
Trybot-Ready: Dan Erat <derat@chromium.org>
Tested-by: Dan Erat <derat@chromium.org>
Reviewed-by: Sameer Nanda <snanda@chromium.org>
5 files changed