Reputation: 681
At the OS (framework) level, I want to know caller and callee apps' UID and APP ID whenever an IPC occurs. For example, if app A calls service of app B, then how can I know UIDs and APP IDs of both A and B? Which routine of the framework handles this? Please note that I dont need them at the application level. I actually want to know the OS level routine that deals with this.
Thank you...
Upvotes: 1
Views: 266
Reputation: 1914
If you need the PID use:
int pid = Binder.getCallingPid();
For UID call:
int uid = Binder.getCallingUid();
If you need to know who the calling user was then use:
int userId = UserId.getCallingUserId();
Upvotes: 2