OSDN Git Service
(root)
/
android-x86
/
packages-apps-Settings.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4838c59
)
Handle unexpected null cursor and don't forget to close it.
author
Amith Yamasani
<yamasani@google.com>
Tue, 4 Oct 2011 22:00:21 +0000
(15:00 -0700)
committer
Amith Yamasani
<yamasani@google.com>
Tue, 4 Oct 2011 22:00:21 +0000
(15:00 -0700)
Bug:
5406071
Change-Id: Ia40cf7e5a3e32d6f364e787ee66580c685507571
src/com/android/settings/SoundSettings.java
patch
|
blob
|
history
diff --git
a/src/com/android/settings/SoundSettings.java
b/src/com/android/settings/SoundSettings.java
index
8b7cd37
..
f73460b
100644
(file)
--- a/
src/com/android/settings/SoundSettings.java
+++ b/
src/com/android/settings/SoundSettings.java
@@
-351,8
+351,11
@@
public class SoundSettings extends SettingsPreferenceFragment implements
try {
Cursor cursor = context.getContentResolver().query(ringtoneUri,
new String[] { MediaStore.Audio.Media.TITLE }, null, null, null);
- if (cursor.moveToFirst()) {
- summary = cursor.getString(0);
+ if (cursor != null) {
+ if (cursor.moveToFirst()) {
+ summary = cursor.getString(0);
+ }
+ cursor.close();
}
} catch (SQLiteException sqle) {
// Unknown title for the ringtone