简体   繁体   中英

Move system service from AOSP build tree to installable APK?

I am extremely new to Android development. My company supports our own Android build for our devices using the AOSP build tree with some of our needed system services and APK's being build within the AOSP tree.

However, we are planning on moving to a vendor supplied Android build and we want to remove a system service from the AOSP tree and move it into a separately build and installed APK, but still be accessible as a system service to other installed applications.

Being so new to Android development I don't really even know where to begin. As a first step I find where the APK for the system service is generated/output in the AOSP tree. I installed this APK onto our device. The installation appears to have worked. However, when an application runs that needs to use that system service, Android displays a message about how the system service has stopped.

1. What steps do I need to take to make this work?
2. What other information is needed to diagnose the problem? I'm so new to this I don't know what information I should be providing.

However, we are planning on moving to a vendor supplied Android build and we want to remove a system service from the AOSP tree and move it into a separately build and installed APK, but still be accessible as a system service to other installed applications.

Assuming you have made changes in ServiceManager to add your own system service in AOSP. Yes, it is possible to move your system service to a separate apk. This will reduce your platform dependencies. However, sepolicy changes will be still required(in order to add your service dynamically in ServiceManager). Here is the complete reference to add system service from apk: https://devarea.com/aosp-creating-a-system-service/#.XOOD9KRS9EY

The installation appears to have worked. However, when an application runs that needs to use that system service, Android displays a message about how the system service has stopped

Please elaborate, what changes you have made, and root cause behind system service crash.

  1. What steps do I need to take to make this work?

Suggest to move you system service to a separate apk. Please refer above link which explains creating system service (from apk).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM