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

Commit 1bb01516 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Fix inconsistency in ringtone list" am: cfdbf4ef

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

Change-Id: I337f1db67e29e1067fc8af7bc36101279893af8c
parents 109327fe cfdbf4ef
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -521,12 +521,12 @@ public class RingtoneManager {
    public int getRingtonePosition(Uri ringtoneUri) {
        try {
            if (ringtoneUri == null) return -1;
            final long ringtoneId = ContentUris.parseId(ringtoneUri);

            final Cursor cursor = getCursor();
            cursor.moveToPosition(-1);
            while (cursor.moveToNext()) {
                if (ringtoneId == cursor.getLong(ID_COLUMN_INDEX)) {
                Uri uriFromCursor = getUriFromCursor(mContext, cursor);
                if (ringtoneUri.equals(uriFromCursor)) {
                    return cursor.getPosition();
                }
            }