Android开机动画流程的启动主要是在Surfaseflinger里面完成的,具体代码如下:
/frameworks/native/services/surfaceflinger/StartPropertySetThread.cpp
32 bool StartPropertySetThread::threadLoop() {
33 // Set property service.sf.present_timestamp, consumer need check its readiness
34 property_set(kTimestampProperty, mTimestampPropertyValue ? "1" : "0");
35 // Clear BootAnimation exit flag
36 property_set("service.bootanim.exit", "0");
37 // Start BootAnimation if not started
38 property_set("ctl.start", "bootanim");
通过property_set("ctl.start", "bootanim");启动bootanim服务,启动服务的过程不做详细介绍,可以参考链接:
https://blog.csdn.net/zcyxiaxi/article/details/79159094
bootanim服务会启动开机动画的二进制执行文件,代码目录位于
/frameworks/base/cmds/bootanimation/bootanim.rc
1 service bootanim /system/bin/bootanimation
2 class core animation
3 user graphics
4 group graphics audio
5 disabled
6 oneshot
7 writepid /dev/stune/top-app/tasks
主要执行代码在/frameworks/base/cmds/bootanimation/BootAnimation.cpp文件中。
bool BootAnimation::threadLoop()
358 {
359 bool r;<