Is an AIDL remote service the only option i have?
No.
Is there any simpler solution?
Create a ContentProvider
proxy for the (undocumented and unsupported) ContentProvider
that you are trying to access.
The projects in this directory demonstrate such a proxy and a consumer of that proxy. In my case, I am proxying the CallLog
, but the same concept applies for any ContentProvider
.
The keys are:
Have the plugin hold the desired permission for the
ContentProvider
it is proxyingHave both the app and the plugin define a custom signature-level permission to be used by such plugins (
<permission>
)Have the app hold that permission (
<uses-permission>
)Have the plugin protect the
ContentProvider
proxy via that custom permission (android:permission
)
This will allow your app to access the plugin's ContentProvider
proxy, while not leaking the capability of accessing the proxied ContentProvider
to others.