From 74cd554248f9a1f2ba005af2fa8136c0f1ad0157 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 26 Apr 2020 18:45:06 +0200 Subject: [PATCH] run media fetcher on reboot on a background thread --- .../gallery/pro/receivers/BootCompletedReceiver.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/receivers/BootCompletedReceiver.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/receivers/BootCompletedReceiver.kt index 9ccb705d7..f8aae1326 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/receivers/BootCompletedReceiver.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/receivers/BootCompletedReceiver.kt @@ -3,13 +3,16 @@ package com.simplemobiletools.gallery.pro.receivers import android.content.BroadcastReceiver import android.content.Context import android.content.Intent +import com.simplemobiletools.commons.helpers.ensureBackgroundThread import com.simplemobiletools.gallery.pro.extensions.updateDirectoryPath import com.simplemobiletools.gallery.pro.helpers.MediaFetcher class BootCompletedReceiver : BroadcastReceiver() { override fun onReceive(context: Context, intent: Intent) { - MediaFetcher(context).getFoldersToScan().forEach { - context.updateDirectoryPath(it) + ensureBackgroundThread { + MediaFetcher(context).getFoldersToScan().forEach { + context.updateDirectoryPath(it) + } } } }