Android : Select Ringtone behaves odd on Silent and Default

on Tuesday, October 14, 2014


I have the following code to select a ringtone:



private void selectTone(int requestCode) {
Uri uriDefault = RingtoneManager.getActualDefaultRingtoneUri(getApplicationContext(), RingtoneManager.TYPE_NOTIFICATION);
Intent intent = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER);
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TYPE, RingtoneManager.TYPE_NOTIFICATION);
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_SILENT, false);
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_DEFAULT, true);
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_DEFAULT_URI, uriDefault); // System.DEFAULT_NOTIFICATION_URI
// intent.putExtra(RingtoneManager.EXTRA_RINGTONE_EXISTING_URI, (Uri) null);
this.startActivityForResult(intent, requestCode);
}


Generally this seems to work.


However, on my Nexus 4 with Android 4.2.2 (Cyanogenmod 10.1.3) I have the following issue:



  1. Silent tone is shown, while it is set on FALSE.

  2. Default tone can be selected, but returns NULL as ringtone. Thus not distinguishable from Silent, which by default returns NULL.


Since this is my only real device, is this a known problem from cyanogenmod?


0 comments:

Post a Comment