Remove scanFile after create
Previously, we initiated a media scan after create to update MEDIA_TYPE
of the hidden file to MEDIA_TYPE_NONE. Initiating a media scan as part
of FUSE operation might lead to long wait for locks. Scan holds a
directory lock before scanning, if there was already a scan running in
parallel to this scan, scan after create will wait until the other scan
is complete, which will be a long time if scan and create is on a
directory with lot of subdirectories & files.
The original intention of updating MEDIA_TYPE can be achieved without
having to scan the file. So, removed scan after create and changed
insertFile to identify the right MEDIA_TYPE for hidden files.
Replaced scanFile after delete for shell uid with deleteFile.
Bug: 158052428
Test: atest CtsScopedStorageHostTest#testCanCreateHiddenFile
Test: atest CtsScopedStorageHostTest#testListHidden
Test: atest CtsScopedStorageHostTest#testCanRenameHidden
Test: atest CtsScopedStorageHostTest#testListHidden
Test: atest CtsScopedStorageHostTest#testHiddenDirectory
Test: atest CtsScopedStorageHostTest#testHiddenDirectory_nomedia
Change-Id: I7f2f84dfbe8df164c4a11796fd31014b3eeb5b0f
3 files changed