From c704e06ce596bd0a6de66b10b108aee95535468a Mon Sep 17 00:00:00 2001 From: Doug Zongker Date: Fri, 23 May 2014 08:40:35 -0700 Subject: disable async reboot during package installation The default recovery UI will reboot the device when the power key is pressed 7 times in a row, regardless of what recovery is doing. Disable this feature during package installation, to minimize the chance of corrupting the device due to a mid-install reboot. (Debug packages can explicitly request that the feature be reenabled.) Change-Id: I20f3ec240ecd344615d452005ff26d8dd7775acf --- ui.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'ui.h') diff --git a/ui.h b/ui.h index faa0acd..31a8a7f 100644 --- a/ui.h +++ b/ui.h @@ -93,6 +93,13 @@ class RecoveryUI { // be called with "true". virtual void KeyLongPress(int key); + // Normally in recovery there's a key sequence that triggers + // immediate reboot of the device, regardless of what recovery is + // doing (with the default CheckKey implementation, it's pressing + // the power button 7 times in row). Call this to enable or + // disable that feature. It is enabled by default. + virtual void SetEnableReboot(bool enabled); + // --- menu display --- // Display some header text followed by a menu of items, which appears @@ -121,6 +128,7 @@ private: int key_last_down; // under key_queue_mutex bool key_long_press; // under key_queue_mutex int key_down_count; // under key_queue_mutex + bool enable_reboot; // under key_queue_mutex int rel_sum; int consecutive_power_keys; -- cgit v1.1