Fix entering mirror mode on docked

Background:
Mirror mode is turned on upon entering tablet mode. Tablet mode is
entered when lid angle is larger than 200 degree. However, closing lid
triggers erroneous accelerometer reading which makes the lid appear to
be fully open (e.g. 359 degree). So mirror mode is incorrectly turned
on.

Changes:
Ignore unstable lid angle for 2 seconds and only use unstable lid
angle to turn on/off tablet mode after that.

Bug: 790720

TBR=afakhry@chromium.org,skuhne@chromium.org

(cherry picked from commit 208b44ca364b93b73286b3364f1700009197afc6)

Change-Id: I1d9fa6394350303730062136c7bfe7a5a6fe98f5
Reviewed-on: https://chromium-review.googlesource.com/814936
Reviewed-by: Robert Flack <flackr@chromium.org>
Reviewed-by: Ahmed Fakhry <afakhry@chromium.org>
Reviewed-by: Stefan Kuhne <skuhne@chromium.org>
Commit-Queue: Weidong Guo <weidongg@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#535181}
Reviewed-on: https://chromium-review.googlesource.com/927213
Reviewed-by: Weidong Guo <weidongg@chromium.org>
Cr-Commit-Position: refs/branch-heads/3325@{#559}
Cr-Branched-From: bc084a8b5afa3744a74927344e304c02ae54189f-refs/heads/master@{#530369}
3 files changed