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

Commit ca47cef7 authored by Dima Zavin's avatar Dima Zavin
Browse files

init: add charge mode handling



Introduces a 'charger' section that is processed when androidboot.mode
supplied on the kernel commandline is "charger".

In this mode, sections such as fs, post-fs, etc are skipped. Only the
'early-init' and 'init' sections of the init rc files are processed before
processing the 'charger' section.

Change-Id: If9eb6334de18f04cbcf2aab784578e2993615242
Signed-off-by: default avatarDima Zavin <dima@android.com>
parent da04c52a
Loading
Loading
Loading
Loading
+15 −8
Original line number Diff line number Diff line
@@ -746,18 +746,25 @@ int main(int argc, char **argv)

    /* execute all the boot actions to get us started */
    action_for_each_trigger("init", action_add_queue_tail);

    /* skip mounting filesystems in charger mode */
    if (strcmp(bootmode, "charger") != 0) {
        action_for_each_trigger("early-fs", action_add_queue_tail);
        action_for_each_trigger("fs", action_add_queue_tail);
        action_for_each_trigger("post-fs", action_add_queue_tail);
        action_for_each_trigger("post-fs-data", action_add_queue_tail);
    }

    queue_builtin_action(property_service_init_action, "property_service_init");
    queue_builtin_action(signal_init_action, "signal_init");
    queue_builtin_action(check_startup_action, "check_startup");

    /* execute all the boot actions to get us started */
    if (!strcmp(bootmode, "charger")) {
        action_for_each_trigger("charger", action_add_queue_tail);
    } else {
        action_for_each_trigger("early-boot", action_add_queue_tail);
        action_for_each_trigger("boot", action_add_queue_tail);
    }

        /* run all property triggers based on current state of the properties */
    queue_builtin_action(queue_property_triggers_action, "queue_propety_triggers");
+3 −0
Original line number Diff line number Diff line
@@ -263,6 +263,9 @@ on boot
on nonencrypted
    class_start late_start

on charger
    class_start charger

on property:vold.decrypt=trigger_reset_main
    class_reset main