AOSP系统服务与服务差异 [英] AOSP System Service vs Service Differences
问题描述
我试图更好地理解这些差异,以便评估是否应该实现系统服务或服务.我从文档中发现的差异如下:
I'm trying to get a better understanding of the differences so I can evaluate if I should be implementing a System Service, or a Service. The differences that I have found from the docs are the following:
系统服务
- 从SystemServer开始
- 已添加到ServiceManager
- 认为是强制性的,并在出现故障时软重启设备
- 更多权限? (不确定服务可以做什么)
服务
- 是否已初始化并开始使用意图?
两者之间还有其他区别吗?我正在修改AOSP以包括我自己的服务,并且所提供的任何其他信息都将有助于我做出决定.
Is there anything else is different between the two? I'm modifying AOSP to include my own service, and any additional supplied information would be helpful in assisting me make a decision.
推荐答案
-
所有系统服务都在称为system_server的同一进程中运行.
All system services are run in the same process called system_server.
很多事情系统服务可以但是服务不能.系统服务通常具有更高和更指定的分隔符,例如普通的应用程序将没有(例如,更改NFC硬件参数).
There's a lot of things which system service can but service can't. system service usually has a higher and more specified sepolicy which normal apps will not have, for example(change NFC hardware parameters).
因此,如果要添加自己的系统服务,请注意上面的内容,如果代码有死锁,则将影响所有系统服务.并且没有单独的条款,您的服务可能仍然无法访问某些资源.
so if you want add you own system service, notice things above, if you code has a deadlock, you will affect all system services. and without a sepolicy, you service may still unable to access some resources.
这篇关于AOSP系统服务与服务差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!