Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ceb81f60 authored by Wenyi Wang's avatar Wenyi Wang Committed by Android (Google) Code Review
Browse files

Merge "Modified doPickRingtone() and onRingtonePicked() to handle silent...

Merge "Modified doPickRingtone() and onRingtonePicked() to handle silent ringtone" into ub-contactsdialer-a-dev
parents 7d9c9ec6 5ed0e938
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -713,8 +713,10 @@ abstract public class ContactEditorBaseFragment extends Fragment implements
    }

    private void onRingtonePicked(Uri pickedUri) {
        if (pickedUri == null || RingtoneManager.isDefault(pickedUri)) {
            mCustomRingtone = null;
        if (pickedUri == null) {
            mCustomRingtone = ""; // silent ringtone
        } else if (RingtoneManager.isDefault(pickedUri)){
            mCustomRingtone = null; // default ringtone
        } else {
            mCustomRingtone = pickedUri.toString();
        }
@@ -907,7 +909,11 @@ abstract public class ContactEditorBaseFragment extends Fragment implements

        final Uri ringtoneUri;
        if (mCustomRingtone != null) {
            if ("".equals(mCustomRingtone)) { // select silent ringtone in RingtonePickerActivity
                ringtoneUri = null;
            } else {
                ringtoneUri = Uri.parse(mCustomRingtone);
            }
        } else {
            // Otherwise pick default ringtone Uri so that something is selected.
            ringtoneUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_RINGTONE);