Implementing System Service LifeCycle methods

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Implementing System Service LifeCycle methods

శంకర్ కుమార్ యల్లపు
Hi All,

I have a system service which is currently built as static_java_library and built into frameworks.jar.

Recently, I came across a use case where I want to implement lifecycle methods of System Service from But, I am compile time error saying symbol not found import

Following is my Android.bp file:
java_library_static {
    name: "my-services",
    srcs: [
    libs: ["services"],
    platform_apis: true,
    required: ["services"],


This is how I included in frameworks/base/Android.bp:
filegroup {
    srcs: [
    path: "my_services/src",

filegroup {
    name: "framework-non-updatable-sources",
    srcs: [
        // Java/AIDL sources under frameworks/base
        ":framework-jobscheduler-sources", // jobscheduler is not a module for R

I want to implement something like this:
public static class Lifecycle extends SystemService {
        private StorageManagerService mStorageManagerService;

        public Lifecycle(Context context) {

        public void onStart() {
            mStorageManagerService = new StorageManagerService(getContext());
            publishBinderService("mount", mStorageManagerService);

        public void onBootPhase(int phase) {
            if (phase == SystemService.PHASE_SYSTEM_SERVICES_READY) {
            } else if (phase == SystemService.PHASE_ACTIVITY_MANAGER_READY) {
            } else if (phase == SystemService.PHASE_BOOT_COMPLETED) {

Please help me how can I achieve this.


You received this message because you are subscribed to the Google Groups "android-platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit