#issue2787 #issue2592 both fixed by same changes

This commit is contained in:
MohitMali 2022-04-05 17:32:05 +05:30 committed by Emmanuel Engelhart
parent 6b61cf02f6
commit d25929a78a
No known key found for this signature in database
GPG Key ID: 120B30D020B553D3

View File

@ -33,7 +33,7 @@ object StorageDeviceUtils {
@JvmStatic
fun getReadableStorage(context: Context): List<StorageDevice> {
val storageDevices = ArrayList<StorageDevice>().apply {
add(environmentDevices())
add(environmentDevices(context))
addAll(externalMountPointDevices())
addAll(externalFilesDirsDevices(context, false))
}
@ -63,9 +63,9 @@ object StorageDeviceUtils {
?.map { dir -> StorageDevice(dir, false) }
.orEmpty()
private fun environmentDevices() =
private fun environmentDevices(context: Context) =
StorageDevice(
generalisePath(Environment.getExternalStorageDirectory().path, false),
generalisePath(context.getExternalFilesDir("").toString(), true),
Environment.isExternalStorageEmulated()
)