diff options
author | Mert Tumer <merttumer@outlook.com> | 2018-07-06 07:56:33 -0700 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2018-07-12 15:42:10 +0200 |
commit | 61b981e2682872e9ff45dc3c13d51875b1cd5ae3 (patch) | |
tree | f8a5dee8bdc8841ec4b98a44677f0e53ed0b57bb /android | |
parent | 3d73f76a91260becf171ea77589190714577b267 (diff) |
Fix endless loop when selecting remote server on Android Viewer
Switching document provider when exception thrown casues
endless loop.
Signed-off-by: Mert Tumer <merttumer@outlook.com>
Change-Id: Ie34080abdf7b8d6a48cd96785700b7bd91910512
Reviewed-on: https://gerrit.libreoffice.org/57070
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'android')
-rw-r--r-- | android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java | 12 |
1 files changed, 6 insertions, 6 deletions
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; } |