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

Commit ef719455 authored by Isaac Katzenelson's avatar Isaac Katzenelson Committed by The Android Automerger
Browse files

Prevent silent ringtone to be the default one.

Bug: 7588955
Change-Id: I3df59a7010f0a92d48796b770ff2e4fcbef5f811
parent 26b65f6e
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);
    }