mirror of
https://github.com/moparisthebest/k-9
synced 2025-02-11 12:40:22 -05:00
fixed previous commit due to crashing on 2.1 devices
This commit is contained in:
parent
b64e145ac4
commit
abf2eea10e
@ -371,12 +371,12 @@ public class LockableDatabase {
|
|||||||
try {
|
try {
|
||||||
final File databaseFile = prepareStorage(mStorageProviderId);
|
final File databaseFile = prepareStorage(mStorageProviderId);
|
||||||
try {
|
try {
|
||||||
mDb = application.openOrCreateDatabase(databaseFile.getPath(), Context.MODE_PRIVATE, null);
|
mDb = application.openOrCreateDatabase(databaseFile.getName(), Context.MODE_PRIVATE, null);
|
||||||
} catch (SQLiteException e) {
|
} catch (SQLiteException e) {
|
||||||
// try to gracefully handle DB corruption - see issue 2537
|
// try to gracefully handle DB corruption - see issue 2537
|
||||||
Log.w(K9.LOG_TAG, "Unable to open DB " + databaseFile + " - removing file and retrying", e);
|
Log.w(K9.LOG_TAG, "Unable to open DB " + databaseFile + " - removing file and retrying", e);
|
||||||
databaseFile.delete();
|
databaseFile.delete();
|
||||||
mDb = application.openOrCreateDatabase(databaseFile.getPath(), Context.MODE_PRIVATE, null);
|
mDb = application.openOrCreateDatabase(databaseFile.getName(), Context.MODE_PRIVATE, null);
|
||||||
}
|
}
|
||||||
if (mDb.getVersion() != mSchemaDefinition.getVersion()) {
|
if (mDb.getVersion() != mSchemaDefinition.getVersion()) {
|
||||||
mSchemaDefinition.doDbUpgrade(mDb);
|
mSchemaDefinition.doDbUpgrade(mDb);
|
||||||
|
Loading…
Reference in New Issue
Block a user