当前位置: 动力学知识库 > 问答 > 编程问答 >

How to Call a Method in a Android Java Layer System Service from native code

问题描述:

I have an Android System Service [SS.java] with several methods. It has been added to Service Manager. I need to call one of the methods from a native service[N.cpp] or a native shared library.

From N.cpp, I am able to use defaultservicemanager()->getService("servicename") for native services.

But, is it possible to use a similar approach to call SS.Java?

Currently SS.java does not have any native component. It only has a corresponding ss.aidl.

Is a native interface needed? It is not possible to perform the implementation for the required method in native code because of dependencies.

It would be great if someone could give a detailed explanation of how to call a Java layer system service method from native code.

分享给朋友:
您可能感兴趣的文章:
随机阅读: