@arasbm Sorry for the late reply, I had national holidays last week so was not online.

If I understood correctly, checkFilename() should be a function that checks the filename has an extension, the extension is a supported extension and the guessed type matches to the original blob.type, just like gallery and video do? if so, I think we can just have the same logic with those two apps, and handle the .ogg separately.

Since we already assuming the types in music open activity should be ["audio/mpeg", "audio/ogg", "audio/mp4", "audio/amr"] like you said, when the guessed type(video/ogg) is not equal to the original blob.type(audio/ogg), we still accept it because .ogg files(not .ogg files from deviceStorage) should be and can be saved, so that we don't have to write a new mapping function for the only exception .ogg files.

Does this make sense to you?