Hi,
In my project I have created Service (Customized service)class to listen events from JNI/HAL. This service I registered in a SystemService.java file of AOSP. So my service is getting add into ServiceManager.java like below
try {
Slog.i(TAG, "MyService");
ServiceManager.addService("xxx", new MyService(context));
}catch (Throwable e){
reportWtf("starting MyService_service", e);
}
Now MyService will call up when device is power on. But I want to start a service when my app is opened from UI. I.e I want to add MyService.java into a ServiceManger by opening app from UI. How to do in AOSP.
Where I have to use the above code instead of SystemServer.java
Thanks