diff options
author | Ricardo Cerqueira <cyanogenmod@cerqueira.org> | 2012-12-01 18:38:53 +0000 |
---|---|---|
committer | Steve Kondik <shade@chemlab.org> | 2015-11-07 13:36:27 -0800 |
commit | bba1e3d2ea6a397dd4960ea314c172c1c5b30c37 (patch) | |
tree | 60b0babce33d9e4f7ea2c1d094f0b14db395381e /init | |
parent | a6cff51b6d9c58888c67adc1fb541cc8a4724bf3 (diff) | |
download | system_core-bba1e3d2ea6a397dd4960ea314c172c1c5b30c37.zip system_core-bba1e3d2ea6a397dd4960ea314c172c1c5b30c37.tar.gz system_core-bba1e3d2ea6a397dd4960ea314c172c1c5b30c37.tar.bz2 |
init: Bring back support for arbitrary chargermode cmdlines
This was accidentally removed while debugging the init breakage
fixed in change I8ef5c932efcd5e7f8d6f6fce0915683d84c3ee11. Put
it back
Change-Id: Iaacc30abff0bcd9fa49f98b158b293fa363d9ea3
Diffstat (limited to 'init')
-rw-r--r-- | init/init.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/init/init.cpp b/init/init.cpp index e1941b3..80d9b65 100644 --- a/init/init.cpp +++ b/init/init.cpp @@ -69,7 +69,13 @@ struct selabel_handle *sehandle_prop; static int property_triggers_enabled = 0; +#ifndef BOARD_CHARGING_CMDLINE_NAME +#define BOARD_CHARGING_CMDLINE_NAME "androidboot.battchg_pause" +#define BOARD_CHARGING_CMDLINE_VALUE "true" +#endif + static char qemu[32]; +static char battchg_pause[32]; static struct action *cur_action = NULL; static struct command *cur_command = NULL; @@ -782,6 +788,8 @@ static void import_kernel_nv(char *name, bool for_emulator) if (!strcmp(name,"qemu")) { strlcpy(qemu, value, sizeof(qemu)); + } else if (!strcmp(name,BOARD_CHARGING_CMDLINE_NAME)) { + strlcpy(battchg_pause, value, sizeof(battchg_pause)); } else if (!strncmp(name, "androidboot.", 12) && name_len > 12) { const char *boot_prop_name = name + 12; char prop[PROP_NAME_MAX]; @@ -1117,7 +1125,8 @@ int main(int argc, char** argv) { // Don't mount filesystems or start core system services in charger mode. char bootmode[PROP_VALUE_MAX]; - if ((property_get("ro.bootmode", bootmode) > 0 && strcmp(bootmode, "charger") == 0) + if ((property_get("ro.bootmode", bootmode) > 0 && strcmp(bootmode, "charger") == 0 && + strcmp(battchg_pause, BOARD_CHARGING_CMDLINE_VALUE) == 0) || charging_mode_booting()) { action_for_each_trigger("charger", action_add_queue_tail); } else if (strncmp(bootmode, "ffbm", 4) == 0) { |