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

Commit 02d60c22 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "Ringtone: set default ringtone for triple slots"

parents 71b855d4 14d6ede9
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -1066,10 +1066,15 @@ public class MediaScanner
                    // memorize default system ringtone persistently
                    setSettingIfNotSet(Settings.System.DEFAULT_RINGTONE, tableUri, rowId);

                    // set default ringtone uri for at least three slots
                    // irrespective of how many sim cards are actually supported
                    setSettingIfNotSet(Settings.System.RINGTONE, tableUri, rowId);
                    setSettingIfNotSet(Settings.System.RINGTONE_2, tableUri, rowId);
                    setSettingIfNotSet(Settings.System.RINGTONE_3, tableUri, rowId);

                    if (TelephonyManager.getDefault().isMultiSimEnabled()) {
                        int phoneCount = TelephonyManager.getDefault().getPhoneCount();
                        for (int i = PhoneConstants.SUB2; i < phoneCount; i++) {
                        for (int i = PhoneConstants.SUB3+1; i < phoneCount; i++) {
                            // Set the default setting to the given URI for multi SIMs
                            setSettingIfNotSet((Settings.System.RINGTONE + "_" + (i+1)), tableUri, rowId);
                        }