Fixed Download location dialog keep popping up
This commit is contained in:
@@ -252,10 +252,11 @@ class Pupil : Application() {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
Preferences.get<String>("download_folder").also {
|
Preferences.get<String>("download_folder").also {
|
||||||
contentResolver.takePersistableUriPermission(
|
if (it.startsWith("content://"))
|
||||||
Uri.parse(it),
|
contentResolver.takePersistableUriPermission(
|
||||||
Intent.FLAG_GRANT_READ_URI_PERMISSION or Intent.FLAG_GRANT_WRITE_URI_PERMISSION
|
Uri.parse(it),
|
||||||
)
|
Intent.FLAG_GRANT_READ_URI_PERMISSION or Intent.FLAG_GRANT_WRITE_URI_PERMISSION
|
||||||
|
)
|
||||||
|
|
||||||
if (!FileX(this, it).canWrite())
|
if (!FileX(this, it).canWrite())
|
||||||
throw Exception()
|
throw Exception()
|
||||||
|
|||||||
Reference in New Issue
Block a user