When device ID access is revoked get app info as calling user

When a calling package from another user ID does not meet the new
requirements to access device identifiers its application info will
be queried to determine its target SDK. However since the permission
check for device identifiers runs as user 0 the current query would
look for the application info under user 0. This change queries for
the application info using the calling user ID to ensure the correct
info is returned and prevent any issues with an
INTERACT_ACROSS_USERS_FULL permission check.

Fixes: 128359188
Test: Manually verified app that queries Build#getSerial from work
      profile did not fail due to INTERACTS_ACROSS_USER_FULL perm.
Change-Id: Iaea4e3952bd1e329bde7de0ace004bb8478821f5
1 file changed