diff options
| author | Todd Poynor <toddpoynor@google.com> | 2017-01-31 15:51:50 -0800 |
|---|---|---|
| committer | Todd Poynor <toddpoynor@google.com> | 2017-02-02 04:00:54 +0000 |
| commit | c8183bb0711d74babaf5bc3bf77e9bd220621817 (patch) | |
| tree | c47d68b69a6d5e540b3590cca8f3216d44b66f66 /healthd | |
| parent | 92c343fc4018ef94050ce7093a9e14efea97a3dc (diff) | |
| download | system_core-c8183bb0711d74babaf5bc3bf77e9bd220621817.tar.gz system_core-c8183bb0711d74babaf5bc3bf77e9bd220621817.tar.bz2 system_core-c8183bb0711d74babaf5bc3bf77e9bd220621817.zip | |
healthd: charger mode use reboot(), not android_reboot()
Preserve last Android reboot reason as recorded by android_reboot()
prior to entering charger mode. For example, a thermal shutdown that
reboots to charger mode leaves that reason in place, for user
notification purposes at next Android startup.
Bug: 30994946
Test: manual
Change-Id: I003f57bfff29a471bb647d2cf6b0986ff428985a
Diffstat (limited to 'healthd')
| -rw-r--r-- | healthd/healthd_mode_charger.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/healthd/healthd_mode_charger.cpp b/healthd/healthd_mode_charger.cpp index 91774c6bc..49a534c32 100644 --- a/healthd/healthd_mode_charger.cpp +++ b/healthd/healthd_mode_charger.cpp @@ -39,12 +39,12 @@ #include <linux/netlink.h> #include <batteryservice/BatteryService.h> -#include <cutils/android_reboot.h> #include <cutils/klog.h> #include <cutils/misc.h> #include <cutils/uevent.h> #include <cutils/properties.h> #include <minui/minui.h> +#include <sys/reboot.h> #ifdef CHARGER_ENABLE_SUSPEND #include <suspend/autosuspend.h> @@ -636,7 +636,7 @@ static void process_key(struct charger *charger, int code, int64_t now) } else { if (charger->batt_anim->cur_level >= charger->boot_min_cap) { LOGW("[%" PRId64 "] rebooting\n", now); - android_reboot(ANDROID_RB_RESTART, 0, 0); + reboot(RB_AUTOBOOT); } else { LOGV("[%" PRId64 "] ignore power-button press, battery level " "less than minimum\n", now); @@ -691,7 +691,7 @@ static void handle_power_supply_state(struct charger *charger, int64_t now) now, (int64_t)UNPLUGGED_SHUTDOWN_TIME, charger->next_pwr_check); } else if (now >= charger->next_pwr_check) { LOGW("[%" PRId64 "] shutting down\n", now); - android_reboot(ANDROID_RB_POWEROFF, 0, 0); + reboot(RB_POWER_OFF); } else { /* otherwise we already have a shutdown timer scheduled */ } |
