Fix entering mirror mode on docked

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

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

Bug: 790720,

(cherry picked from commit 208b44ca364b93b73286b3364f1700009197afc6)

Change-Id: I1d9fa6394350303730062136c7bfe7a5a6fe98f5
Reviewed-by: Robert Flack <>
Reviewed-by: Ahmed Fakhry <>
Reviewed-by: Stefan Kuhne <>
Commit-Queue: Weidong Guo <>
Cr-Original-Commit-Position: refs/heads/master@{#535181}
Reviewed-by: Weidong Guo <>
Cr-Commit-Position: refs/branch-heads/3325@{#559}
Cr-Branched-From: bc084a8b5afa3744a74927344e304c02ae54189f-refs/heads/master@{#530369}
3 files changed