mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2025-12-04 15:49:33 +01:00
fix: Refactoring database actions
This commit is contained in:
@@ -21,7 +21,9 @@ package com.kunzisoft.keepass.utils
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.ContentResolver
|
||||
import android.content.Context
|
||||
import android.net.Uri
|
||||
import android.os.Build
|
||||
import android.util.Log
|
||||
import java.io.*
|
||||
import java.util.*
|
||||
@@ -37,6 +39,14 @@ object UriHelper {
|
||||
return Uri.decode(this) ?: ""
|
||||
}
|
||||
|
||||
fun Context.getBinaryDir(): File {
|
||||
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
this.applicationContext.noBackupFilesDir
|
||||
} else {
|
||||
this.applicationContext.filesDir
|
||||
}
|
||||
}
|
||||
|
||||
@Throws(FileNotFoundException::class)
|
||||
fun ContentResolver.getUriInputStream(fileUri: Uri?): InputStream? {
|
||||
if (fileUri == null)
|
||||
|
||||
Reference in New Issue
Block a user