Update quota type on FUSE create.

Now that we've removed scan on create, the quota type of files may no
longer be updated when a file is created through FUSE, and subsequently
not scanned by the caller.

To avoid this, make sure we tell MP whenever we create a new file, and
assign it a quota media type based on its extension.

Additionally, fix an issue where we didn't set the correct quota type
for hidden files; they have MEDIA_TYPE_NONE in the database, but we do
want to count them as their underlying type for quota usage; so in those
cases, try to use the media-type derived from the mime-type instead.

Bug: 159422093
Test: atest StorageHostTest
Change-Id: I41c7cc0cb46f42763602a25b8bbc5fdcc6a6ad85
4 files changed