diff options
author | Riley Andrews <riandrews@google.com> | 2014-06-23 15:20:51 -0700 |
---|---|---|
committer | Riley Andrews <riandrews@google.com> | 2014-06-23 15:20:51 -0700 |
commit | 6bd4588d65977956cadf2e5d384673c64329c8e8 (patch) | |
tree | f9f56e60e15c9b1a244e28e920acd064f70f44f2 /healthd | |
parent | 62ecd51f8a5435e925382ee1f0064655b75cc936 (diff) | |
parent | 079c637f3d269242bbc772b9207179b8cf56738a (diff) | |
download | system_core-6bd4588d65977956cadf2e5d384673c64329c8e8.zip system_core-6bd4588d65977956cadf2e5d384673c64329c8e8.tar.gz system_core-6bd4588d65977956cadf2e5d384673c64329c8e8.tar.bz2 |
resolved conflicts for merge of 079c637f to master
Change-Id: Iab9a857026de954d7497d6b0eaf3751d2d3904c7
Diffstat (limited to 'healthd')
-rw-r--r-- | healthd/healthd_mode_charger.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/healthd/healthd_mode_charger.cpp b/healthd/healthd_mode_charger.cpp index 86610b2..d11f609 100644 --- a/healthd/healthd_mode_charger.cpp +++ b/healthd/healthd_mode_charger.cpp @@ -37,6 +37,8 @@ #include <cutils/android_reboot.h> #include <cutils/klog.h> #include <cutils/misc.h> +#include <cutils/uevent.h> +#include <cutils/properties.h> #ifdef CHARGER_ENABLE_SUSPEND #include <suspend/autosuspend.h> @@ -498,8 +500,16 @@ static void process_key(struct charger *charger, int code, int64_t now) if (key->down) { int64_t reboot_timeout = key->timestamp + POWER_ON_KEY_TIME; if (now >= reboot_timeout) { - LOGI("[%" PRId64 "] rebooting\n", now); - android_reboot(ANDROID_RB_RESTART, 0, 0); + /* We do not currently support booting from charger mode on + all devices. Check the property and continue booting or reboot + accordingly. */ + if (property_get_bool("ro.enable_boot_charger_mode", false)) { + LOGI("[%" PRId64 "] booting from charger mode\n", now); + property_set("sys.boot_from_charger_mode", "1"); + } else { + LOGI("[%" PRId64 "] rebooting\n", now); + android_reboot(ANDROID_RB_RESTART, 0, 0); + } } else { /* if the key is pressed but timeout hasn't expired, * make sure we wake up at the right-ish time to check |