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

Commit 1b7ad876 authored by Android (Google) Code Review's avatar Android (Google) Code Review
Browse files

Merge change I6b51a98a into eclair-mr2

* changes:
  Fixed issue #4098: Ringtone#getTitle does not close its cursor.
parents 13ed5750 6b51a98a
Loading
Loading
Loading
Loading
+11 −5
Original line number Diff line number Diff line
@@ -137,12 +137,18 @@ public class Ringtone {
                    cursor = res.query(uri, MEDIA_COLUMNS, null, null, null);
                }
                
                try {
                    if (cursor != null && cursor.getCount() == 1) {
                        cursor.moveToFirst();
                        return cursor.getString(2);
                    } else {
                        title = uri.getLastPathSegment();
                    }
                } finally {
                    if (cursor != null) {
                        cursor.close();
                    }
                }
            }
        }