power: Emit InputEvent signals on TABLET_MODE change

This is part of the patch set that hooks up tablet mode switch
to Chrome. If the tablet mode switch is on then Chrome can know
for sure that it needs to enable maximize mode (tablet mode).
The helps Chrome to decide whether to enable tablet mode in some
corner cases where the accelerometer readings are not stable.

BUG=chrome-os-partner:49114
CQ-DEPEND=CL:347529
TEST=`FEATURES=test emerge-amd64-generic power_manager`
TEST=Build power_manager and chrome and deploy to my DUT. Make
     sure that:
     - The device enters maximize mode when tablet mode switch
       is on.
     - The device leaves maximize mode when tablet mode switch
       is off and lid angle is less than kExitMaximizeModeAngle.

Change-Id: Ie18a7abd52c37c8e5afdad2ee4b3097a9902d61a
Signed-off-by: Ricky Liang <jcliang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/347724
Reviewed-by: Dan Erat <derat@chromium.org>
Reviewed-by: Wei-Ning Huang <wnhuang@chromium.org>
(cherry picked from commit 6b718a4ae83d49c47b7a57327f4ba744c9de59b5)
Reviewed-on: https://chromium-review.googlesource.com/356318
4 files changed