Things start up from init.rc.
If you are interested in learning init language check this link
https://android.googlesource.com/platform/system/core/%2B/master/init/README.md
In stock AOSP this is present in /sytem/core/roodir/
https://android.googlesource.com/platform/system/core/%2B/master/init/README.md
In stock AOSP this is present in /sytem/core/roodir/
- This imports : import /init.${ro.zygote}.rc
- Based on you devices ro.zygote system property the init.zygote file from the same folder is imported.
service zygote /system/bin/app_process -Xzygote /system/bin --zygote --start-system-server
When asked to start; run zygote program by running "/system/bin/app_process". The remaining part is arguments to app_process
Adds this to main class; So this service would be started whenever this class is started.
Create a zygote socket
onrestart write /sys/power/state on
When this service is restarted write these values...
onrestart restart netd
Restart following services too
Write new pid to following path
on property:vold.decrypt=trigger_restart_min_framework
class_start main
on nonencrypted
class_start main
class_start main
on nonencrypted
class_start main
etc..
or reset on
on property:vold.decrypt=trigger_reset_main
class_reset main
on property:vold.decrypt=trigger_shutdown_framework
class_reset main
etc..
The zygote service can also be restarted if they are marked for restart by some other srvices like...
service servicemanager /system/bin/servicemanager
service surfaceflinger /system/bin/surfaceflinger
etc..(So if service manager or surface flinger dies and rrestars the zygote would also restart)
P.S Things might vary based on the init.rc files on different devices.
Comments
Post a Comment