How does Android detect custom ringtones / notifications? It doesn't seem consistent!

Search This thread

thethiny

Senior Member
Oct 3, 2011
135
67
United Arab Emirates
Hi,
I recently got a new phone (S22 Ultra) and was moving over my notifications and ringtones from my old phone (Oneplus 9). I noticed some weird behaviors in how Android detects Ringtones / Notifications so I thought I'd ask here.
First of all, when I moved everything, I moved them under one folder, /sdcard/backups/audio, and a folder for ringtones / notifications. When I opened the ringtone picker, all of my ringtones where there except the .wav and .mp3 ones, all the .ogg ringtones were present, such as Rhythm by OnePlus. So I selected it as my ringtone and it worked fine. Then I went to change the SMS sound and found that all of my notifications, even .wav and .mp3 are present, and as well as my mp3/wav ringtones, which is weird since this is a Notification area and not a ringtone area.
I then proceeded to move the audio files from /sdcard/backups to their respective folders, /sdcard/Ringtones and /sdcard/Notifications, but I wanted to separate them so I created a folder for Cyanogen, folder for Oneplus9, and a folder for my own music ringtones. Now when I go to select the ringtones, all of my ringtons from Custom and Cyanogen folders are present, even mp3/wav, but not a single OnePlus Ringtone or notification is there, which is weird. So I deleted the folder, and copied them again, but they were not there. So I converted them to wav and back to ogg, and they were there again. Then I proceeded to change the notifications, and surprisingly the OnePlus notifications where not there (Free, Meet... etc). So I again, converted them to wav and back to ogg, and they're there again. I decided to make a copy of the folders and put them under /sdcard/backups/audio again, and now the Sound Picker is detecting 2 of every .ogg file, so I have the OnePlus ringtone Rhythm twice, the notification Free twice and so on.
So I thought it was a Samsung bug, and I experimented with my OnePlus 9 and to my surprise there was a similar behavior. If I add a song, then move it to another folder, then the song is no longer detected as a ringtone no matter where I place it unless I place it back in the same folder I originally added it to.

What is exactly going on here? Is there some sort of hash that is being done to map an audio file to a specific location, so if the location is changed it just ignores it? Or what is exactly going on here?

Android 11 on OP9 and 12 on S22U.