From 2d5f5a82c9e67faa96bd006bcd09e9e4b15bcfe3 Mon Sep 17 00:00:00 2001 From: Hardcore Sushi Date: Mon, 11 Nov 2024 19:32:18 +0100 Subject: [PATCH] Wipe exported disk files on background threads --- .../java/sushi/hardcore/droidfs/EncryptedFileProvider.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/sushi/hardcore/droidfs/EncryptedFileProvider.kt b/app/src/main/java/sushi/hardcore/droidfs/EncryptedFileProvider.kt index 494964e..dbb8c5b 100644 --- a/app/src/main/java/sushi/hardcore/droidfs/EncryptedFileProvider.kt +++ b/app/src/main/java/sushi/hardcore/droidfs/EncryptedFileProvider.kt @@ -9,6 +9,8 @@ import android.system.Os import android.util.Log import androidx.preference.PreferenceManager import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.launch import sushi.hardcore.droidfs.filesystems.EncryptedVolume import sushi.hardcore.droidfs.util.Compat @@ -86,7 +88,9 @@ class EncryptedFileProvider(context: Context) { } override fun free() { - Wiper.wipe(file) + GlobalScope.launch(Dispatchers.IO) { + Wiper.wipe(file) + } } }