An Android O app can set a custom sound on a NotificationChannel using an app sound resource:
NotificationChannel channel = new NotificationChannel(channelId, name, importance);
Uri uri = Uri.parse("android.resource://" + context.getPackageName() + "/" + R.raw.customSound);
AudioAttributes audioAttributes = new AudioAttributes.Builder()
.setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
.setUsage(AudioAttributes.USAGE_ALARM)
.build();
channel.setSound(uri, audioAttributes);
Now in the system settings, the user can reconfigure the NotificationChannel, picking a different sound from the system's sound resources.
Problem: That list of sounds does not include the app's own sound resources, so the user can never revert to the app's custom sound resource after changing it.
Q. How can the app let the user restore the app's custom sound resource? Does the app have to copy the sound file to a shared directory (and make that work)?