Merge "Add the return branch when ringtone position is POS_UNKNOWN" am: 1e97308138 am: e2cfc0393b am: 3ee2ef20c0 am: 1052692bda am: 4c75b58e01

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1426650

Change-Id: I5510d34efbd4e855a06303cf31571e704aa53d9e
This commit is contained in:
Treehugger Robot
2020-09-22 10:58:49 +00:00
committed by Automerger Merge Worker

View File

@@ -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() {