From caa3812e13d888f31b23487505462eea85f12e96 Mon Sep 17 00:00:00 2001 From: Stypox Date: Tue, 23 Apr 2024 18:05:31 +0200 Subject: [PATCH] Ignore all errors when getting free storage space It's not a critical check that needs to be perfomed, so in case something does not work on some device/version, let's just ignore the error. --- .../org/schabi/newpipe/streams/io/StoredDirectoryHelper.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/streams/io/StoredDirectoryHelper.java b/app/src/main/java/org/schabi/newpipe/streams/io/StoredDirectoryHelper.java index 8dd819293..3f6bf37ea 100644 --- a/app/src/main/java/org/schabi/newpipe/streams/io/StoredDirectoryHelper.java +++ b/app/src/main/java/org/schabi/newpipe/streams/io/StoredDirectoryHelper.java @@ -11,7 +11,6 @@ import android.database.Cursor; import android.net.Uri; import android.os.ParcelFileDescriptor; import android.provider.DocumentsContract; -import android.system.ErrnoException; import android.system.Os; import android.system.StructStatVfs; import android.util.Log; @@ -207,7 +206,9 @@ public class StoredDirectoryHelper { // this is the same formula used inside the FsStat class return stat.f_bavail * stat.f_frsize; - } catch (final IOException | ErrnoException e) { + } catch (final Throwable e) { + // ignore any error + Log.e(TAG, "Could not get free storage space", e); return Long.MAX_VALUE; } }