Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 450d11c6 authored by tibbi's avatar tibbi
Browse files

catch ReceiverCallNotAllowedException thrown at MediaScanner connect

parent 5faff02b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@ buildscript {
        propMinSdkVersion = 16
        propTargetSdkVersion = propCompileSdkVersion
        propVersionCode = 1
        propVersionName = '3.16.14'
        propVersionName = '3.16.15'
        kotlin_version = '1.2.30'
        support_libs = '27.1.0'
    }
+5 −1
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@ package com.simplemobiletools.commons.extensions
import android.annotation.SuppressLint
import android.content.ContentValues
import android.content.Context
import android.content.ReceiverCallNotAllowedException
import android.hardware.usb.UsbManager
import android.media.MediaScannerConnection
import android.net.Uri
@@ -250,7 +251,10 @@ fun Context.rescanPaths(paths: ArrayList<String>, callback: (() -> Unit)? = null
    }

    connection = MediaScannerConnection(this, connectionClient)
    try {
        connection.connect()
    } catch (ignored: ReceiverCallNotAllowedException) {
    }
}

fun getPaths(file: File): ArrayList<String> {