Scan renamed oldPath to remove db rows of directories in oldPath
We don't update db rows corresponding to directories. By scanning the
newPath, we now add new db rows for directories in newPath. This leaves
some stale db rows corresponding to directories in oldPath. Apps trying
to update these stale rows will now have conflicts with db rows
inserted by scanning newPath.
Changed scanRenamedPathForFuse to clean-up db rows corresponding to
directories in oldPath by scanning the oldPath.
Added new test to verify that MediaProvider doesn't throw UNIQUE
constraint error while updating db rows corresponding to renamed
directory.
Test: atest FuseDaemonHostTest#testRenameyDirectoryAndUpdateDB_hasW
Bug: 156046098
Change-Id: Id7dc394daecd36aa01d143cb142a87a9e357d39c
4 files changed