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

Unified Diff: action_lid.sh

Issue 2626006: Update action_lid.sh to use new RequestSuspend signal (6 of 7). (Closed) Base URL: ssh://git@chromiumos-git/acpi.git
Patch Set: Created 10 years, 6 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: action_lid.sh
diff --git a/action_lid.sh b/action_lid.sh
index 9e6103edde3795433a9d011af6456bfd1d23425a..7c66d874cc5f61b9b01793dc528eea5ab6a2436c 100755
--- a/action_lid.sh
+++ b/action_lid.sh
@@ -12,52 +12,6 @@ if [ $? != 0 ]; then
exit 0
fi
-
-# Shutdowns instead of sleeping if no one is logged in.
-if ! test -f /var/run/state/logged-in; then
- logger "action_lid.sh: lid closed. Shutting down since no one is logged in"
- shutdown -h now
- exit 0
-fi
-
-logger "action_lid.sh: lid closed. Going to suspend-to-RAM state"
-
-# On lid close:
-# - locks the screen
-export HOME=/home/chronos
-/usr/bin/xscreensaver-command -l
-
-# - logs the time going to suspend (no-op if no RTC).
-cp /sys/class/rtc/rtc0/since_epoch /var/log/metrics/suspend-to-ram-time \
- 2> /dev/null || true
-
-# - announces the event
+logger "action_lid.sh: lid closed. Requesting suspend."
Sameer Nanda 2010/06/07 02:38:34 use '-t' to add a tag and preferably use the same
/usr/bin/dbus-send --type=signal --system / \
- org.chromium.Power.Manager.PowerStateChanged string:mem
-
-# - sleeps for a bit to give the window manager time to draw the xscreensaver
-# window to the screen -- see http://crosbug.com/2250.
-# TODO: Remove this hack once we have a better solution in place that adds
-# some coordination between the screen locker and the window manager.
-sleep 0.5
-
-# - suspends the cryptohome device
-#CRYPTOHOME=/dev/mapper/cryptohome
-#/usr/bin/test -b $CRYPTOHOME && /sbin/dmsetup suspend $CRYPTOHOME
-
-# - suspends to ram
-echo -n mem > /sys/power/state
-
-# On lid open:
-# - has it such that you don't have to press a key to display lock screen
-/usr/bin/xscreensaver-command -deactivate
-
-# - announces the event
-/usr/bin/dbus-send --type=signal --system / \
- org.chromium.Power.Manager.PowerStateChanged string:on &
-
-# - sends UMA metrics on resume
-/usr/bin/send_metrics_on_resume
-
-# - resumes cryptohome device
-#/usr/bin/test -b $CRYPTOHOME && /sbin/dmsetup resume $CRYPTOHOME
+ org.chromium.PowerManager.RequestSuspend
« 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