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?

Onik
  • 19,396
  • 14
  • 68
  • 91
Wu Yongzheng
  • 1,707
  • 17
  • 23

1 Answers1

0

If App X calls Service Y, and Service Y calls Service Z, when Service Z calls getCallingUid(), it will get back the UID for Service Y. This will be the case even if Y and Z are in the same process as each call is considered a separate Binder transaction.

Paul Ratazzi
  • 6,289
  • 3
  • 38
  • 50
  • What I found out is, if Y and Z are in the same process, getCallingUid() returns X. The Binder calls between Y and Z becomes plain local function calls. – Wu Yongzheng Aug 30 '14 at 02:10