summaryrefslogtreecommitdiffstats
path: root/twrp-functions.cpp
diff options
context:
space:
mode:
authorEthan Yonker <dees_troy@teamw.in>2014-11-21 20:54:27 +0100
committerEthan Yonker <dees_troy@teamw.in>2014-12-02 17:34:15 +0100
commit75bf041a8ad75f8fc9bba69e937e12b129338a4c (patch)
tree9a3202b8c06e075e1749a44948a3a3f184edf95e /twrp-functions.cpp
parentTWRP MTP: make sure inotify_fd is set (diff)
downloadandroid_bootable_recovery-75bf041a8ad75f8fc9bba69e937e12b129338a4c.tar
android_bootable_recovery-75bf041a8ad75f8fc9bba69e937e12b129338a4c.tar.gz
android_bootable_recovery-75bf041a8ad75f8fc9bba69e937e12b129338a4c.tar.bz2
android_bootable_recovery-75bf041a8ad75f8fc9bba69e937e12b129338a4c.tar.lz
android_bootable_recovery-75bf041a8ad75f8fc9bba69e937e12b129338a4c.tar.xz
android_bootable_recovery-75bf041a8ad75f8fc9bba69e937e12b129338a4c.tar.zst
android_bootable_recovery-75bf041a8ad75f8fc9bba69e937e12b129338a4c.zip
Diffstat (limited to 'twrp-functions.cpp')
-rw-r--r--twrp-functions.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/twrp-functions.cpp b/twrp-functions.cpp
index a2970b007..96114241f 100644
--- a/twrp-functions.cpp
+++ b/twrp-functions.cpp
@@ -525,12 +525,20 @@ int TWFunc::tw_reboot(RebootCommand command)
return reboot(RB_AUTOBOOT);
case rb_recovery:
check_and_run_script("/sbin/rebootrecovery.sh", "reboot recovery");
+#ifdef ANDROID_RB_PROPERTY
property_set(ANDROID_RB_PROPERTY, "reboot,recovery");
+#else
+ return __reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, LINUX_REBOOT_CMD_RESTART2, (void*) "recovery");
+#endif
sleep(5);
return 0;
case rb_bootloader:
check_and_run_script("/sbin/rebootbootloader.sh", "reboot bootloader");
+#ifdef ANDROID_RB_PROPERTY
property_set(ANDROID_RB_PROPERTY, "reboot,bootloader");
+#else
+ return __reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, LINUX_REBOOT_CMD_RESTART2, (void*) "bootloader");
+#endif
sleep(5);
return 0;
case rb_poweroff:
@@ -541,7 +549,11 @@ int TWFunc::tw_reboot(RebootCommand command)
return reboot(RB_POWER_OFF);
case rb_download:
check_and_run_script("/sbin/rebootdownload.sh", "reboot download");
+#ifdef ANDROID_RB_PROPERTY
property_set(ANDROID_RB_PROPERTY, "reboot,download");
+#else
+ return __reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, LINUX_REBOOT_CMD_RESTART2, (void*) "download");
+#endif
sleep(5);
return 0;
default: