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

Commit 2e804444 authored by Amith Yamasani's avatar Amith Yamasani
Browse files

Handle the case where the restore environment doesn't have the ringtone

Bug: 10130785

uncanonicalize() can return a null now, so abort restoring the ringtone
in that case.

Change-Id: I28765818c8d3e1fb3f271afdfe66ebc955cfcefe
parent ecf612a1
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -104,6 +104,10 @@ public class SettingsHelper {
        } else {
            Uri canonicalUri = Uri.parse(value);
            ringtoneUri = mContext.getContentResolver().uncanonicalize(canonicalUri);
            if (ringtoneUri == null) {
                // Unrecognized or invalid Uri, don't restore
                return;
            }
        }
        final int ringtoneType = Settings.System.RINGTONE.equals(name)
                ? RingtoneManager.TYPE_RINGTONE : RingtoneManager.TYPE_NOTIFICATION;