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 #3

Open
wants to merge 3 commits into
base: typhoon-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
5 changes: 5 additions & 0 deletions suspend/1.0/default/SystemSuspend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include <string>
#include <thread>
using namespace std::chrono_literals;
#include <cstdlib>

using ::aidl::android::system::suspend::ISystemSuspend;
using ::aidl::android::system::suspend::IWakeLock;
Expand Down Expand Up @@ -406,6 +407,8 @@ 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 autosuspendLock = std::unique_lock(mAutosuspendLock);
bool success = WriteStringToFd(getSleepState(), mStateFd);
autosuspendLock.unlock();
Expand All @@ -414,6 +417,8 @@ bool SystemSuspend::forceSuspend() {
PLOG(VERBOSE) << "error writing to /sys/power/state for forceSuspend";
}
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 early_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