android/app/src/main/AndroidManifest.xml | 47 +++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+)
New commits: commit a522118166f2f9bd4d6ee173ea6bd379ee68e8a1 Author: Jan Holesovsky <[email protected]> AuthorDate: Tue Jul 14 20:13:47 2020 +0200 Commit: Jan Holesovsky <[email protected]> CommitDate: Wed Jul 15 11:42:13 2020 +0200 android: Add support for ODT/ODS/ODP for Chrome OS. Turns out that the ODF mime types are most probably not supported by Chrome OS, because the android:mimeType=... is not enough to associate the app with the ODT/ODP/ODS files. So introduce an additional intent-filter that explicitly matches according to the file extension; a bit hacky, but works. Change-Id: If7cad42333314e8d16f96d035380460d5c3da347 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98784 Tested-by: Jan Holesovsky <[email protected]> Reviewed-by: Jan Holesovsky <[email protected]> diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 6912a0b57..4e8723706 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -116,6 +116,53 @@ <data android:mimeType="image/x-wmf" /> <data android:mimeType="image/svg+xml" /> </intent-filter> + <!-- HACK to support ODF files on Chrome OS, inspired by + https://stackoverflow.com/questions/1733195/android-intent-filter-for-a-particular-file-extension + + Seems like the ODF mime types are not available on Chrome OS, + so we have to explicitly match the extension. But the ".*" is + not greedy, so the matching stops at the first "\\.", so we + have to list several variants to handle files like "blah.ugh.odt". + + Additionally, this must not be in the above intent-filter + section, because the android:mimeType="*/*" would make it + make problems there. --> + <intent-filter> + <action android:name="android.intent.action.VIEW" /> + <action android:name="android.intent.action.EDIT" /> + <action android:name="android.intent.action.PICK" /> + + <category android:name="android.intent.category.DEFAULT" /> + + <data android:scheme="file" /> + <data android:scheme="content" /> + <data android:host="*" /> + <data android:mimeType="*/*" /> + + <data android:pathPattern=".*\\.odt" /> + <data android:pathPattern=".*\\..*\\.odt" /> + <data android:pathPattern=".*\\..*\\..*\\.odt" /> + <data android:pathPattern=".*\\..*\\..*\\..*\\.odt" /> + <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\.odt" /> + <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\.odt" /> + <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\..*\\.odt" /> + + <data android:pathPattern=".*\\.ods" /> + <data android:pathPattern=".*\\..*\\.ods" /> + <data android:pathPattern=".*\\..*\\..*\\.ods" /> + <data android:pathPattern=".*\\..*\\..*\\..*\\.ods" /> + <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\.ods" /> + <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\.ods" /> + <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\..*\\.ods" /> + + <data android:pathPattern=".*\\.odp" /> + <data android:pathPattern=".*\\..*\\.odp" /> + <data android:pathPattern=".*\\..*\\..*\\.odp" /> + <data android:pathPattern=".*\\..*\\..*\\..*\\.odp" /> + <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\.odp" /> + <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\.odp" /> + <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\..*\\.odp" /> + </intent-filter> </activity> <!-- The Activity to show license or notice --> _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
