use the new way of creating temporary files on Android 11+

This commit is contained in:
tibbi 2021-10-08 22:53:57 +02:00
parent 9da550ecf3
commit 877b9f499a

View file

@ -147,6 +147,10 @@ fun File.createTempFile(): File {
return if (isDirectory) {
createTempDir("temp", "${System.currentTimeMillis()}", parentFile)
} else {
createTempFile("temp", "${System.currentTimeMillis()}", parentFile)
if (isRPlus()) {
kotlin.io.path.createTempFile("temp", "${System.currentTimeMillis()}").toFile()
} else {
createTempFile("temp", "${System.currentTimeMillis()}", parentFile)
}
}
}