Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(95)

Unified Diff: src/platform/acpi/action_lid.sh

Issue 1084013: Added check to ensure LID is in a closed state before proceeding (Closed)
Patch Set: Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform/acpi/action_lid.sh
diff --git a/src/platform/acpi/action_lid.sh b/src/platform/acpi/action_lid.sh
index 48c8821e7e52a602507d7aae49450ae3f10e28a5..4cab07c965a904aafa8d10bfb410b96958eaab43 100755
--- a/src/platform/acpi/action_lid.sh
+++ b/src/platform/acpi/action_lid.sh
@@ -10,6 +10,12 @@ if ! test -f /var/run/state/logged-in; then
exit 0
fi
+# Check whether the lid is closed before proceeding
+grep -q open /proc/acpi/button/lid/*/state
+if [ $? = 0 ]; then
+ exit 0
+fi
+
# On lid close:
# - lock the screen
export HOME=/home/chronos
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698