Support renaming files with no database row

Allow renaming files with no database row for apps that bypass scoped
storage restrictions.

When oldPath is renamed to newPath, if newPath exists in the database,
and caller is not the owner of the file, owner package is set to null.
This prevents previous owner of newPath from accessing renamed file.

Test: atest FuseDaemonHostTest#testCanRenameAFileWithNoDBRow_hasRW
Bug: 151076202
Change-Id: I8b9f2458a2e80cacc2b851741723ef4615fe2340
2 files changed