Create file in native level instead of Java

Previously, MediaProvider was in charge of enforcing file creation
restrictions and creating the file. This approach had 2 issues: overhead
of opening a ParcelFileDescriptor and not passing user flags to the
lower FS exactly like FudeDaemon receive them.

Now, MediaProvider is responsible only for enforcing the restrictions
and creating a database entry for the file, while FuseDaemon actually
creates the file if MediaProvider approves.

Also, add tests for low level operations using android.system.Os APIs.

Test: atest FuseDaemonTest
Fixes: 142863102
Fixes: 144272113
Bug: 142926859
Change-Id: I59b8dfb9dab75007fb297df56dc29216e7e211d2
6 files changed