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

Commit 157b8743 authored by Sam Blitzstein's avatar Sam Blitzstein Committed by Android (Google) Code Review
Browse files

Merge "Prevent silent ringtone to be the default one." into jb-mr2-dev

parents f6017873 b2d117c9
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -371,7 +371,9 @@ public class AlarmClock extends Activity implements LoaderManager.LoaderCallback
        final Uri uri = intent.getParcelableExtra(RingtoneManager.EXTRA_RINGTONE_PICKED_URI);
        mSelectedAlarm.alert = uri;
        // Save the last selected ringtone as the default for new alarms
        if (uri != null) {
            RingtoneManager.setActualDefaultRingtoneUri(this, RingtoneManager.TYPE_ALARM, uri);
        }
        asyncUpdateAlarm(mSelectedAlarm, false);
    }

@@ -1129,6 +1131,9 @@ public class AlarmClock extends Activity implements LoaderManager.LoaderCallback
    private void asyncAddAlarm() {
        Alarm a = new Alarm();
        a.alert = RingtoneManager.getActualDefaultRingtoneUri(this, RingtoneManager.TYPE_ALARM);
        if (a.alert == null) {
            a.alert = Uri.parse("content://settings/system/alarm_alert");
        }
        asyncAddAlarm(a, true);
    }