Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7fc3eab7 authored by wan.li's avatar wan.li Committed by bing liang
Browse files

Add the return branch when ringtone position is POS_UNKNOWN

When the getCheckItem is POS_UNKNOWN, it is not the case we expected.
We return null for this case.

Test: manual start RingtonePickerActivity to use
EXTRA_RINGTONE_SHOW_DEFAULT false and EXTRA_RINGTONE_SHOW_SILENT false.
Check the returned EXTRA_RINGTONE_PICKED_URI, it should be null.

Bug: 165892509

Change-Id: Id473dad2e8672a65e5c1b0fee16a7d22e9bcb3e9
parent fc6fbde5
Loading
Loading
Loading
Loading
+13 −9
Original line number Diff line number Diff line
@@ -584,7 +584,11 @@ public final class RingtonePickerActivity extends AlertActivity implements
    }

    private Uri getCurrentlySelectedRingtoneUri() {
      if (getCheckedItem() == mDefaultRingtonePos) {
        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) {