summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEthan Yonker <dees_troy@teamw.in>2014-11-07 17:33:08 +0100
committerEthan Yonker <dees_troy@teamw.in>2014-11-07 17:33:08 +0100
commitd7f2092ea082cd669fc774d3159eb98ecb96dc01 (patch)
tree462c6af40ffa6ed486e67e50a43c4e2a503ba1e6
parentFix merge derp in main Android.mk file (diff)
downloadandroid_bootable_recovery-d7f2092ea082cd669fc774d3159eb98ecb96dc01.tar
android_bootable_recovery-d7f2092ea082cd669fc774d3159eb98ecb96dc01.tar.gz
android_bootable_recovery-d7f2092ea082cd669fc774d3159eb98ecb96dc01.tar.bz2
android_bootable_recovery-d7f2092ea082cd669fc774d3159eb98ecb96dc01.tar.lz
android_bootable_recovery-d7f2092ea082cd669fc774d3159eb98ecb96dc01.tar.xz
android_bootable_recovery-d7f2092ea082cd669fc774d3159eb98ecb96dc01.tar.zst
android_bootable_recovery-d7f2092ea082cd669fc774d3159eb98ecb96dc01.zip
-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;
}