From 904e43e8f059987ad55e0cafaa0a15fd30730226 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 6 Dec 2018 15:23:52 +0100 Subject: [PATCH] check connected OTG devices only after receiving the write_storage permission --- .../gallery/pro/activities/MainActivity.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt index 9fd6eb352..2ac01140e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt @@ -126,10 +126,6 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { NewAppDialog(this, NEW_APP_PACKAGE, "Simple Clock") }*/ - if (!config.wasOTGHandled && hasPermission(PERMISSION_WRITE_STORAGE)) { - checkOTGInclusion() - } - if (!config.wereFavoritesPinned) { config.addPinnedFolders(hashSetOf(FAVORITES)) config.wereFavoritesPinned = true @@ -385,6 +381,10 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { private fun tryLoadGallery() { handlePermission(PERMISSION_WRITE_STORAGE) { if (it) { + if (!config.wasOTGHandled && hasPermission(PERMISSION_WRITE_STORAGE)) { + checkOTGInclusion() + } + if (config.showAll) { showAllMedia() } else {