Check the permission of the callingUid instead of the calling package

Bug: 372671447
Test: atest
Flag: EXEMPT bug fix
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:e719575e92c1e6bd0b9088663e6c909bccf2b007)
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:52dbdb35e91e2824ba37aad2516c4386cbece88c)
Merged-In: Ib36c0a3ba482bcddd53c2c09409ea818e6f43cad
Change-Id: Ib36c0a3ba482bcddd53c2c09409ea818e6f43cad
1 file changed