From 45c6451216ea62837006977ca38612c84c57e839 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(-) (limited to 'ui.cpp') diff --git a/ui.cpp b/ui.cpp index 1a0b079..d88cbfe 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.1