diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 8c93c3ac3742..1bce8e9434d3 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -77,6 +77,7 @@
+
+
+
+
+
+
+
+
@@ -288,6 +298,34 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -348,6 +386,34 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/java/at/tomtasche/reader/ui/activity/MainActivity.java b/app/src/main/java/at/tomtasche/reader/ui/activity/MainActivity.java
index 829b9ecc4c87..1c9bcb417ed4 100644
--- a/app/src/main/java/at/tomtasche/reader/ui/activity/MainActivity.java
+++ b/app/src/main/java/at/tomtasche/reader/ui/activity/MainActivity.java
@@ -216,11 +216,18 @@ protected void onStart() {
}
}
+ private static final String PREF_CATCH_ALL_ENABLED = "catch_all_enabled";
+
private void initializeCatchAllSwitch() {
ComponentName catchAllComponent = new ComponentName(this, "at.tomtasche.reader.ui.activity.MainActivity.CATCH_ALL");
ComponentName strictCatchComponent = new ComponentName(this, "at.tomtasche.reader.ui.activity.MainActivity.STRICT_CATCH");
- boolean isCatchAllEnabled = getPackageManager().getComponentEnabledSetting(catchAllComponent) != PackageManager.COMPONENT_ENABLED_STATE_DISABLED;
+ SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
+
+ // catch-all is only active if the user explicitly opted in. new installs and
+ // existing users who never touched the switch default to STRICT_CATCH, so we
+ // no longer volunteer to open unrelated file types like contacts (issue #477).
+ boolean isCatchAllEnabled = preferences.getBoolean(PREF_CATCH_ALL_ENABLED, false);
// retoggle components for users upgrading to latest version of app
toggleComponent(catchAllComponent, isCatchAllEnabled);
@@ -231,6 +238,8 @@ private void initializeCatchAllSwitch() {
catchAllSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
+ preferences.edit().putBoolean(PREF_CATCH_ALL_ENABLED, isChecked).apply();
+
toggleComponent(catchAllComponent, isChecked);
toggleComponent(strictCatchComponent, !isChecked);
}
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 7d46a4f4ae89..51894fdd8b98 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -45,7 +45,7 @@
OpenDocument Reader allows you to view documents that are stored in OpenDocument format (.odt, .ods, .odp and .odg) wherever you are.
With OpenDocument Reader you can read and search through your documents in a breeze.
Found one last typo left to fix ahead of your big presentation? It now supports modifications too!
- This app registers to open all file types by default in order to support apps like \"Samsung My Files\". You may turn this feature off here if it causes problems for you.
+ By default this app only offers to open document files. If another app like \"Samsung My Files\" won\'t let you open a document here, turn this on to register for all file types.
Reading…
Initializing TTS…
Ready!