aboutsummaryrefslogtreecommitdiffstats
path: root/ui.cpp
diff options
context:
space:
mode:
authorGaelle Nassiet <gaellex.nassiet@intel.com>2015-05-27 10:39:29 +0200
committerSteve Kondik <steve@cyngn.com>2015-11-07 19:02:26 -0800
commit45c6451216ea62837006977ca38612c84c57e839 (patch)
tree2f64a92a1f6cf9cbf633c3c1ef324a435377d00e /ui.cpp
parent6afe02e13ace7a278d17c38187befb94ff80a07c (diff)
downloadbootable_recovery-45c6451216ea62837006977ca38612c84c57e839.zip
bootable_recovery-45c6451216ea62837006977ca38612c84c57e839.tar.gz
bootable_recovery-45c6451216ea62837006977ca38612c84c57e839.tar.bz2
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 1a0b079..d88cbfe 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;