diff options
| -rw-r--r-- | packages/SoundPicker/src/com/android/soundpicker/RingtonePickerActivity.java | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/packages/SoundPicker/src/com/android/soundpicker/RingtonePickerActivity.java b/packages/SoundPicker/src/com/android/soundpicker/RingtonePickerActivity.java index d69f3d620d48..504e18a1488e 100644 --- a/packages/SoundPicker/src/com/android/soundpicker/RingtonePickerActivity.java +++ b/packages/SoundPicker/src/com/android/soundpicker/RingtonePickerActivity.java @@ -587,15 +587,19 @@ public final class RingtonePickerActivity extends AlertActivity implements } private Uri getCurrentlySelectedRingtoneUri() { - if (getCheckedItem() == mDefaultRingtonePos) { - // Use the default Uri that they originally gave us. - return mUriForDefaultItem; - } else if (getCheckedItem() == mSilentPos) { - // Use a null Uri for the 'Silent' item. - return null; - } else { - return mRingtoneManager.getRingtoneUri(getRingtoneManagerPosition(getCheckedItem())); - } + if (getCheckedItem() == POS_UNKNOWN) { + // When the getCheckItem is POS_UNKNOWN, it is not the case we expected. + // We return null for this case. + return null; + } else if (getCheckedItem() == mDefaultRingtonePos) { + // Use the default Uri that they originally gave us. + return mUriForDefaultItem; + } else if (getCheckedItem() == mSilentPos) { + // Use a null Uri for the 'Silent' item. + return null; + } else { + return mRingtoneManager.getRingtoneUri(getRingtoneManagerPosition(getCheckedItem())); + } } private void saveAnyPlayingRingtone() { |