From 40a708fd0ef71342ccc7cd24553f5cfe57b126d4 Mon Sep 17 00:00:00 2001 From: Martin Fietz Date: Fri, 27 Nov 2015 15:05:49 +0100 Subject: Log crash reports, users can send them via email --- .../java/de/danoeh/antennapod/core/preferences/UserPreferences.java | 6 +++--- .../java/de/danoeh/antennapod/core/storage/DownloadRequester.java | 2 +- core/src/main/java/de/danoeh/antennapod/core/util/StorageUtils.java | 4 ++-- core/src/main/res/values/strings.xml | 3 +++ 4 files changed, 9 insertions(+), 6 deletions(-) (limited to 'core') diff --git a/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java b/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java index 6de546d3b..428d1d7d3 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java +++ b/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java @@ -520,7 +520,7 @@ public class UserPreferences { * @return The data folder that has been requested or null if the folder * could not be created. */ - public static File getDataFolder(Context context, String type) { + public static File getDataFolder(String type) { String strDir = prefs.getString(PREF_DATA_FOLDER, null); if (strDir == null) { Log.d(TAG, "Using default data folder"); @@ -542,7 +542,7 @@ public class UserPreferences { for (int i = 0; i < dirs.length; i++) { if (dirs.length > 0) { if (i < dirs.length - 1) { - dataDir = getDataFolder(context, dirs[i]); + dataDir = getDataFolder(dirs[i]); if (dataDir == null) { return null; } @@ -593,7 +593,7 @@ public class UserPreferences { * available */ private static void createImportDirectory() { - File importDir = getDataFolder(context, IMPORT_DIR); + File importDir = getDataFolder(IMPORT_DIR); if (importDir != null) { if (importDir.exists()) { Log.d(TAG, "Import directory already exists"); diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/DownloadRequester.java b/core/src/main/java/de/danoeh/antennapod/core/storage/DownloadRequester.java index b13f7a0cb..6c0ec06fd 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/DownloadRequester.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/DownloadRequester.java @@ -335,7 +335,7 @@ public class DownloadRequester { private File getExternalFilesDirOrThrowException(Context context, String type) throws DownloadRequestException { - File result = UserPreferences.getDataFolder(context, type); + File result = UserPreferences.getDataFolder(type); if (result == null) { throw new DownloadRequestException( "Failed to access external storage"); diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/StorageUtils.java b/core/src/main/java/de/danoeh/antennapod/core/util/StorageUtils.java index dea380937..248f2bf32 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/StorageUtils.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/StorageUtils.java @@ -19,7 +19,7 @@ public class StorageUtils { private static final String TAG = "StorageUtils"; public static boolean storageAvailable(Context context) { - File dir = UserPreferences.getDataFolder(context, null); + File dir = UserPreferences.getDataFolder(null); if (dir != null) { return dir.exists() && dir.canRead() && dir.canWrite(); } else { @@ -52,7 +52,7 @@ public class StorageUtils { */ public static long getFreeSpaceAvailable() { StatFs stat = new StatFs(UserPreferences.getDataFolder( - ClientConfig.applicationCallbacks.getApplicationInstance(), null).getAbsolutePath()); + null).getAbsolutePath()); long availableBlocks; long blockSize; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) { diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml index 6cbc5579d..d9c165694 100644 --- a/core/src/main/res/values/strings.xml +++ b/core/src/main/res/values/strings.xml @@ -364,6 +364,9 @@ Disabled Image Cache Size Size of the disk cache for images. + Crash Report + Send the latest crash report via e-mail + Send e-mail Experimental Sonic media player Use built-in sonic media player as a replacement for Prestissimo -- cgit v1.2.3