0

I have implemented an accessibility service that listens to notifications and is notified whenever a notification is triggered.
My question is: once I obtain the Notification object, can I set its sound to a custom sound?
I tried doing something like:

notification.sound = Uri.parse("<path_to_custom_sound>");

but this does not work.
Is there a way to do this?

Oren
  • 937
  • 1
  • 10
  • 34

1 Answers1

0

This might help you.

notification.sound = Uri.parse("android.resource://" + getPackageName() + "/" R.raw.notifysnd);
notification.defaults = Notification.DEFAULT_LIGHTS | Notification.DEFAULT_VIBRATE;
ravi
  • 2,722
  • 7
  • 25
  • 42
  • Hi, this is similar to what I tried, the notification isn't triggered by me, I just intercept it using AccessibilityService. what I'm trying to figure out is whether the notification instance I have is a clone of the actual one - in which case modifications will not work, or is there a way to update it in a way that will change the actual notification – Oren Dec 09 '13 at 14:21