Fix opening PDF files with external viewers#152
Open
zerox80 wants to merge 3 commits into
Open
Conversation
Contributor
Hmm.
Is this really needed? I didn't investigate it, but can't we just tell Android openThisFile("application/pdf", "/path/to/the.pdf") ? |
0e1ca72 to
87b5ae2
Compare
Contributor
Author
|
updated this to keep it more conservative:
also updated the pr description to match this. |
66c3abc to
74fc9d7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #139.
This changes the file-open intent MIME type selection so known file extensions are used when the stored MIME type is generic or missing. Concrete MIME types reported by the server are kept as-is; this keeps WebDAV metadata as the source of truth while still opening downloaded
*.pdffiles withapplication/pdfwhen the stored type isapplication/octet-stream,*/*, blank, or missing.The same MIME fallback is used in both
OCFilefile-open flows, and the manifest declares Android 11+ package visibility queries needed by explicit handler lookups for view/send intents.Changes
MimetypeIconUtil.getBestMimeTypeForOpen(...)OCFiles from both file-open flows<queries>entries forVIEW,SEND, andSEND_MULTIPLEValidation
./gradlew.bat :opencloudApp:testOriginalDebugUnitTest --tests eu.opencloud.android.utils.MimetypeIconUtilTest./gradlew.bat detekt./gradlew.bat assembleDebugVIEW,SEND, andSEND_MULTIPLEpackage visibility queries