Fix open Microsoft files URI in intent (#150)
This commit is contained in:
parent
d22f1a4459
commit
ff9d116762
@ -540,7 +540,7 @@ class BrowseFilesPresenter @Inject constructor( //
|
||||
}.also {
|
||||
openedCloudFile = cloudFile
|
||||
openedCloudFileMd5 = calculateDigestFromUri(it)
|
||||
viewFileIntent.setDataAndType(uriToOpenedFile, mimeTypes.fromFilename(cloudFile.name)?.toString())
|
||||
viewFileIntent.setDataAndType(it, mimeTypes.fromFilename(cloudFile.name)?.toString())
|
||||
viewFileIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION or Intent.FLAG_GRANT_WRITE_URI_PERMISSION)
|
||||
if (sharedPreferencesHandler.keepUnlockedWhileEditing()) {
|
||||
openWritableFileNotification = OpenWritableFileNotification(context(), it)
|
||||
|
@ -122,8 +122,9 @@ class FileUtil @Inject constructor(private val context: Context, private val mim
|
||||
private fun getPublicDecryptedFileStorage(): File? {
|
||||
return try {
|
||||
val mediaDir = context.getExternalMediaDirs().first { dir -> dir.startsWith("/storage/emulated/0") }
|
||||
val publicDecryptedFileStorage = File(mediaDir, "decrypted")
|
||||
if (publicDecryptedFileStorage.canWrite()) {
|
||||
if (mediaDir.canWrite()) {
|
||||
val publicDecryptedFileStorage = File(mediaDir, "decrypted")
|
||||
publicDecryptedFileStorage.mkdir()
|
||||
publicDecryptedFileStorage
|
||||
} else {
|
||||
Timber.tag("FileUtil").e("Media storage isn't writable")
|
||||
|
Loading…
x
Reference in New Issue
Block a user