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

* commit 'b926d484a76eda4152ba46d3ef517517226ca699':
  Handle the case where the restore environment doesn't have the ringtone
This commit is contained in:
Amith Yamasani
2013-09-11 11:30:08 -07:00
committed by Android Git Automerger

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;