android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java |    6 
++++++
 1 file changed, 6 insertions(+)

New commits:
commit 359326e4222d516c245f46d30c5ee16949571b45
Author:     Jan Holesovsky <[email protected]>
AuthorDate: Fri Jul 3 23:07:47 2020 +0200
Commit:     Jan Holesovsky <[email protected]>
CommitDate: Fri Jul 3 23:20:24 2020 +0200

    android: On ChromeOS, load files from Google Drive read-only.
    
    Apparently it is not possible to save to Google Drive yet.
    Unfortunately I don't have a proof in the documentation or anywhere on
    the net, but the good indication of this is that the
    Intent.ACTION_CREATE_DOCUMENT does not offer Google Drive (while it does
    on a "normal" Android).
    
    Change-Id: I521b866fd783b81a2bb9eace84354b5564ebabee
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97902
    Tested-by: Jan Holesovsky <[email protected]>
    Reviewed-by: Jan Holesovsky <[email protected]>

diff --git 
a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java 
b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
index d6d9f804b..855fa63b0 100644
--- a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
+++ b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
@@ -262,6 +262,12 @@ public class LOActivity extends AppCompatActivity {
 
             if 
(getIntent().getData().getScheme().equals(ContentResolver.SCHEME_CONTENT)) {
                 isDocEditable = (getIntent().getFlags() & 
Intent.FLAG_GRANT_WRITE_URI_PERMISSION) != 0;
+
+                // turns out that on ChromeOS, it is not possible to save back
+                // to Google Drive; detect it already here to avoid 
disappointment
+                if 
(getIntent().getData().toString().startsWith("content://org.chromium.arc.chromecontentprovider/externalfile"))
+                    isDocEditable = false;
+
                 if (!isDocEditable)
                     Toast.makeText(this, 
getResources().getString(R.string.temp_file_saving_disabled), 
Toast.LENGTH_SHORT).show();
 
_______________________________________________
Libreoffice-commits mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to