Stop and start logging on migration
authorBartosz Przybylski <bart.p.pl@gmail.com>
Mon, 9 Nov 2015 16:44:20 +0000 (17:44 +0100)
committerBartosz Przybylski <bart.p.pl@gmail.com>
Sun, 15 Nov 2015 19:35:13 +0000 (20:35 +0100)
src/com/owncloud/android/ui/activity/StorageMigrationActivity.java

index bc05179..243e85f 100644 (file)
@@ -125,6 +125,8 @@ public class StorageMigrationActivity extends AppCompatActivity {
                        Account[] ocAccounts = AccountManager.get(context).getAccountsByType(MainApp.getAccountType());
                        boolean[] oldAutoSync = new boolean[ocAccounts.length];
 
                        Account[] ocAccounts = AccountManager.get(context).getAccountsByType(MainApp.getAccountType());
                        boolean[] oldAutoSync = new boolean[ocAccounts.length];
 
+                       Log_OC.stopLogging();
+
                        try {
                                publishProgress(mProgress++, R.string.file_migration_checking_destination);
 
                        try {
                                publishProgress(mProgress++, R.string.file_migration_checking_destination);
 
@@ -148,15 +150,18 @@ public class StorageMigrationActivity extends AppCompatActivity {
 
                        } catch (MigrationException e) {
                                rollback();
 
                        } catch (MigrationException e) {
                                rollback();
+                               Log_OC.startLogging(mStorageSource);
                                return e.getResId();
                        } catch (MigrationCleanupException e) {
                                Log_OC.w(TAG, "Migration cleanup step failed");
                                return e.getResId();
                        } catch (MigrationCleanupException e) {
                                Log_OC.w(TAG, "Migration cleanup step failed");
+                               Log_OC.startLogging(mStorageSource);
                                return 0;
                        } finally {
                                publishProgress(mProgress++, R.string.file_migration_restoring_accounts_configuration);
                                restoreAccountsSyncStatus(ocAuthority, ocAccounts, oldAutoSync);
                        }
 
                                return 0;
                        } finally {
                                publishProgress(mProgress++, R.string.file_migration_restoring_accounts_configuration);
                                restoreAccountsSyncStatus(ocAuthority, ocAccounts, oldAutoSync);
                        }
 
+                       Log_OC.startLogging(mStorageTarget);
                        publishProgress(mProgress++, R.string.file_migration_ok_finished);
 
                        return 0;
                        publishProgress(mProgress++, R.string.file_migration_ok_finished);
 
                        return 0;