Add support for sharing redacted URIs with other packages

The current code grants the permission successfully to the shared
redacted URI but while checking the permissions always uses the
original URI. This CL changes this behaviour by checking for
permissions on redacted URI when it is being used. This CL also
makes sure that we check for permissions on redacted URI while
trying to open the file using synthetic paths.

Test: atest CtsScopedStorageDeviceOnlyTest:ScopedStorageDeviceTest#testSharedRedactedUri_openFdForWrite
atest CtsScopedStorageDeviceOnlyTest:ScopedStorageDeviceTest#testSharedRedactedUri_openFdForRead
atest CtsScopedStorageDeviceOnlyTest:ScopedStorageDeviceTest#testSharedRedactedUri_openFileForRead
atest CtsScopedStorageDeviceOnlyTest:ScopedStorageDeviceTest#testSharedRedactedUri_query
atest CtsScopedStorageDeviceOnlyTest:ScopedStorageDeviceTest#testSharedRedactedUri_openFileForRead_withLocationPerm
atest CtsScopedStorageDeviceOnlyTest:ScopedStorageDeviceTest#testSharedRedactedUri_openFdForRead_withLocationPerm
atest CtsScopedStorageDeviceOnlyTest:ScopedStorageDeviceTest#testUnsharedRedactedUri_openFdForRead
atest CtsScopedStorageDeviceOnlyTest:ScopedStorageDeviceTest#testUnsharedRedactedUri_openFileForRead

Bug: 179914046
Bug: 176547697
Change-Id: Idae540ad698beefeecf7cc848b9ad8682c8dfafa
1 file changed