Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d7f2092e authored by Ethan Yonker's avatar Ethan Yonker
Browse files

Fix up tw_reboot function

Change-Id: I53d329e493f4bcb3fe9ed177e7b2dede30ccf490
parent c376ac8d
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -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;
	}