hasanbulat/android-autoboot

LineageOS 18 Support?

Closed this issue · 2 comments

This doesn't seem to work with LineageOS 18 (Android 11 Based).

Do you know if this method of autoboot is supposed to work with LineageOS 18, or does it only support older versions?

Thanks!

To answer my own question:

https://twitter.com/topjohnwu/status/1230672170361049088?s=20

"So on Android 11 Google moved /init.rc to /system/etc/init/hw/init.rc. Dunno why they do this though, maybe just to give me more headache I guess "

I enabled USB debugging on my phone and did a quick:

adb root
adb remount
adb pull /system/etc/init/hw/init.rc

Then I edited init.rc to include

on charger
    class_start charger
    class_stop charger
    trigger late-init

and finally

adb push .\init.rc /system/etc/init/hw/init.rc

to put the file back.

And now LineageOS 18 will auto boot when power is applied, without an extra reboot!

I tested directly triggering late-init with and without starting and starting the charger class versus the reboot method and ultimately found that it was faster to use:

on charger
    setprop sys.powerctl reboot,leaving-off-mode-charging

Directly triggering late-init causes my OnePlus 6T to take ~50 seconds to boot, while the rebooting method can fully start my phone in ~35 seconds to boot.