On Wed, Sep 29, 2010 at 12:43 PM, jelford <[email protected]> wrote:

> One more thing: it looks like - in my RemoteService - the onBind()
> method is not being called by the remote process that's trying to
> connect to the interface, but by something else (presumably the
> operating system). It (the external process) then seems to be returned
> the same object as any previous calls to bind to the service (ie. a
> single Binder object is being passed out to all incoming requests). I
> just want to confirm that this is really what's going on, and I
> haven't got myself into a muddle?
>

Yeah, onBind() is called once and then distributed by the platform to each
app that wants it.  Each interface to the service is basically a singleton.

If you want to do a point-of-call permission check before granting a
specific app access to protected parts of your service, you can make the
top-level interface a factory that the app then calls to receive their own
interface for talking with you.  At the point of that call (which is direct
from the app to the service), you can use Binder.getCallingUid() to find out
who is making the call.

-- 
Dianne Hackborn
Android framework engineer
[email protected]

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

-- 
You received this message because you are subscribed to the Google Groups 
"Android Security Discussions" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/android-security-discuss?hl=en.

Reply via email to