Skip to content

Commit

Permalink
Merge "init: Extend the check for charger mode" into ics
Browse files Browse the repository at this point in the history
  • Loading branch information
hyperb1iss authored and Gerrit Code Review committed Feb 7, 2012
2 parents cf47652 + 708b3b6 commit 1f6190f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions init/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ static int bootchart_count;
static char console[32];
static char serialno[32];
static char bootmode[32];
static char battchg_pause[32];
static char baseband[32];
static char carrier[32];
static char bootloader[32];
Expand Down Expand Up @@ -460,6 +461,8 @@ static void import_kernel_nv(char *name, int in_qemu)
strlcpy(console, value, sizeof(console));
} else if (!strcmp(name,"androidboot.mode")) {
strlcpy(bootmode, value, sizeof(bootmode));
} else if (!strcmp(name,"androidboot.battchg_pause")) {
strlcpy(battchg_pause, value, sizeof(battchg_pause));
} else if (!strcmp(name,"androidboot.serialno")) {
strlcpy(serialno, value, sizeof(serialno));
} else if (!strcmp(name,"androidboot.baseband")) {
Expand Down Expand Up @@ -550,7 +553,7 @@ static int property_init_action(int nargs, char **args)
bool load_defaults = true;

INFO("property init\n");
if (!strcmp(bootmode, "charger"))
if (!strcmp(bootmode, "charger") || !strcmp(battchg_pause, "true"))
load_defaults = false;
property_init(load_defaults);
return 0;
Expand Down Expand Up @@ -785,7 +788,7 @@ int main(int argc, char **argv)
action_for_each_trigger("init", action_add_queue_tail);

/* skip mounting filesystems in charger mode */
if (strcmp(bootmode, "charger") != 0) {
if (strcmp(bootmode, "charger") != 0 || strcmp(battchg_pause, "true") != 0) {
action_for_each_trigger("early-fs", action_add_queue_tail);
if(emmc_boot) {
action_for_each_trigger("emmc-fs", action_add_queue_tail);
Expand All @@ -800,7 +803,7 @@ int main(int argc, char **argv)
queue_builtin_action(signal_init_action, "signal_init");
queue_builtin_action(check_startup_action, "check_startup");

if (!strcmp(bootmode, "charger")) {
if (!strcmp(bootmode, "charger") || !strcmp(battchg_pause, "true")) {
action_for_each_trigger("charger", action_add_queue_tail);
} else {
action_for_each_trigger("early-boot", action_add_queue_tail);
Expand Down

0 comments on commit 1f6190f

Please sign in to comment.