am 35a82b6b: am 1b7ad876: Merge change I6b51a98a into eclair-mr2

Merge commit '35a82b6b5be55287589028e1f8874b65f50245f4'

* commit '35a82b6b5be55287589028e1f8874b65f50245f4':
  Fixed issue #4098: Ringtone#getTitle does not close its cursor.
This commit is contained in:
Josh Guilfoyle
2009-10-12 11:48:50 -07:00
committed by Android Git Automerger

View File

@@ -137,11 +137,17 @@ public class Ringtone {
cursor = res.query(uri, MEDIA_COLUMNS, null, null, null);
}
if (cursor != null && cursor.getCount() == 1) {
cursor.moveToFirst();
return cursor.getString(2);
} else {
title = uri.getLastPathSegment();
try {
if (cursor != null && cursor.getCount() == 1) {
cursor.moveToFirst();
return cursor.getString(2);
} else {
title = uri.getLastPathSegment();
}
} finally {
if (cursor != null) {
cursor.close();
}
}
}
}