diff options
author | ByteHamster <info@bytehamster.com> | 2022-07-30 21:42:07 +0200 |
---|---|---|
committer | ByteHamster <info@bytehamster.com> | 2022-07-30 21:50:14 +0200 |
commit | 8dc9dd888e1e1252fe422341720f7e45f05954cd (patch) | |
tree | b4b135a5d678ff533366c63ae8d3e2fa97dd39c4 /core/src | |
parent | 4f2ba0b58eadcda69693025319e96cfee79b2ce7 (diff) | |
download | AntennaPod-8dc9dd888e1e1252fe422341720f7e45f05954cd.zip |
Remove storage error activity
We fall back to the internal memory silently, so these code paths are
never actually called.
Diffstat (limited to 'core/src')
3 files changed, 1 insertions, 47 deletions
diff --git a/core/src/main/java/de/danoeh/antennapod/core/ApplicationCallbacks.java b/core/src/main/java/de/danoeh/antennapod/core/ApplicationCallbacks.java index 3acc84e3b..3b591363f 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/ApplicationCallbacks.java +++ b/core/src/main/java/de/danoeh/antennapod/core/ApplicationCallbacks.java @@ -1,8 +1,6 @@ package de.danoeh.antennapod.core; import android.app.Application; -import android.content.Context; -import android.content.Intent; /** * Callbacks related to the application in general @@ -13,11 +11,4 @@ public interface ApplicationCallbacks { * Returns a non-null instance of the application class */ Application getApplicationInstance(); - - /** - * Returns a non-null intent that starts the storage error - * activity. - */ - Intent getStorageErrorActivity(Context context); - } diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/download/HttpDownloader.java b/core/src/main/java/de/danoeh/antennapod/core/service/download/HttpDownloader.java index 3238ce5f1..9a2a10490 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/download/HttpDownloader.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/download/HttpDownloader.java @@ -113,9 +113,6 @@ public class HttpDownloader extends Downloader { } else if (!response.isSuccessful() || response.body() == null) { callOnFailByResponseCode(response); return; - } else if (!StorageUtils.storageAvailable()) { - onFail(DownloadError.ERROR_DEVICE_NOT_FOUND, null); - return; } else if (request.getFeedfileType() == FeedMedia.FEEDFILETYPE_FEEDMEDIA && isContentTypeTextAndSmallerThan100kb(response)) { onFail(DownloadError.ERROR_FILE_TYPE, null); 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 cf049ed80..c15d80b6f 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 @@ -1,50 +1,16 @@ package de.danoeh.antennapod.core.util; -import android.app.Activity; import android.os.StatFs; -import android.util.Log; +import de.danoeh.antennapod.core.preferences.UserPreferences; import java.io.File; -import de.danoeh.antennapod.core.ClientConfig; -import de.danoeh.antennapod.core.preferences.UserPreferences; - /** * Utility functions for handling storage errors */ public class StorageUtils { private StorageUtils(){} - private static final String TAG = "StorageUtils"; - - public static boolean storageAvailable() { - File dir = UserPreferences.getDataFolder(null); - if (dir != null) { - return dir.exists() && dir.canRead() && dir.canWrite(); - } else { - Log.d(TAG, "Storage not available: data folder is null"); - return false; - } - } - - /** - * Checks if external storage is available. If external storage isn't - * available, the current activity is finsished an an error activity is - * launched. - * - * @param activity the activity which would be finished if no storage is - * available - * @return true if external storage is available - */ - public static boolean checkStorageAvailability(Activity activity) { - boolean storageAvailable = storageAvailable(); - if (!storageAvailable) { - activity.finish(); - activity.startActivity(ClientConfig.applicationCallbacks.getStorageErrorActivity(activity)); - } - return storageAvailable; - } - /** * Get the number of free bytes that are available on the external storage. */ |