Browse Source

store & re-use token for retry of failed encrypted upload

tobiasKaminsky 7 years ago
parent
commit
4e6c886cbb

+ 5 - 0
src/main/java/com/owncloud/android/operations/UploadFileOperation.java

@@ -640,6 +640,11 @@ public class UploadFileOperation extends SyncOperation {
 //                }
 //            }
 
+//            boolean test = true;
+//            if (test) {
+//                throw new Exception("test");
+//            }
+            
             result = mUploadOperation.execute(client);
 //            if (result == null || result.isSuccess() && mUploadOperation != null) {
 //                result = mUploadOperation.execute(client);

+ 17 - 0
src/main/java/com/owncloud/android/providers/FileContentProvider.java

@@ -1577,6 +1577,23 @@ public class FileContentProvider extends ContentProvider {
             if (!upgraded) {
                 Log_OC.i(SQL, String.format(Locale.ENGLISH, UPGRADE_VERSION_MSG, oldVersion, newVersion));
             }
+
+            if (oldVersion < 26 && newVersion >= 26) {
+                Log_OC.i(SQL, "Entering in the #26 Adding token to ocUpload");
+                db.beginTransaction();
+                try {
+                    db.execSQL(ALTER_TABLE + ProviderTableMeta.UPLOADS_TABLE_NAME +
+                            ADD_COLUMN + ProviderTableMeta.UPLOADS_FOLDER_UNLOCK_TOKEN + " TEXT ");
+                    upgraded = true;
+                    db.setTransactionSuccessful();
+                } finally {
+                    db.endTransaction();
+                }
+            }
+
+            if (!upgraded) {
+                Log_OC.i(SQL, String.format(Locale.ENGLISH, UPGRADE_VERSION_MSG, oldVersion, newVersion));
+            }
         }
 
         @Override