Whenever I try to copy files onto my phone, depending on file type they almost immediately disappear. I noticed this when trying to copy music files (mp3 and flac) from my PC to the phone via the USB cable, using total commander.
What works: png, doc, pdf, xlsx
What gets deleted: mp3, flac, wav, somefile.someextension
I copy the file(s), and they disappear. Sometimes it happens immediately, sometimes it needs a few seconds, a couple of refreshes, or navigating away from the folder and back in again. Sometimes I can see the file from my PC but not on the phone screen for a while (up to a minute). But the end result is always the same, the files soon disappear.
I don't think the files are being moved anywhere on the phone, as I tried searching the entire phone for the missing files and found nothing (no mp3 files on the entire phone), while I can still find other file types just fine.
The phone only has internal storage, no SD card. I can browse its contents just fine from the PC, and like I said this only affects certain file types.
I've also tried copying from a USB stick (one that has a mini-usb on one end so it plugs into the phone), and I also tried several file managers to do the copying, the results are always the same.
I tried copying to the Music folder, and to another custom folder, no change in behavior.
I tried adding a .nomedia file to the folder I'm copying to, it didn't help.
I tried using MTP or PTP connections.
I don't know if any apps are doing this, but I tried disabling the built-in "Files by Google" app, and stopping all other apps. I really don't have a lot of apps on this phone, and I have no idea which one could be doing something like this and why.
The only somewhat relevant question I found was this one , but that's about bluetooth, and I'm using a USB connection to a PC.
Please someone let me know how to use a modern smartphone to provide the functionality of a fifteen year old mp3 player.
Edit:
I did a factory reset, then tried developer mode and adb. I tried both before and after the system has updated.
ls
doesn't show any of the files that I tried to copy.
Here is what I think is the relevant part of adb logcat
while copying a file called Gemini.mp3: https://pastebin.com/bmTaLfgk
Basically there are a couple of these:
Access denied finding property "media.stagefright.extractremote"
Access denied finding property "media.metrics.enabled"
Access denied finding property "media.metrics.enabled"
and these:
mediaserver: type=1400 audit(0.0:524): avc: denied { read } for name="u:object_r:media_prop:s0" dev="tmpfs" ino=8498 scontext=u:r:mediaserver:s0 tcontext=u:object_r:media_prop:s0 tclass=file permissive=0
Binder:1257_2: type=1400 audit(0.0:525): avc: denied { read } for name="u:object_r:media_prop:s0" dev="tmpfs" ino=8498 scontext=u:r:mediaextractor:s0 tcontext=u:object_r:media_prop:s0 tclass=file permissive=0
Binder:1257_2: type=1400 audit(0.0:526): avc: denied { read } for name="u:object_r:media_prop:s0" dev="tmpfs" ino=8498 scontext=u:r:mediaextractor:s0 tcontext=u:object_r:media_prop:s0 tclass=file permissive=0
And then something called MediaSorter decides to remove the file.
MediaSorter: Removing /storage/emulated/0/Music/Gemini.mp3
ls
via ADB is the only way to truly see the content of a directory on device. Check if the files you copy are really missing. because based on your description my guess would be that the files you upload can't be added to the media database (because of a content) and therefore are not visible to most apps and MTP/PTP.adb logcat
while copying the files onto the device via e.g. MTP. You may see a crash report (stack trace) of the media dbMediaSorter
is not known to me. Also the AOSP sources don't contain this keyword. Therefore it may be added by the manufacturer. As the process-ID seems to be the same as the MtpServer is running on this would be my guess. You never mentioned your device and manufacturer.