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

Commit 79959156 authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "RingtoneManager: Don't crash if the ringtone doesn't have a numerical...

Merge "RingtoneManager: Don't crash if the ringtone doesn't have a numerical ID" am: ff78aab3 am: 0396aae6 am: ac23b229

Change-Id: Id6d7ff358769c86fab311b5b1161e8916169212e
parents 3e660664 ac23b229
Loading
Loading
Loading
Loading
+12 −8
Original line number Original line Diff line number Diff line
@@ -512,6 +512,7 @@ public class RingtoneManager {
     * @return The position of the {@link Uri}, or -1 if it cannot be found.
     * @return The position of the {@link Uri}, or -1 if it cannot be found.
     */
     */
    public int getRingtonePosition(Uri ringtoneUri) {
    public int getRingtonePosition(Uri ringtoneUri) {
        try {
            if (ringtoneUri == null) return -1;
            if (ringtoneUri == null) return -1;
            final long ringtoneId = ContentUris.parseId(ringtoneUri);
            final long ringtoneId = ContentUris.parseId(ringtoneUri);


@@ -522,6 +523,9 @@ public class RingtoneManager {
                    return cursor.getPosition();
                    return cursor.getPosition();
                }
                }
            }
            }
        } catch (NumberFormatException e) {
            Log.e(TAG, "NumberFormatException while getting ringtone position, returning -1", e);
        }
        return -1;
        return -1;
    }
    }