diff options
Diffstat (limited to '')
-rw-r--r-- | twrp-functions.cpp | 12 |
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: |