android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java |   12 
+++++-----
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 61b981e2682872e9ff45dc3c13d51875b1cd5ae3
Author: Mert Tumer <[email protected]>
Date:   Fri Jul 6 07:56:33 2018 -0700

    Fix endless loop when selecting remote server on Android Viewer
    
    Switching document provider when exception thrown casues
    endless loop.
    Signed-off-by: Mert Tumer <[email protected]>
    
    Change-Id: Ie34080abdf7b8d6a48cd96785700b7bd91910512
    Reviewed-on: https://gerrit.libreoffice.org/57070
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <[email protected]>

diff --git 
a/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java 
b/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java
index d7b0ab41c015..0202e0797b63 100644
--- a/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java
+++ b/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java
@@ -432,10 +432,8 @@ public class LibreOfficeUIActivity extends 
AppCompatActivity implements Settings
                 // these operations may imply network access and must be run in
                 // a different thread
                 try {
-                    documentProvider = provider[0];
-                    homeDirectory = 
documentProvider.getRootDirectory(LibreOfficeUIActivity.this);
-                    currentDirectory = homeDirectory;
-                    List<IFile> paths = 
currentDirectory.listFiles(FileUtilities
+                    homeDirectory = 
provider[0].getRootDirectory(LibreOfficeUIActivity.this);
+                    List<IFile> paths = homeDirectory.listFiles(FileUtilities
                             .getFileFilter(filterMode));
                     filePaths = new ArrayList<IFile>();
                     for(IFile file: paths) {
@@ -455,13 +453,15 @@ public class LibreOfficeUIActivity extends 
AppCompatActivity implements Settings
                         public void run() {
                             Toast.makeText(activity, e.getMessage(),
                                     Toast.LENGTH_SHORT).show();
-                            // switch back to the default provider.
-                            
switchToDocumentProvider(documentProviderFactory.getDefaultProvider());
                         }
                     });
                     startActivity(new Intent(activity, 
DocumentProviderSettingsActivity.class));
                     Log.e(LOGTAG, "failed to switch document provider "+ 
e.getMessage(), e.getCause());
+                    return null;
                 }
+                //no exception
+                documentProvider = provider[0];
+                currentDirectory = homeDirectory;
                 return null;
             }
 
_______________________________________________
Libreoffice-commits mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to