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

Commit ac23b229 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

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

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