diff --git a/suspend/1.0/default/SystemSuspend.cpp b/suspend/1.0/default/SystemSuspend.cpp index 6d8cebb..3c3b233 100644 --- a/suspend/1.0/default/SystemSuspend.cpp +++ b/suspend/1.0/default/SystemSuspend.cpp @@ -36,6 +36,7 @@ #include #include using namespace std::chrono_literals; +#include using ::aidl::android::system::suspend::ISystemSuspend; using ::aidl::android::system::suspend::IWakeLock; @@ -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(); @@ -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; } diff --git a/suspend/1.0/default/android.system.suspend@1.0-service.rc b/suspend/1.0/default/android.system.suspend@1.0-service.rc index c0c2f5c..8f1ae0f 100644 --- a/suspend/1.0/default/android.system.suspend@1.0-service.rc +++ b/suspend/1.0/default/android.system.suspend@1.0-service.rc @@ -1,5 +1,8 @@ service system_suspend /system/bin/hw/android.system.suspend@1.0-service 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