Wipe exported disk files on background threads

This commit is contained in:
Matéo Duparc 2024-11-11 19:32:18 +01:00
parent b477272d65
commit 2d5f5a82c9
Signed by: hardcoresushi
GPG Key ID: AFE384344A45E13A

View File

@ -9,6 +9,8 @@ import android.system.Os
import android.util.Log import android.util.Log
import androidx.preference.PreferenceManager import androidx.preference.PreferenceManager
import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import sushi.hardcore.droidfs.filesystems.EncryptedVolume import sushi.hardcore.droidfs.filesystems.EncryptedVolume
import sushi.hardcore.droidfs.util.Compat import sushi.hardcore.droidfs.util.Compat
@ -86,7 +88,9 @@ class EncryptedFileProvider(context: Context) {
} }
override fun free() { override fun free() {
Wiper.wipe(file) GlobalScope.launch(Dispatchers.IO) {
Wiper.wipe(file)
}
} }
} }