How to Add our own System Service in Android Framework?

前端 未结 4 968
抹茶落季
抹茶落季 2021-02-05 15:08

I am new to android and i have been analyzing the android source code to understand how the System services are implemented. My Question is am I able to create my own System Se

4条回答
  •  难免孤独
    2021-02-05 15:44

    For a system service, more is needed. Essentially, at least for Android 2.3, the SystemServer.java must be extended so that the new service gets instantiated when the system_server starts.

    Texas Instruments has kindly provided a nice example:

    http://processors.wiki.ti.com/index.php/Android-Adding_SystemService

    The CyanogenMod SystemServer.java has also code for dynamically loading system services as defined in the array "config_vendorServices" in config.xml (see core/res/res/values/config.xml), which I believe can be overwritten in the vendor or device directories. However, we haven't tried to use that ourselves, and I don't know if that is CyanogenMod specific or common to 2.3.[45].

提交回复
热议问题