tags:

views:

18

answers:

0

I am just getting started with Android programming, and I have implemented a very simple remote service. I am able to bind to my service from other processes and send simple "ping" and "pong" messages back and forth. (I am not using AIDL, stubs, etc. I am just passing Messages and using the what field.)

I am now investigating permissions, and I've run into a problem. In my onBind() method, checkCallingPermission() is always returning PERMISSION_DENIED, even though the calling process does have the permission in question (verified by calling checkCallingOrSelfPermission() in that process). I suspect that this is happening because Binder.getCallingUid() is returning the PID of the server process, rather than the caller.

Any idea what I might be doing wrong? checkCallingPermission() is supposed to work this way in a service's onBind() method, right?

Thanks!