0

I'm using Moto g2 with Lollipop 5.0.2. I can set custom ringtones for a contact. But Cannot see anywhere which ringtone is associated with the contact.

2 Answers2

1

For fun, I wrote a very simple script to find out which ringtone is assigned to a particular contact. Sadly, the script needs root access and Busybox and its applets installed and available under PATH variable. Once you meet the above requisites, save the following preformatted text into a file named find_tone.sh under /sdcard.

#!/system/bin/sh

list="/data/media/0/list"; mkfifo $list; content query --uri content://com.android.contacts/raw_contacts --projection display_name:custom_ringtone | sed -e /NULL/d -e 's/,\scustom/\ custom/g' -e 's/.display/Contact/g' > $list & while read line; do name=$(echo "$line" | awk -F 'custom_ringtone=' '{print$1}'); content_path=$(echo "$line" | awk -F 'custom_ringtone=' '{print$2}'); printf "$name\n"; content query --uri "$content_path" --projection title | sed 's/.title/Ringtone/g'; printf "\n"; done < $list rm $list;

All I'm doing in that script is:

  • Creating a named pipe under /data/media/0/
  • Fetching the values available under the column display_name and custom_ringtone from raw info of all the contacts using content tool, filtering out few things using sed and saving the output into the named pipe.
  • Having each line of the saved output go through a loop to separate contact's name from the line and using the rest of the line to get the label of ringtone.
  • At last, deleting the named pipe.

Run the file in a terminal emulator app:

su -c 'sh FILE'   # replace FILE with path of find_tone.sh. If it was saved into /sdcard, FILE would be /sdcard/find_tone.sh.

Here's the file in action:

(Click image to enlarge)

IMG:

Note:

  • The output would consist solely of contacts which were assigned a particular ringtone. All the contacts which uses the default ringtone won't be listed in the output.
  • The solution is tested on Cyanogen OS 12 (Android 5.0.2).
Firelord
  • 25,084
  • 20
  • 124
  • 286
  • I just realized that the solution is actually possible without root access on Android 5.1.1 and above. All you've to do is make some changes in the script and run it using [tag:adb]. – Firelord Mar 01 '16 at 13:17
0

You can see which ringtone is associated with a contact, with Hangouts. Go in the conversation of the contact you want, press the 3 dots (settings), top right corner, then select Participants and Options and you will we able to see which ringtone and SMS sound is associated with this contact.

Hope this helps.

Maxime
  • 934
  • 4
  • 17
  • 28