From 6e4212e36c15228925e4f5502a6e42d70236affd Mon Sep 17 00:00:00 2001 From: Andreas Stefl Date: Sat, 3 Oct 2026 21:57:19 +0200 Subject: [PATCH] Offer for the older names of Word, Excel and PowerPoint files Since STRICT_CATCH became the default, a .doc, .xls or .ppt that a mail or file app types as application/x-msword and the like no longer reaches the app. Claim those spellings in the manifest and in SupportedDocumentTypes, and map them to the names odrcore knows. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01AK12MgSt5U9MA7dQaCQyqU --- CHANGELOG.md | 3 ++ .../droid/test/SupportedFormatsTest.kt | 22 +++++++++++++ app/src/main/AndroidManifest.xml | 17 ++++++++++ .../background/SupportedDocumentTypes.kt | 32 ++++++++++++++++--- 4 files changed, 70 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8bcc4a03141b..231cddb2709d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,9 @@ section the body of the GitHub release, and refuses a version without one. `scri ## Unreleased +- Word, Excel and PowerPoint files that a mail or file app labels the old way offer to open + in the app again. + ## 4.21.0 - Spreadsheet cells can be formatted: fill, bold, italic, underline, strikethrough, diff --git a/app/src/androidTest/java/app/opendocument/droid/test/SupportedFormatsTest.kt b/app/src/androidTest/java/app/opendocument/droid/test/SupportedFormatsTest.kt index a72061c8d43c..74048bd83514 100644 --- a/app/src/androidTest/java/app/opendocument/droid/test/SupportedFormatsTest.kt +++ b/app/src/androidTest/java/app/opendocument/droid/test/SupportedFormatsTest.kt @@ -141,6 +141,28 @@ class SupportedFormatsTest { } } + /** + * A spelling the core does not name, but a mail or file app sends, reaches us on both sides. + */ + @Test + fun anAliasSpellingReachesUs() { + for ((alias, named) in SupportedDocumentTypes.MIME_ALIASES) { + Assert.assertTrue( + "the app does not offer for $alias", + SupportedDocumentTypes.isSupported(alias, null), + ) + Assert.assertTrue( + "the manifest does not offer for $alias", + resolvesToUs(alias, "document"), + ) + Assert.assertEquals( + "$alias is not read as $named", + SupportedDocumentTypes.canonicalMimeType(named), + SupportedDocumentTypes.canonicalMimeType(alias), + ) + } + } + /** And the same route stays shut for what the app does not claim. */ @Test fun aFileWithNoMimeTypeAndAnUnrelatedExtensionReachesNobody() { diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 9ee3868510a5..7a31859abf93 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -282,6 +282,23 @@ + + + + + + + + + + + + + +