AOSP ActivityManager not running

时光毁灭记忆、已成空白 提交于 2019-12-05 04:51:53

问题


I'm trying to port Android 7.0 into a customized HW platform and have zygote running background. But when I tried to start an app by using am start <>, it gives error "Can't connect to activity manager; is system running?". After that I did service list and found out that the activity:[android.app.IActivityManager] is not running (I don't know why). I'm actually kinda new to AOSP, but how could I start the AM service by typing a single shell command? I have attached the error message and logcat prints.

From the source code the ActivityManagerNative tries to getDefault() of ActivityManagerService, which is not available, so how to start ActivityManagerService or which process actually trigger it?


回答1:


AndroidException: Can't connect to activity manager; is the system running? means ActivityManagerService is not running as well as other core system services as reflected in the list of running services.

The cause of the problem is SystemServer. Started by zygote the system_server process acts like a host process for most of the system services to run in. It tries to start the services and dies in case of failure.

How to start ActivityManagerService or which process actually trigger it?

You can't do it manually. SystemServer is responsible for starting the service.

So maybe I need to disable both DisplayManagerS and Battery Service?

Despite the fact that you can effect the startup behavior of SystemServer by modifying the ro.factorytest and ro.headless system properties, for disabling these particular services you should edit SystemServer.java manually by commenting out the corresponding lines of code.



来源:https://stackoverflow.com/questions/40312842/aosp-activitymanager-not-running

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!