[Libreoffice-commits] online.git: android/app
Jan Holesovsky (via logerrit)
logerrit at kemper.freedesktop.org
Tue Dec 10 16:15:01 UTC 2019
android/app/src/main/java/org/libreoffice/androidapp/storage/DocumentProviderFactory.java | 3 +--
android/app/src/main/java/org/libreoffice/androidapp/storage/external/ExtsdDocumentsProvider.java | 5 ++++-
android/app/src/main/java/org/libreoffice/androidapp/storage/external/OTGDocumentsProvider.java | 5 ++++-
android/app/src/main/java/org/libreoffice/androidapp/ui/LibreOfficeUIActivity.java | 2 +-
4 files changed, 10 insertions(+), 5 deletions(-)
New commits:
commit 3dce52c307b203a1a255d4e986a62735543e644c
Author: Jan Holesovsky <kendy at collabora.com>
AuthorDate: Tue Dec 10 16:43:05 2019 +0100
Commit: Jan Holesovsky <kendy at collabora.com>
CommitDate: Tue Dec 10 17:14:43 2019 +0100
android: Completely hide the External SD and OTG.
Many reports said it was broken, so let's disable before anybody
actually tests it & fixes.
Change-Id: I179de3774c0fb4be018e59cd629936a9d565dc15
Reviewed-on: https://gerrit.libreoffice.org/84873
Reviewed-by: Jan Holesovsky <kendy at collabora.com>
Tested-by: Jan Holesovsky <kendy at collabora.com>
diff --git a/android/app/src/main/java/org/libreoffice/androidapp/storage/DocumentProviderFactory.java b/android/app/src/main/java/org/libreoffice/androidapp/storage/DocumentProviderFactory.java
index eb4a0ac91..66627c6f0 100644
--- a/android/app/src/main/java/org/libreoffice/androidapp/storage/DocumentProviderFactory.java
+++ b/android/app/src/main/java/org/libreoffice/androidapp/storage/DocumentProviderFactory.java
@@ -62,11 +62,10 @@ public final class DocumentProviderFactory {
instance.providers = new IDocumentProvider[5];
instance.providers[0] = new LocalDocumentsDirectoryProvider(0);
instance.providers[1] = new LocalDocumentsProvider(1);
+ instance.providers[EXTSD_PROVIDER_INDEX] = new ExtsdDocumentsProvider(EXTSD_PROVIDER_INDEX, context);
instance.providers[OTG_PROVIDER_INDEX] = new OTGDocumentsProvider(OTG_PROVIDER_INDEX, context);
instance.providers[4] = new OwnCloudProvider(4, context);
- instance.providers[EXTSD_PROVIDER_INDEX] = new ExtsdDocumentsProvider(EXTSD_PROVIDER_INDEX, context);
-
// initialize document provider names list
instance.providerNames = new String[instance.providers.length];
for (int i = 0; i < instance.providers.length; i++) {
diff --git a/android/app/src/main/java/org/libreoffice/androidapp/storage/external/ExtsdDocumentsProvider.java b/android/app/src/main/java/org/libreoffice/androidapp/storage/external/ExtsdDocumentsProvider.java
index 46dec56f7..2cb8cc72e 100644
--- a/android/app/src/main/java/org/libreoffice/androidapp/storage/external/ExtsdDocumentsProvider.java
+++ b/android/app/src/main/java/org/libreoffice/androidapp/storage/external/ExtsdDocumentsProvider.java
@@ -163,7 +163,10 @@ public class ExtsdDocumentsProvider implements IExternalDocumentProvider,
// getExternalStorageState().equals(Environment.MEDIA_MOUNTED) && isExternalStorageRemovable()
// but they refer to the primary external storage anyway, so what currently is covered by the
// "LocalDocumentsProvider"
- return rootPathURI!=null && ContextCompat.checkSelfPermission(context, Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED;
+
+ // FIXME temporarily disabled for good
+ return false;
+ //return rootPathURI!=null && ContextCompat.checkSelfPermission(context, Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED;
}
@Override
diff --git a/android/app/src/main/java/org/libreoffice/androidapp/storage/external/OTGDocumentsProvider.java b/android/app/src/main/java/org/libreoffice/androidapp/storage/external/OTGDocumentsProvider.java
index 899486c51..5add700b5 100644
--- a/android/app/src/main/java/org/libreoffice/androidapp/storage/external/OTGDocumentsProvider.java
+++ b/android/app/src/main/java/org/libreoffice/androidapp/storage/external/OTGDocumentsProvider.java
@@ -85,6 +85,9 @@ public class OTGDocumentsProvider implements IExternalDocumentProvider,
@Override
public boolean checkProviderAvailability(Context context) {
// check if system supports USB Host
- return rootPathURI.length()>0 && context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_USB_HOST);
+
+ // FIXME temporarily disabled for good
+ return false;
+ //return rootPathURI.length()>0 && context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_USB_HOST);
}
}
diff --git a/android/app/src/main/java/org/libreoffice/androidapp/ui/LibreOfficeUIActivity.java b/android/app/src/main/java/org/libreoffice/androidapp/ui/LibreOfficeUIActivity.java
index c21e884f5..4d6512ab7 100644
--- a/android/app/src/main/java/org/libreoffice/androidapp/ui/LibreOfficeUIActivity.java
+++ b/android/app/src/main/java/org/libreoffice/androidapp/ui/LibreOfficeUIActivity.java
@@ -272,7 +272,7 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements Settings
// Loop through the document providers menu items and check if they are available or not
for (int index = 0; index < navigationDrawer.getMenu().size(); ++index) {
MenuItem item = navigationDrawer.getMenu().getItem(index);
- item.setEnabled(documentProviderFactory.getProvider(index).checkProviderAvailability(this));
+ item.setVisible(documentProviderFactory.getProvider(index).checkProviderAvailability(this));
}
navigationDrawer.setNavigationItemSelectedListener(new NavigationView.OnNavigationItemSelectedListener() {
More information about the Libreoffice-commits
mailing list