mirror of
https://github.com/Myzel394/Alibi.git
synced 2025-06-19 07:15:25 +02:00
fix: Use proper media folder for low storage info
Signed-off-by: Myzel394 <50424412+Myzel394@users.noreply.github.com>
This commit is contained in:
parent
e4e23abcea
commit
0461fe9596
@ -7,6 +7,7 @@ import android.content.Context
|
|||||||
import android.database.Cursor
|
import android.database.Cursor
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
|
import android.os.Environment
|
||||||
import android.os.storage.StorageManager
|
import android.os.storage.StorageManager
|
||||||
import android.provider.MediaStore
|
import android.provider.MediaStore
|
||||||
import android.provider.MediaStore.Video.Media
|
import android.provider.MediaStore.Video.Media
|
||||||
@ -527,7 +528,17 @@ abstract class BatchesFolder(
|
|||||||
val file = when (type) {
|
val file = when (type) {
|
||||||
BatchType.INTERNAL -> context.filesDir
|
BatchType.INTERNAL -> context.filesDir
|
||||||
BatchType.CUSTOM -> customFolder!!.uri.toFile()
|
BatchType.CUSTOM -> customFolder!!.uri.toFile()
|
||||||
BatchType.MEDIA -> scopedMediaContentUri.toFile()
|
BatchType.MEDIA ->
|
||||||
|
if (SUPPORTS_SCOPED_STORAGE)
|
||||||
|
File(
|
||||||
|
Environment.getExternalStoragePublicDirectory(VideoBatchesFolder.BASE_SCOPED_STORAGE_RELATIVE_PATH),
|
||||||
|
MediaStore.Video.Media.EXTERNAL_CONTENT_URI.toString(),
|
||||||
|
)
|
||||||
|
else
|
||||||
|
File(
|
||||||
|
Environment.getExternalStoragePublicDirectory(VideoBatchesFolder.BASE_LEGACY_STORAGE_FOLDER),
|
||||||
|
VideoBatchesFolder.MEDIA_RECORDINGS_SUBFOLDER,
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user