Adjust DISALLOW_USB_FILE_TRANSFER checks.

If we enforce this restriction while creating LocalCallingIdentity,
we can end up in an infinite loop when our ProxyTransactListener is
also trying to figure out what UID to blame Binder traffic on.

To work around this, shift the enforcement to hasPermissionInternal()
so we can successfully create a LocalCallingIdentity for outgoing
anonymous calls like handleApplicationCrash().

Bug: 147060924
Test: atest --test-mapping packages/providers/MediaProvider
Change-Id: Iceecac9566f92b6bb017b2db7f513d6cd5640270
1 file changed