diff options
author | Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> | 2017-09-28 19:56:45 +0200 |
---|---|---|
committer | Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> | 2018-01-18 19:35:43 +0100 |
commit | 494297afe3a14d9aeef6b54515b7dceff5e1cc5f (patch) | |
tree | eff6917250e366368d941938a9d60ed09d51fa09 /android/source/src/java/org/libreoffice/storage/external/ExternalFile.java | |
parent | 63860c399b11b09c06e8df284c3d32b336d5e42c (diff) |
pass context as parameter instead of risk of leaking memory
Also adjust to dynamic permissions after bumping target-SDK.
There still is some confusion about the concept of "external storage" in
the code. LocalDocuments already is "external storage" - clean that up a
little and use AppCompat function instead of using a legacy class for
ExternalDocuments provider.
Doesn't help for broken ROMs though, that would need guessing pathname
for a mounted SD (in addition to separate storage partition of builtin
storage).
Also c6e8c96d50fc2082a3c4b9553196a42bbdd6df37 incorrectly changed the
conditional around, making the whole ExternalDocumentsProvider useless/a
copy of the Local one (i.e. the primary, first returned by the system).
Real fix for tdf#99539 likely was 66be4feef7e0d3661f01fbb2372700de5eeea070
Change-Id: I88ca7742c0f2e89d63c338c8852ad88be0a46e4b
Reviewed-on: https://gerrit.libreoffice.org/45572
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Diffstat (limited to 'android/source/src/java/org/libreoffice/storage/external/ExternalFile.java')
-rw-r--r-- | android/source/src/java/org/libreoffice/storage/external/ExternalFile.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/android/source/src/java/org/libreoffice/storage/external/ExternalFile.java b/android/source/src/java/org/libreoffice/storage/external/ExternalFile.java index 7c7f09fc1ade..aff33e4413ef 100644 --- a/android/source/src/java/org/libreoffice/storage/external/ExternalFile.java +++ b/android/source/src/java/org/libreoffice/storage/external/ExternalFile.java @@ -102,11 +102,11 @@ public class ExternalFile implements IFile{ } @Override - public IFile getParent() { + public IFile getParent(Context context) { // this is the root node if(docFile.getParentFile() == null) return null; - return new ExternalFile(provider, docFile.getParentFile(), context); + return new ExternalFile(provider, docFile.getParentFile(), this.context); } @Override |