mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-27 18:25:05 +00:00
1d093deb54a2713295add2ebae41f6c2abb78e62
Chrome seems to pay attention to the tablet mode switch reported by the EC. However, for some devices that don't actually have a switch and use the lid angle as a "virtual" switch, it's possible for invalid tablet mode change events to be reported. This is because a single reading could flip the switch. This commit adds some debouncing to the tablet mode event changes. Instead of having a single event be able to change the tablet mode switch, we will now perform TABLET_MODE_DEBOUNCE_COUNT number of calculations of the new tablet mode value. If those calculations all agree, then we'll flip the switch. This should help mitigate false tablet mode change events caused by spurious forces. BUG=chrome-os-partner:59203 BUG=chrome-os-partner:59480 BRANCH=gru TEST=flash kevin; open lid to pi/2 rad; rotate device counter-clockwise pi/2 rad; shake device and verify that tablet mode doesn't change easily. TEST=verify that tablet mode still works. Change-Id: Id020f7db28e93e53b276b3f0d28a40251f035f0b Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/410942 Commit-Ready: Gwendal Grignou <gwendal@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
For an overview of the Embedded Controller firmware, refer to http://www.chromium.org/chromium-os/2014-firmware-summit For instructions on building from source, refer to http://www.chromium.org/chromium-os/ec-development/getting-started-building-ec-images-quickly
Description
Languages
C
64.7%
Lasso
20.7%
ASL
3.6%
JavaScript
3.2%
C#
2.9%
Other
4.6%