[HTC Amaze 4G] ericdjobs:
okay!

For anyone who needs it

This ZIP will fix the problem with Ringtones/Notification/Message tones not sticking.

All it does is copies HtcSoundSetDownloadManager.apk to SDM.apk.bak, then deletes HtcSoundSetDownloadManager.apk.

Flash it in recovery, and the ringtone problem will be fixed (With ANY Rom that suffers from this issue, as long as it isn't using HTC's sound sets for ringtones.. which all of these AOSP ROMs aren't... I have NOT TESTED this with a Sense 4 ROM, guessing it wouldn't work)

I completely removed sound set manager, so I can't really test it.. but it should work.

Basically the script is as follows

show_progress(0.500000, 0);

ui_print("-Removing HTC Sound Set Manager!");
ui_print("-This will fix ringtone issues on various ROMs");
ui_print("-Will be renamed to SDM.apk.bak");
ui_print("-If you have problems, let me know!");
ui_print("Thanks! -ericdjobs");

show_progress(0.500000, 40);

ui_print("-Writing Patch");
mount("ext4", "EMMC", "/dev/block/mmcblk0p29", "/system");
run_program("/system/xbin/busybox", "cp", "/system/app/HtcSoundSetDownloadManager.apk", "/system/app/SDM.apk.bak");
delete("/system/app/HtcSoundSetDownloadManager.apk");

show_progress(0.400000, 0);

show_progress(0.100000, 0);
ui_print("-Done! Ringtones should stick now!");
unmount("/system");

Use it if you're too lazy to do it manually with root browser or adb shell :P or include it in the Rom updater-script so it does it on flash! Up to you.

I thought about including run_program("/system/bin/setprop) to modify the DEFAULT ringtone/notification values in the build.prop file, but I don't want to set people's defaults, haha. So, you'll have to modify that on your own. It's easy.. . you can either use a build.prop editor (check the market) or use adb shell or terminal (with root access)

Modify ro.config.ringtone, ro.config.cal_notification, ro.config.msg_notification, ro.config.notification_sound

Values should be any FILE inside /system/media/ringtones (for the ringtone config) and any FILE inside /system/media/notifications (for all the other notifications).. This is NOT REQUIRED to fix ringtones, this only sets the value for the "Default" setting on the ringtone picker.. You can just pick them manually after the patch and they will stick, so this is only if you want the default to be something else. Honestly this step is kind of pointless because I'm sure we all customize our settings anyways, but just putting it out there.

BTW this is the first Edify script I've ever written (I have done light programming in many other languages, and scripting in many other languages, so I'm pretty sure it's solid :P) but if you notice any errors, let me know.

If this causes any issues for you (which it shouldn't if you use it on a ROM that doesn't use the Sense Sound Set manager), you can always restore the Sound Set Download Manager (which will cause it to reset your ringtones all the time again, as well!) by simply copying SDM.apk.bak to HtcSoundSetDownloadManager.apk in /system/app (cp /system/app/SDM.apk.bak /system/app/HtcSoundSetDownloadManager.apk)... but like I've said before the apk is deprecated and I don't see any need for it whatsoever, it only causes problems at this point of sense removal.