android/app/src/main/AndroidManifest.xml |   47 +++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)

New commits:
commit f63b617b12ea8d8b0aa3fc83fbe60190ff4bda3a
Author:     Jan Holesovsky <ke...@collabora.com>
AuthorDate: Tue Jul 14 20:13:47 2020 +0200
Commit:     Jan Holesovsky <ke...@collabora.com>
CommitDate: Wed Jul 15 23:45: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/+/98765
    Tested-by: Jenkins
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Michael Meeks <michael.me...@collabora.com>

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
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to