diff --git a/src/main/java/com/owncloud/android/providers/FileContentProvider.java b/src/main/java/com/owncloud/android/providers/FileContentProvider.java index 80dda33f7b..d6e717455b 100644 --- a/src/main/java/com/owncloud/android/providers/FileContentProvider.java +++ b/src/main/java/com/owncloud/android/providers/FileContentProvider.java @@ -675,14 +675,14 @@ public class FileContentProvider extends ContentProvider { Log_OC.i(SQL, "Entering in onUpgrade"); boolean upgraded = false; if (oldVersion == 1 && newVersion >= 2) { - Log_OC.i(SQL, "Entering in the #1 ADD in onUpgrade"); + Log_OC.i(SQL, "Entering in the #2 ADD in onUpgrade"); db.execSQL(ALTER_TABLE + ProviderTableMeta.FILE_TABLE_NAME + ADD_COLUMN + ProviderTableMeta.FILE_KEEP_IN_SYNC + " INTEGER " + " DEFAULT 0"); upgraded = true; } if (oldVersion < 3 && newVersion >= 3) { - Log_OC.i(SQL, "Entering in the #2 ADD in onUpgrade"); + Log_OC.i(SQL, "Entering in the #3 ADD in onUpgrade"); db.beginTransaction(); try { db.execSQL(ALTER_TABLE + ProviderTableMeta.FILE_TABLE_NAME + @@ -702,7 +702,7 @@ public class FileContentProvider extends ContentProvider { } } if (oldVersion < 4 && newVersion >= 4) { - Log_OC.i(SQL, "Entering in the #3 ADD in onUpgrade"); + Log_OC.i(SQL, "Entering in the #4 ADD in onUpgrade"); db.beginTransaction(); try { db.execSQL(ALTER_TABLE + ProviderTableMeta.FILE_TABLE_NAME + @@ -726,7 +726,7 @@ public class FileContentProvider extends ContentProvider { } if (oldVersion < 5 && newVersion >= 5) { - Log_OC.i(SQL, "Entering in the #4 ADD in onUpgrade"); + Log_OC.i(SQL, "Entering in the #5 ADD in onUpgrade"); db.beginTransaction(); try { db.execSQL(ALTER_TABLE + ProviderTableMeta.FILE_TABLE_NAME + @@ -744,7 +744,7 @@ public class FileContentProvider extends ContentProvider { } if (oldVersion < 6 && newVersion >= 6) { - Log_OC.i(SQL, "Entering in the #5 ADD in onUpgrade"); + Log_OC.i(SQL, "Entering in the #6 ADD in onUpgrade"); db.beginTransaction(); try { db.execSQL(ALTER_TABLE + ProviderTableMeta.FILE_TABLE_NAME + @@ -985,7 +985,7 @@ public class FileContentProvider extends ContentProvider { } if (oldVersion < 20 && newVersion >= 20) { - Log_OC.i(SQL, "Adding arbitrary data table"); + Log_OC.i(SQL, "Entering in the #20 Adding arbitrary data table"); db.beginTransaction(); try { createArbitraryData(db); @@ -1017,8 +1017,8 @@ public class FileContentProvider extends ContentProvider { SyncedFolderProvider syncedFolderProvider = new SyncedFolderProvider(contentResolver); - final List imageMediaFolders = MediaProvider.getImageFolders(contentResolver, 0); - final List videoMediaFolders = MediaProvider.getVideoFolders(contentResolver, 0); + final List imageMediaFolders = MediaProvider.getImageFolders(contentResolver, 1); + final List videoMediaFolders = MediaProvider.getVideoFolders(contentResolver, 1); ArrayList idsToDelete = new ArrayList<>(); List syncedFolders = syncedFolderProvider.getSyncedFolders(); @@ -1053,6 +1053,8 @@ public class FileContentProvider extends ContentProvider { upgraded = true; db.setTransactionSuccessful(); + } catch (Throwable t) { + Log_OC.e(TAG, "ERROR!", t); } finally { db.endTransaction(); }