Fix TagService access control without AIDL changes

Track dispatched caller UID on tag discovery and validate calling UID
server-side in TagService binder methods. This prevents background apps
holding android.permission.NFC from making raw INfcTag Binder calls to
hijack active NFC tag sessions, without requiring any AIDL interface
modifications. Add regression unit test verification.

Bug: 522373649
Test: atest NfcNciUnitTests:com.android.nfc.NfcServiceTest
Flag: EXEMPT BUGFIX

TAG=agy
CONV=e3ba36f0-888b-48d0-9e8a-4bb48afa6f0f

(cherry picked from commit 2a8b421b1d5c5cb82fc52438e352c0a726b7d008)
Cherrypick-From: https://googleplex-android-review.googlesource.com/q/commit:47115b034bc27aa19a12071cb54711e3a3bf78b3
Merged-In: I9c24261c2ae81f93083fa628f19462549e8abefb
Change-Id: I9c24261c2ae81f93083fa628f19462549e8abefb
2 files changed