aboutsummaryrefslogtreecommitdiffstats
path: root/ui.cpp
diff options
context:
space:
mode:
authorGaelle Nassiet <gaellex.nassiet@intel.com>2015-05-27 10:39:29 +0200
committerGaelle Nassiet <gaellex.nassiet@intel.com>2015-05-27 15:47:44 +0200
commite5ce2a5a10076e6f939a3736f570b48aa9a7cd24 (patch)
tree446b87889b56486f0cf387760a10dc06750fa9dc /ui.cpp
parenta8cd96adeeb530eda74e435e626900a3a76844a7 (diff)
downloadandroid_bootable_recovery-e5ce2a5a10076e6f939a3736f570b48aa9a7cd24.tar.gz
android_bootable_recovery-e5ce2a5a10076e6f939a3736f570b48aa9a7cd24.tar.bz2
android_bootable_recovery-e5ce2a5a10076e6f939a3736f570b48aa9a7cd24.zip
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 <gaellex.nassiet@intel.com>
Diffstat (limited to 'ui.cpp')
-rw-r--r--ui.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/ui.cpp b/ui.cpp
index 1a0b079c..d88cbfeb 100644
--- a/ui.cpp
+++ b/ui.cpp
@@ -28,6 +28,7 @@
#include <time.h>
#include <unistd.h>
+#include <cutils/properties.h>
#include <cutils/android_reboot.h>
#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;