diff options
author | Martin Fietz <Martin.Fietz@gmail.com> | 2015-12-28 23:33:14 +0100 |
---|---|---|
committer | Martin Fietz <Martin.Fietz@gmail.com> | 2015-12-28 23:33:14 +0100 |
commit | a5b0cb2ad7463bb37eac87657577920ec7b74f93 (patch) | |
tree | 201a3cd49266f45b77bbf88ea9237da5a897d580 /core | |
parent | b115d4add48fe1cf26af3456a4173125cfe56381 (diff) | |
download | AntennaPod-a5b0cb2ad7463bb37eac87657577920ec7b74f93.zip |
Don't close db
Diffstat (limited to 'core')
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java b/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java index 18457a330..87485a237 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java @@ -10,7 +10,6 @@ import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteDatabase.CursorFactory; import android.database.sqlite.SQLiteOpenHelper; import android.media.MediaMetadataRetriever; -import android.os.Build; import android.text.TextUtils; import android.util.Log; @@ -310,15 +309,11 @@ public class PodDBAdapter { private PodDBAdapter() {} - public synchronized PodDBAdapter open() { - counter++; + public PodDBAdapter open() { if (db == null || !db.isOpen() || db.isReadOnly()) { Log.v(TAG, "Opening DB"); try { db = dbHelper.getWritableDatabase(); - if(Build.VERSION.SDK_INT >= 11) { - db.enableWriteAheadLogging(); - } } catch (SQLException ex) { Log.e(TAG, Log.getStackTraceString(ex)); db = dbHelper.getReadableDatabase(); @@ -327,13 +322,8 @@ public class PodDBAdapter { return this; } - public synchronized void close() { - counter--; - if(counter == 0) { - Log.v(TAG, "Closing DB"); - db.close(); - db = null; - } + public void close() { + // do nothing } public static boolean deleteDatabase() { |