Default [Q] built-in Service in AOSP

I'm looking how to add a built-in Service into Android.
any link to a howto document or instructions would be great.

two options I can think of:
- there should be some folder where could put the entire service project sources and it will be built with AOSP
- there should be some folder where could put the pre-built APK and that will be included into the final image

but I guess there could be other ways. any help appreciated!

thanks!