ZipExporterPreference: don't ask for storage permissions on newer android

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jason A. Donenfeld
2020-09-16 18:01:06 +02:00
parent b877593d55
commit 746ab00794
2 changed files with 11 additions and 4 deletions
@@ -18,6 +18,8 @@ import java.io.IOException
import java.io.OutputStream
object DownloadsFileSaver {
val needsWriteExternalStoragePermission = Build.VERSION.SDK_INT < Build.VERSION_CODES.Q
@Throws(Exception::class)
fun save(context: Context, name: String, mimeType: String?, overwriteExisting: Boolean) = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
val contentResolver = context.contentResolver