Include owned pending files from FUSE in MATCH_EXCLUDE

Sometimes, apps try these steps to create&insert file to db:
(1) create file & insert the row to db. At this point IS_PENDING=0.
(2) delete/rename the file via filePath. This deltes/updates the db row.
(3) create the same file again, this sets IS_PENDING=1.
After step (3), they expect the db row to exist in the database with
IS_PENDING=0 as they have already inserted it once in step (1).

IS_PENDING set by FUSE remains sticky until app explicitly
inserts/updates the db row or scans the file. Since, we set IS_PENDING
in step(3) and app doesn't insert it again, app won't be able to see
this file when queried with MATCH_EXCLUDE.

Changed MATCH_EXCLUDE to include owned pending files from FUSE. Even
though IS_PENDING remains set, app will be able to see its file.

Changed MediaProvider openFile to allow apps to open pending files from
FUSE owned by other apps. This is useful if apps share MediaProvider uri
of the pending file from FUSE when requesting other apps to write to the
file.

Bug: 158637603
Test: atest CtsScopedStorageHostTest#testPendingFromFuse
Test: atest CtsScopedStorageHostTest#testOpenPendingFilesFromFuse
Change-Id: Ic75b76248247c7696d5e1cb48ce693c900ca5e75
1 file changed