summaryrefslogtreecommitdiffstats
path: root/twrp-functions.cpp
diff options
context:
space:
mode:
authorDees_Troy <dees_troy@teamw.in>2013-02-22 19:44:00 +0100
committerDees_Troy <dees_troy@teamw.in>2013-02-22 19:49:47 +0100
commita4438784ebbed7fc377b429aab7332352abdd670 (patch)
treef66b84308d1a479a7362062b0b3149b045832d67 /twrp-functions.cpp
parentusing __popen segfaults, switch back to popen (diff)
downloadandroid_bootable_recovery-a4438784ebbed7fc377b429aab7332352abdd670.tar
android_bootable_recovery-a4438784ebbed7fc377b429aab7332352abdd670.tar.gz
android_bootable_recovery-a4438784ebbed7fc377b429aab7332352abdd670.tar.bz2
android_bootable_recovery-a4438784ebbed7fc377b429aab7332352abdd670.tar.lz
android_bootable_recovery-a4438784ebbed7fc377b429aab7332352abdd670.tar.xz
android_bootable_recovery-a4438784ebbed7fc377b429aab7332352abdd670.tar.zst
android_bootable_recovery-a4438784ebbed7fc377b429aab7332352abdd670.zip
Diffstat (limited to '')
-rw-r--r--twrp-functions.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/twrp-functions.cpp b/twrp-functions.cpp
index 3e06f8770..d1f9e3dbd 100644
--- a/twrp-functions.cpp
+++ b/twrp-functions.cpp
@@ -12,7 +12,9 @@
#include <sys/sendfile.h>
#include <sys/stat.h>
#include <sys/vfs.h>
-#include "cutils/android_reboot.h"
+#ifdef ANDROID_RB_POWEROFF
+ #include "cutils/android_reboot.h"
+#endif
#include <iostream>
#include <fstream>
#include "twrp-functions.hpp"
@@ -375,7 +377,9 @@ int TWFunc::tw_reboot(RebootCommand command)
return __reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, LINUX_REBOOT_CMD_RESTART2, (void*) "bootloader");
case rb_poweroff:
check_and_run_script("/sbin/poweroff.sh", "power off");
+#ifdef ANDROID_RB_POWEROFF
android_reboot(ANDROID_RB_POWEROFF, 0, 0);
+#endif
return reboot(RB_POWER_OFF);
case rb_download:
check_and_run_script("/sbin/rebootdownload.sh", "reboot download");