Reland scanning files on close

We disabled scanning in If8e4f396f06c948267605ef83eda7dc3d331fefe,
however, issues seem fixed now so we should try to enable again.

Scan the file on close() for newly created file. ScanFile will insert
this file to MediaProvider database. File is considered new file if the
file is opened with O_CREAT flag or close() is called on file descriptor
obtained from create().

Changed FuseDaemonHostTest to verify file is inserted into database for
apps that bypass MediaProvider check.

Test: atest FuseDaemonHostTest
Bug: 145737191
Change-Id: I54f8e273751e7e0ff9c7d489e4629fd5fe273784
4 files changed