Merge "Handle the case where the restore environment doesn't have the ringtone" into klp-dev

This commit is contained in:
Amith Yamasani
2013-09-11 18:27:53 +00:00
committed by Android (Google) Code Review

View File

@@ -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;