Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 212c2fc2 authored by Lingxue Luo's avatar Lingxue Luo Committed by Automerger Merge Worker
Browse files

Merge "Add ability to automatically bootup" am: 1295d2e8 am: 77c8fc54 am:...

Merge "Add ability to automatically bootup" am: 1295d2e8 am: 77c8fc54 am: 701aaeb5 am: dad5bc30

Original change: https://android-review.googlesource.com/c/platform/system/core/+/2506598



Change-Id: I272e95ed01739b60b2f87c60e396de25916ad943
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 302ed748 dad5bc30
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -620,6 +620,18 @@ void Charger::OnHealthInfoChanged(const ChargerHealthInfo& health_info) {
        kick_animation(&batt_anim_);
    }
    health_info_ = health_info;

    if (property_get_bool("ro.charger_mode_autoboot", false)) {
        if (health_info_.battery_level >= boot_min_cap_) {
            if (property_get_bool("ro.enable_boot_charger_mode", false)) {
                LOGW("booting from charger mode\n");
                property_set("sys.boot_from_charger_mode", "1");
            } else {
                LOGW("Battery SOC = %d%%, Automatically rebooting\n", health_info_.battery_level);
                reboot(RB_AUTOBOOT);
            }
        }
    }
}

int Charger::OnPrepareToWait(void) {