Merge "Handle the case where the restore environment doesn't have the ringtone" into klp-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
b926d484a7
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user