Add ContentProvider.clearCallingIdentity().

ContentProvider has a getCallingPackage() method, which verifies
the remote package name against the current Binder identity.  When a
provider wants to clear that IPC identity, they need to clear both
the Binder state and the ContentProvider.getCallingPackage() state
together, so add methods to facilitate that.

Also fix subtle bug so we don't try translating relative paths.

Bug: 117627072
Test: atest cts/tests/tests/provider/src/android/provider/cts/MediaStore*
Change-Id: Ifa3e1f745334abf625fdcc314b308a047c49ce73
3 files changed