Merge branch 'master' into crashDueToEmptyString

This commit is contained in:
Tobias Kaminsky 2017-05-15 12:44:22 +02:00 committed by GitHub
commit a2ff44a77e
7 changed files with 10 additions and 26 deletions

View file

@ -179,7 +179,7 @@ dependencies {
compile name: 'touch-image-view'
compile 'com.android.support:multidex:1.0.1'
compile 'com.github.nextcloud:android-library:1.0.17'
compile 'com.github.nextcloud:android-library:logFolder-SNAPSHOT'
compile "com.android.support:support-v4:${supportLibraryVersion}"
compile "com.android.support:design:${supportLibraryVersion}"
compile 'com.jakewharton:disklrucache:2.0.2'

View file

@ -112,13 +112,8 @@ public class MainApp extends MultiDexApplication {
new ThumbnailsCacheManager.InitDiskCacheTask().execute();
if (BuildConfig.DEBUG) {
String dataFolder = getDataFolder();
// Set folder for store logs
Log_OC.setLogDataFolder(dataFolder);
Log_OC.startLogging(MainApp.storagePath);
// use app writable dir, no permissions needed
Log_OC.startLogging(getAppContext());
Log_OC.d("Debug", "start logging");
}

View file

@ -40,7 +40,6 @@ import com.owncloud.android.R;
import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.ui.dialog.LoadingDialog;
import com.owncloud.android.utils.AnalyticsUtils;
import com.owncloud.android.utils.FileStorageUtils;
import java.io.BufferedReader;
import java.io.File;
@ -64,7 +63,7 @@ public class LogHistoryActivity extends ToolbarActivity {
private static final String SCREEN_NAME = "Logs";
private String mLogPath = FileStorageUtils.getLogPath();
private String mLogPath = Log_OC.getLogPath();
private File logDIR = null;
private String mLogText;
@ -166,11 +165,7 @@ public class LogHistoryActivity extends ToolbarActivity {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) {
uris.add(Uri.fromFile(logFile));
} else {
uris.add(FileProvider.getUriForFile(
this,
getString(R.string.file_provider_authority),
logFile
));
uris.add(FileProvider.getUriForFile(this, getString(R.string.file_provider_authority), logFile));
}
}
}

View file

@ -296,7 +296,6 @@ public class StorageMigration {
protected Integer doInBackground(Void... voids) {
publishProgress(R.string.file_migration_preparing);
Log_OC.stopLogging();
boolean[] syncStates = null;
try {
publishProgress(R.string.file_migration_saving_accounts_configuration);
@ -309,7 +308,6 @@ public class StorageMigration {
publishProgress(R.string.file_migration_restoring_accounts_configuration);
restoreAccountsSyncStatus(syncStates);
}
Log_OC.startLogging(mStorageTarget);
return 0;
}
@ -338,7 +336,6 @@ public class StorageMigration {
@Override
protected Integer doInBackground(Void... args) {
publishProgress(R.string.file_migration_preparing);
Log_OC.stopLogging();
boolean[] syncState = null;
@ -372,14 +369,12 @@ public class StorageMigration {
} catch (MigrationException e) {
rollback();
Log_OC.startLogging(mStorageSource);
return e.getResId();
} finally {
publishProgress(R.string.file_migration_restoring_accounts_configuration);
restoreAccountsSyncStatus(syncState);
}
Log_OC.startLogging(mStorageTarget);
publishProgress(R.string.file_migration_ok_finished);
return 0;

View file

@ -115,10 +115,6 @@ public class FileStorageUtils {
return savePath.getUsableSpace();
}
public static String getLogPath() {
return MainApp.getStoragePath() + File.separator + MainApp.getDataFolder() + File.separator + "log";
}
/**
* Returns the a string like 2016/08/ for the passed date. If date is 0 an empty
* string is returned

View file

@ -1,5 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<paths>
<files-path
path="log/"
name="log"/>
<external-path name="external_files" path="."/>
<root-path name="external_files" path="/storage/" />
<!-- yes, valid for ALL external storage and not only our app folder, since we can't use @string/data_folder