当前位置: 首页 > news >正文

都匀市网站建设合肥网站到首页排名

都匀市网站建设,合肥网站到首页排名,网站标题改动,游戏开发课程文章目录 Android 开机动画的启动过程BootAnimation(基于Android10.0.0-r41)1.开机动画的启动过程概述2.为什么设置了属性之后就会播放? Android 开机动画的启动过程BootAnimation(基于Android10.0.0-r41) 1.开机动画的启动过程概述 下面就是BootAnimation的重要部…

文章目录

  • Android 开机动画的启动过程BootAnimation(基于Android10.0.0-r41)
    • 1.开机动画的启动过程概述
    • 2.为什么设置了属性之后就会播放?

Android 开机动画的启动过程BootAnimation(基于Android10.0.0-r41)

1.开机动画的启动过程概述

下面就是BootAnimation的重要部分。

开机动画主要跟三个东西有关系

bootanimation surfaceflinger init

在这里插入图片描述

查看下Android.bp编译文件,cc_binary就是我们编译出来的可执行文件

在这里插入图片描述

最终的输出路径是在

在这里插入图片描述

系统启动的第一个进程是init,init进程会根据init.rc配置启动surfaceflinger进程。就是下面这个.rc进程

在这里插入图片描述

但是此时的Bootanim.rc不会启动。是disabled。

在这里插入图片描述

一般一个进程启动了,都会有一个对应的main方法。

路径frameworks/native/services/surfaceflinger

在这里插入图片描述

int main(int, char**) {signal(SIGPIPE, SIG_IGN);hardware::configureRpcThreadpool(1 /* maxThreads */,false /* callerWillJoin */);startGraphicsAllocatorService();// When SF is launched in its own process, limit the number of// binder threads to 4.ProcessState::self()->setThreadPoolMaxThreadCount(4);// start the thread poolsp<ProcessState> ps(ProcessState::self());ps->startThreadPool();// instantiate surfaceflinger//创建对象sp<SurfaceFlinger> flinger = surfaceflinger::createSurfaceFlinger();setpriority(PRIO_PROCESS, 0, PRIORITY_URGENT_DISPLAY);set_sched_policy(0, SP_FOREGROUND);// Put most SurfaceFlinger threads in the system-background cpuset// Keeps us from unnecessarily using big cores// Do this after the binder thread pool initif (cpusets_enabled()) set_cpuset_policy(0, SP_SYSTEM);// initialize before clients can connect//执行init方法flinger->init();// publish surface flingersp<IServiceManager> sm(defaultServiceManager());sm->addService(String16(SurfaceFlinger::getServiceName()), flinger, false,IServiceManager::DUMP_FLAG_PRIORITY_CRITICAL | IServiceManager::DUMP_FLAG_PROTO);startDisplayService(); // dependency on SF getting registered abovestruct sched_param param = {0};param.sched_priority = 2;if (sched_setscheduler(0, SCHED_FIFO, &param) != 0) {ALOGE("Couldn't set SCHED_FIFO");}// run surface flinger in this thread//执行run方法flinger->run();return 0;
}

首先进入init方法
在这里插入图片描述

开启一个线程,Start()之后这个线程就运行起来了。

在这里插入图片描述

线程run起来

在这里插入图片描述

bootanim设置属性,控制bootanim的一个服务要启动起来,就是这里设置属性之后就会起来了,就开始播放开机动画。

property_set("service.bootanim.exit", "0");// Start BootAnimation if not startedproperty_set("ctl.start", "bootanim");

2.为什么设置了属性之后就会播放?

/system/core/init.cpp

启动属性服务

在这里插入图片描述

在这里插入图片描述

跨进程通信CreateSocket

void StartPropertyService(Epoll* epoll) {selinux_callback cb;cb.func_audit = SelinuxAuditCallback;selinux_set_callback(SELINUX_CB_AUDIT, cb);property_set("ro.property_service.version", "2");//获取fdproperty_set_fd = CreateSocket(PROP_SERVICE_NAME, SOCK_STREAM | SOCK_CLOEXEC | SOCK_NONBLOCK,false, 0666, 0, 0, nullptr);if (property_set_fd == -1) {PLOG(FATAL) << "start_property_service socket creation failed";}//监听fd句柄listen(property_set_fd, 8);if (auto result = epoll->RegisterHandler(property_set_fd, handle_property_set_fd); !result) {PLOG(FATAL) << result.error();}
}

回调方法handle_property_set_fd,然后调用下面这个方法

在这里插入图片描述

然后进到HandleControlMessage,此时我们发现这个方法不知道是哪个头文件引入进来的,所以得搜索一下。

递归搜索当前目录以及子目录。

grep "HandleControlMessage"  ./ -rn

在这里插入图片描述

通过名字查找服务,也就是前面设置的属性值bootanim

找到对应的map,根据msg获取服务的状态是什么样子的,然后根据name名字去找到对应设置的服务。

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

绘制图像需要依赖surfaceflinger来绘制,所以开机动画是在surfaceflinger之后启动的。

init启动。surfaceflinger进程的init执行,然后StartPropetySetThread线程的启动,然后再通知init进程启动开机动画进程,然后是bootanimation的main方法执行,

http://www.yayakq.cn/news/233743/

相关文章:

  • 免费网站技术重庆公共信息交易资源网
  • 做热点图现在用什么网站整合营销传播的概念
  • 网站+建设+拖拉+源码+系统低调与华丽wordpress下载
  • 易销云建站公司代替 wordpress
  • 凯里市建设局网站河南seo推广公司
  • 做网站群建一个简单的网站多少钱
  • 博客网站建设方案书矿大师德建设网站
  • 网站开发 天津韩国网站模板下载地址
  • 杭州市住房与城乡建设部网站渭南中学校园网站建设工作汇报
  • 网站建设都有什么类型上海猎头公司名录
  • 平面设计教程网站有哪些唐山公司建设网站
  • 电子商务平台(网站)建设方式wordpress添加端口访问
  • 企业网站怎么收录站长平台工具
  • 电影网站建设哪家便宜广东手机版建站系统开发
  • 建设人行官方网站下载做设计的需要网站下载素材吗
  • 长春做网站外包余姚网
  • WordPress评论ajax提交网站怎样做优化网页
  • 嘉兴网站seo服务南京比较大的外贸公司有哪些
  • 狗狗和人做网站网站层次
  • 东莞市外贸网站建设多少钱宜兴建设局网站
  • 德州网站建设wordpress 博客群
  • 公司网站开发费用放在什么科目wordpress购物车会员
  • 先备案 做网站wordpress安装方式
  • 网站手机优化网址短链接在线生成免费
  • 手机网站会员中心模板下载搭建农村电商平台
  • 领动做的网站怎么样公关公司的优势
  • 公司网站一般多少钱企业为什么选择上市
  • 上海网站建设内容更新logo免费下载网站
  • 管理登陆网站开发软件网站设计制作软件
  • wordpress统一网站图片大小单位网站建设意见建议