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

Commit ff78aab3 authored by Andy Hung's avatar Andy Hung Committed by Gerrit Code Review
Browse files

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

parents 217aadd0 fb3973a9
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;
    }