check connected OTG devices only after receiving the write_storage permission

This commit is contained in:
tibbi 2018-12-06 15:23:52 +01:00
parent 77ff3010ba
commit 904e43e8f0

View file

@ -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 {