Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

call /system/etc/(post/pre)_sleep.sh before and after sleep, allow module probing (r11) #8

Open
wants to merge 3 commits into
base: r11-x86
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions suspend/1.0/default/SystemSuspend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

#include <string>
#include <thread>
#include <cstdlib>

using ::android::base::GetBoolProperty;
using ::android::base::GetProperty;
Expand Down Expand Up @@ -292,6 +293,9 @@ bool SystemSuspend::forceSuspend() {
// or reset mSuspendCounter, it just ignores them. When the system
// returns from suspend, the wakelocks and SuspendCounter will not have
// changed.
std::system("/system/bin/sh /system/etc/pre_sleep.sh");
std::system("/system/bin/sh /vendor/etc/pre_sleep.sh");

auto counterLock = std::unique_lock(mCounterLock);
bool success = WriteStringToFd(getSleepState(), mStateFd);
counterLock.unlock();
Expand All @@ -302,6 +306,9 @@ bool SystemSuspend::forceSuspend() {
// light the screen up after suspend attempt, regardless of it failed or not
// that way the user would know to try and sleep the device again if they want to
mPwrbtnd->sendKeyWakeup();
std::system("/system/bin/sh /system/etc/post_sleep.sh");
std::system("/system/bin/sh /vendor/etc/post_sleep.sh");

return success;
}

Expand Down
9 changes: 6 additions & 3 deletions suspend/1.0/default/[email protected]
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
service system_suspend /system/bin/hw/[email protected]
class hal
user system
group system wakelock uhid input
capabilities BLOCK_SUSPEND
#user system
#group system wakelock uhid input
#capabilities BLOCK_SUSPEND
user root
group root
seclabel u:r:su:s0