Factor out and speed up permission-checking code

Use the caching permission check for dump to save IPC.

Cache getpid() to save kernel call for other permission checks.

The C runtime library getpid() can't cache due to a fork
race condition, but we know that mediaserver doesn't fork.

Don't construct String16 on the stack.

Change-Id: I6be6161dae5155d39ba6ed6228e7683e67be34ed
5 files changed
tree: 57fac6fb14c9f7897409b54b360afebef59c2e70
  1. camera/
  2. cmds/
  3. drm/
  4. include/
  5. media/
  6. services/