summaryrefslogtreecommitdiffstats
path: root/twrp-functions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'twrp-functions.cpp')
-rw-r--r--twrp-functions.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/twrp-functions.cpp b/twrp-functions.cpp
index b96245751..a2970b007 100644
--- a/twrp-functions.cpp
+++ b/twrp-functions.cpp
@@ -50,6 +50,7 @@
#ifndef TW_EXCLUDE_ENCRYPTED_BACKUPS
#include "openaes/inc/oaes_lib.h"
#endif
+#include "cutils/android_reboot.h"
extern "C" {
#include "libcrecovery/common.h"
@@ -524,10 +525,14 @@ int TWFunc::tw_reboot(RebootCommand command)
return reboot(RB_AUTOBOOT);
case rb_recovery:
check_and_run_script("/sbin/rebootrecovery.sh", "reboot recovery");
- return __reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, LINUX_REBOOT_CMD_RESTART2, (void*) "recovery");
+ property_set(ANDROID_RB_PROPERTY, "reboot,recovery");
+ sleep(5);
+ return 0;
case rb_bootloader:
check_and_run_script("/sbin/rebootbootloader.sh", "reboot bootloader");
- return __reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, LINUX_REBOOT_CMD_RESTART2, (void*) "bootloader");
+ property_set(ANDROID_RB_PROPERTY, "reboot,bootloader");
+ sleep(5);
+ return 0;
case rb_poweroff:
check_and_run_script("/sbin/poweroff.sh", "power off");
#ifdef ANDROID_RB_POWEROFF
@@ -536,7 +541,9 @@ int TWFunc::tw_reboot(RebootCommand command)
return reboot(RB_POWER_OFF);
case rb_download:
check_and_run_script("/sbin/rebootdownload.sh", "reboot download");
- return __reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, LINUX_REBOOT_CMD_RESTART2, (void*) "download");
+ property_set(ANDROID_RB_PROPERTY, "reboot,download");
+ sleep(5);
+ return 0;
default:
return -1;
}