diff options
| author | Ricardo Cerqueira <cyanogenmod@cerqueira.org> | 2012-12-01 18:38:53 +0000 |
|---|---|---|
| committer | Ricardo Cerqueira <cyanogenmod@cerqueira.org> | 2012-12-01 18:40:21 +0000 |
| commit | 91137e19bf815da18f4c0250bcb1c97bb00ef7c7 (patch) | |
| tree | 5496d153d1c9fee8d8ed16cb25be726f7ebe712d /init/init.c | |
| parent | a39679fbd9fd51c033461a4ca25324dd181af7a6 (diff) | |
| download | system_core-91137e19bf815da18f4c0250bcb1c97bb00ef7c7.tar.gz system_core-91137e19bf815da18f4c0250bcb1c97bb00ef7c7.tar.bz2 system_core-91137e19bf815da18f4c0250bcb1c97bb00ef7c7.zip | |
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: If35b9d5db281f8aab6de26f2bb63717d28b2db30
Diffstat (limited to 'init/init.c')
| -rwxr-xr-x | init/init.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/init/init.c b/init/init.c index 02eb4f41..4f334cba 100755 --- a/init/init.c +++ b/init/init.c @@ -72,11 +72,17 @@ static int property_triggers_enabled = 0; static int bootchart_count; #endif +#ifndef BOARD_CHARGING_CMDLINE_NAME +#define BOARD_CHARGING_CMDLINE_NAME "androidboot.battchg_pause" +#define BOARD_CHARGING_CMDLINE_VALUE "true" +#endif + static char console[32]; static char bootmode[32]; static char hardware[32]; static unsigned revision = 0; static char qemu[32]; +static char battchg_pause[32]; #ifdef HAVE_SELINUX static int selinux_enabled = 1; @@ -104,6 +110,8 @@ static const char *ENV[32]; static unsigned emmc_boot = 0; +static unsigned charging_mode = 0; + /* add_environment - add "key=value" to the current environment */ int add_environment(const char *key, const char *val) { @@ -667,6 +675,8 @@ static void import_kernel_nv(char *name, int for_emulator) emmc_boot = 1; } #endif + } 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]; @@ -1012,6 +1022,11 @@ int main(int argc, char **argv) queue_builtin_action(signal_init_action, "signal_init"); queue_builtin_action(check_startup_action, "check_startup"); + /* Older bootloaders use non-standard charging modes. Check for + * those now, after mounting the filesystems */ + if (strcmp(battchg_pause, BOARD_CHARGING_CMDLINE_VALUE) == 0) + is_charger = 1; + if (is_charger) { action_for_each_trigger("charger", action_add_queue_tail); } else { |
