1

From Android API documentation: Binder.getCallingUid() returns the Linux uid assigned to the process that sent you the current transaction that is being processed. When AppX calls ServiceY and ServiceY calls getCallingUid(), it will get UID for X.

My question is: when AppX calls ServiceY, and ServiceY in turn calls ServiceZ, what's the calling UID observed by Z?

Does it make a difference if Y and Z are in the same process?

4

1 回答 1

0

如果 App X 调用 Service Y,Service Y 调用 Service Z,当 Service Z 调用 时getCallingUid(),它会取回 Service Y 的 UID。即使 Y 和 Z 在同一个进程中也是如此,因为每次调用都被认为是单独的 Binder 事务。

于 2014-08-29T19:36:12.710 回答