fix: Use permission check for contact URI validation
Changed the validation logic in onActivityResult for contact data.
Instead of comparing user IDs, the code now verifies if the caller
has explicit read permission for the returned URI using
checkContentUriPermission.
This ensures proper access control based on granted permissions.
Throws SecurityException on denial for better error reporting.
Flag: EXEMPT security fix
Bug: 337784859
Test: manual - steps for manual test
1. sign into personal/test acct
2. create a pin for the personal acct
3. create a work profile via adb cmd
4. add pin for work profile
5. add a work profile contact
6. open PoC app
(cherry picked from commit 522822360789507788c90c9e37edb7f1095ae5ab)
Cherrypick-From: https://googleplex-android-review.googlesource.com/q/commit:a727dc2d556d7bddb66cb289b2658cc73dba789f
Merged-In: I858041662a19a179e1fd49b3747d0fc013625015
Change-Id: I858041662a19a179e1fd49b3747d0fc013625015
1 file changed