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

Commit 349f854d authored by Weiyin Jiang's avatar Weiyin Jiang Committed by Gerrit - the friendly Code Review server
Browse files

Ringtone: set default ringtone for triple slots

Set default ringtone for triple slots irrespective of how many sim
cards are actually activated. This awkward behavior is to avoid
ringtone missing when multi-sim settings are changed dynamically.

Change-Id: Id5178df89494fef02b13cc989813a9cacd436e9c
CRs-Fixed: 755560
parent 009ab7e4
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -1008,10 +1008,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 (MSimTelephonyManager.getDefault().isMultiSimEnabled()) {
                        int phoneCount = MSimTelephonyManager.getDefault().getPhoneCount();
                        for (int i = MSimConstants.SUB2; i < phoneCount; i++) {
                        for (int i = MSimConstants.SUB3+1; i < phoneCount; i++) {
                            // Set the default setting to the given URI for multi SIMs
                            setSettingIfNotSet((Settings.System.RINGTONE + "_" + (i+1)), tableUri, rowId);
                        }