Fix renaming file and moving file issue in MTP
After the user renames/moves a file/directory, the database of MediaProvider is not updated. It causes that the file can't be opened via MediaProvider. Use scanFile to instead of MP.update for the file/directory. Handle the .nomedia case for create/copy/move/delete/rename. Scan the parent directory to update the database. Test: atest MtpTests Test: atest --test-mapping packages/providers/MediaProvider Test: manual. 1. Move/rename the file/directory. 2. Open the file in DocumentsUI 3. create/copy/move/delete/rename for .nomedia case Bug: 169300366 Bug: 171538933 Bug: 172029805 Bug: 170798581 Change-Id: Ia37be7a027bfe502e3f7c96babe5a5bbed5f942c Merged-In: Ia37be7a027bfe502e3f7c96babe5a5bbed5f942c (cherry picked from commit 20079f10)
Loading
Please register or sign in to comment