Check the calling user instead of the current user.

In concurrent multi-user case, the calling user may be different from
the current user, thus we cannot assume that it is always the current
user to check if the calling user is an admin user. Instead, we use the
calling user id from the binder, before the caller identity is cleared.

Bug: 315382159

Test: atest android.bugreport.cts.BugreportManagerTest

Change-Id: I003037d37b72c47dc4be7c85f634116f9bc4ca63
2 files changed