From 65421a5d579220c6831f1477198effcdae9498a3 Mon Sep 17 00:00:00 2001 From: Tonyo Francis Date: Mon, 17 Aug 2020 11:53:48 -0400 Subject: [PATCH] remove call to content provider for file --- .../main/java/com/tonyodev/fetch2core/StorageResolverHelper.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fetch2core/src/main/java/com/tonyodev/fetch2core/StorageResolverHelper.kt b/fetch2core/src/main/java/com/tonyodev/fetch2core/StorageResolverHelper.kt index ba74873f..1b0e63e8 100644 --- a/fetch2core/src/main/java/com/tonyodev/fetch2core/StorageResolverHelper.kt +++ b/fetch2core/src/main/java/com/tonyodev/fetch2core/StorageResolverHelper.kt @@ -134,7 +134,7 @@ fun deleteFile(filePath: String, context: Context): Boolean { when { uri.scheme == "file" -> { val file = File(uri.path) - if (file.canWrite() && file.exists()) deleteFile(file) else context.contentResolver.delete(uri, null, null) > 0 + if (file.canWrite() && file.exists()) deleteFile(file) else false } uri.scheme == "content" -> { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT