diff options
author | H. Lehmann <ByteHamster@users.noreply.github.com> | 2019-01-06 00:04:08 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-06 00:04:08 +0100 |
commit | b2e18b81284f1d816a5aa47a59e44a2a04bf1ec2 (patch) | |
tree | 63edc9a417971074b865ad3a003e273abe4732fb /core/src/main/java | |
parent | 8252f6a41d76e5ed9899d5a1d6ac926d77a4bc9b (diff) | |
parent | f90ce4228b12467dec6601cea25523d3de80ce48 (diff) | |
download | AntennaPod-b2e18b81284f1d816a5aa47a59e44a2a04bf1ec2.zip |
Merge pull request #2944 from abendebury/develop
Fix bug preventing database import on Android 9.
Diffstat (limited to 'core/src/main/java')
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java | 6 |
1 files changed, 6 insertions, 0 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 4566df2fc..f1410b894 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 @@ -1,5 +1,6 @@ package de.danoeh.antennapod.core.storage; +import android.annotation.SuppressLint; import android.content.ContentValues; import android.content.Context; import android.database.Cursor; @@ -12,6 +13,7 @@ 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.support.annotation.NonNull; import android.support.annotation.Nullable; import android.text.TextUtils; @@ -326,10 +328,14 @@ public class PodDBAdapter { return this; } + @SuppressLint("NewApi") private SQLiteDatabase openDb() { SQLiteDatabase newDb; try { newDb = SingletonHolder.dbHelper.getWritableDatabase(); + if (Build.VERSION.SDK_INT >= 16) { + newDb.disableWriteAheadLogging(); + } } catch (SQLException ex) { Log.e(TAG, Log.getStackTraceString(ex)); newDb = SingletonHolder.dbHelper.getReadableDatabase(); |