How to register a system service in the ContextImpl class?

104 views
Skip to first unread message

Karan Kishore

unread,
Aug 21, 2014, 2:39:53 AM8/21/14
to android...@googlegroups.com
I have created a package in frameworks/base which is having my service class and registered it in the Context/ContextImpl classes but while building the image I am getting an error which says

frameworks/base/core/java/android/app/ContextImpl.java:453: cannot find symbol
symbol: class MyServiceManager
                    return new MyServiceManager(service);
                               ^

How can I resolve the dependency of my new class lying at 'frameworks/base' inside 'frameworks/base/core/java/android/app/ContextImpl'.

I was trying to follow the same process as how it's done for AOSP location project.

PS: I'm building up on android-4.2.2_r1.2b version.

SSI

unread,
Sep 16, 2014, 5:52:40 AM9/16/14
to android...@googlegroups.com
registerService("your-service", new ServiceFetcher(){

                   public Object createService(ContextImpl ctx) {           
               
                    return MyManager.MyServiceManager();
               }});

Try above thing in your ContextImpl.java for your manager class. I hope it will help you

Thanks
Reply all
Reply to author
Forward
0 new messages