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

Commit 98847a8f authored by Austen Dicken's avatar Austen Dicken
Browse files

use new libreboot method of rebooting

relevant change here: http://review.cyanogenmod.com/6128

Change-Id: Ide576ee90c3488b31785799dc873edb200f1ad9e
parent 43a53526
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -214,6 +214,8 @@ LOCAL_SHARED_LIBRARIES := \
	libjpeg \
	libnfc_ndef

LOCAL_STATIC_LIBRARIES := libreboot

ifeq ($(BOARD_HAVE_BLUETOOTH),true)
LOCAL_C_INCLUDES += \
	external/dbus \
@@ -242,10 +244,6 @@ ifeq ($(WITH_MALLOC_LEAK_CHECK),true)
	LOCAL_CFLAGS += -DMALLOC_LEAK_CHECK
endif

ifneq ($(TARGET_RECOVERY_PRE_COMMAND),)
	LOCAL_CFLAGS += -DRECOVERY_PRE_COMMAND='$(TARGET_RECOVERY_PRE_COMMAND)'
endif

LOCAL_MODULE:= libandroid_runtime

ifneq ($(BOARD_MOBILEDATA_INTERFACE_NAME),)
+3 −7
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@
#include <utils/misc.h>
#include <hardware_legacy/power.h>
#include <sys/reboot.h>
#include <reboot/reboot.h>

namespace android
{
@@ -88,15 +89,10 @@ static void android_os_Power_reboot(JNIEnv *env, jobject clazz, jstring reason)
    sync();
#ifdef HAVE_ANDROID_OS
    if (reason == NULL) {
        reboot(RB_AUTOBOOT);
        reboot_wrapper(NULL);
    } else {
        const char *chars = env->GetStringUTFChars(reason, NULL);
#ifdef RECOVERY_PRE_COMMAND
	if (!strncmp(chars,"recovery",8))
		system( RECOVERY_PRE_COMMAND );
#endif
        __reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2,
                 LINUX_REBOOT_CMD_RESTART2, (char*) chars);
        reboot_wrapper(chars);
        env->ReleaseStringUTFChars(reason, chars);  // In case it fails.
    }
    jniThrowIOException(env, errno);