diff options
author | Amith Yamasani <yamasani@google.com> | 2013-09-11 11:11:19 -0700 |
---|---|---|
committer | Amith Yamasani <yamasani@google.com> | 2013-09-11 11:11:19 -0700 |
commit | 2e804444d64bdf2763c682109c838a8372b17934 (patch) | |
tree | 4666d069488e792ad4ad3bb20749c17c6557f574 /packages/SettingsProvider/src/com/android/providers | |
parent | ecf612a15c6201d7a4c55f0fcceb077f3e9ad84e (diff) | |
download | frameworks_base-2e804444d64bdf2763c682109c838a8372b17934.zip frameworks_base-2e804444d64bdf2763c682109c838a8372b17934.tar.gz frameworks_base-2e804444d64bdf2763c682109c838a8372b17934.tar.bz2 |
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
Diffstat (limited to 'packages/SettingsProvider/src/com/android/providers')
-rw-r--r-- | packages/SettingsProvider/src/com/android/providers/settings/SettingsHelper.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsHelper.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsHelper.java index 080290c..dd7a828 100644 --- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsHelper.java +++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsHelper.java @@ -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; |