nested Binder calls

51 views
Skip to first unread message

hakkunam...@gmail.com

unread,
Sep 23, 2015, 10:12:25 PM9/23/15
to android-platform
Just got curious

ABC process calls binder function() in XYZ process, and XYZ process from that function calls another binder function() from LMN process.
what would be the binder identity of the call in the LMN process function() ?



Chris Tate

unread,
Sep 24, 2015, 1:36:08 PM9/24/15
to android-platform
Binder.getCallingUid() always reports the proximate caller.

Suppose that A makes a remote call into B, and B immediately makes a remote call into C; and none of these ever call Binder.clearCallingIdentity().

B sees getCallingUid() == A's uid.
C sees getCallingUid() == B's uid.

Caller identity is not transitive.  For example, this means that if the system process calls into your app process, and then you turn around and call back into the system, it still properly recognizes your app as being the caller.

In your example, while running function() in the LMN process, Binder.getCallingUid() reports XYZ's uid.

--
christopher tate
android framework engineer


--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-platfo...@googlegroups.com.
To post to this group, send email to android-...@googlegroups.com.
Visit this group at http://groups.google.com/group/android-platform.
For more options, visit https://groups.google.com/d/optout.

hakkunam...@gmail.com

unread,
Oct 4, 2015, 6:27:26 PM10/4/15
to android-platform, ct...@google.com
Thanks mate, for the wonderful and detailed explanation.
thats exactly what am scratching my head for ...

-Dude.
Reply all
Reply to author
Forward
0 new messages