user1465266
user1465266

Reputation: 681

UID and App IDs of apps involved in IPC

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

Answers (1)

EyalBellisha
EyalBellisha

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

Related Questions