From e5ce2a5a10076e6f939a3736f570b48aa9a7cd24 Mon Sep 17 00:00:00 2001 From: Gaelle Nassiet Date: Wed, 27 May 2015 10:39:29 +0200 Subject: recovery: change the way of rebooting when using power key combo The power key combo allow to reboot from recovery mode by pressing power button 7 times in a row. It calls directly the function android_reboot() and lead to permission denial errors because of SE Linux rules enforcement. The right way to reboot from recovery is to set the property "sys.powerctl" and let init handle it. Change-Id: Ic7b81e446c3ee13dfbad10cda13a6a1f93123b76 Signed-off-by: Gaelle Nassiet --- ui.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui.cpp b/ui.cpp index 1a0b079cc..d88cbfeba 100644 --- a/ui.cpp +++ b/ui.cpp @@ -28,6 +28,7 @@ #include #include +#include #include #include "common.h" @@ -174,7 +175,8 @@ void RecoveryUI::ProcessKey(int key_code, int updown) { case RecoveryUI::REBOOT: if (reboot_enabled) { - android_reboot(ANDROID_RB_RESTART, 0, 0); + property_set(ANDROID_RB_PROPERTY, "reboot,"); + while(1) { pause(); } } break; -- cgit v1.2.3