这里先初步看一下做odex优化的几个地方,以后再补充详细过程
一、installd的变化
首先回忆一下在7.0中installd是如何启动的:
在installd.rc中:
service installd /system/bin/installd
class main
socket installd stream 600 system system
这里启动installd的同时还启动了一个socket,在installd.cpp中有获取这个socket的地方android_get_control_socket
由于已经过时,其它的不再说了,下面看看8.0中是如何启动的:
在installd.rc中:
service installd /system/bin/installd
class main
只是启动installd,进入installd看一下
[installd.cpp]
int main(const int argc, char *argv[]) {
return android::installd::installd_main(argc, argv);
}
static int installd_main(const int argc ATTRIBUTE_UNUSED, char *argv[]) {
……
if ((ret = InstalldNativeService::start()) != android::OK) {
SLOGE("Unable to start InstalldNativeService: %d", ret);
exit(1);
}
IPCThreadState::

本文探讨了Android 8.0中installd启动方式的变更,以及odex优化的多个场景,包括首次开机或升级、安装应用、OTA升级后的处理、系统空闲时的优化,并介绍了相关服务和接口的使用。
最低0.47元/天 解锁文章
954

被折叠的 条评论
为什么被折叠?



