diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsPrivacy.java b/app/src/main/java/eu/faircode/email/FragmentOptionsPrivacy.java
index f7201d3a96..b763c2c85e 100644
--- a/app/src/main/java/eu/faircode/email/FragmentOptionsPrivacy.java
+++ b/app/src/main/java/eu/faircode/email/FragmentOptionsPrivacy.java
@@ -19,6 +19,7 @@ package eu.faircode.email;
Copyright 2018-2022 by Marcel Bokhorst (M66B)
*/
+import android.app.ActivityManager;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
@@ -93,6 +94,7 @@ public class FragmentOptionsPrivacy extends FragmentBase implements SharedPrefer
private SwitchCompat swDisconnectAutoUpdate;
private SwitchCompat swDisconnectLinks;
private SwitchCompat swDisconnectImages;
+ private Button btnClearAll;
private Group grpSafeBrowsing;
@@ -150,6 +152,7 @@ public class FragmentOptionsPrivacy extends FragmentBase implements SharedPrefer
swDisconnectAutoUpdate = view.findViewById(R.id.swDisconnectAutoUpdate);
swDisconnectLinks = view.findViewById(R.id.swDisconnectLinks);
swDisconnectImages = view.findViewById(R.id.swDisconnectImages);
+ btnClearAll = view.findViewById(R.id.btnClearAll);
grpSafeBrowsing = view.findViewById(R.id.grpSafeBrowsing);
@@ -437,6 +440,26 @@ public class FragmentOptionsPrivacy extends FragmentBase implements SharedPrefer
}
});
+ btnClearAll.setVisibility(BuildConfig.PLAY_STORE_RELEASE ? View.GONE : View.VISIBLE);
+ btnClearAll.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ new AlertDialog.Builder(getContext())
+ .setIcon(R.drawable.twotone_dangerous_24)
+ .setTitle(R.string.title_advanced_clear_all)
+ .setMessage(R.string.title_advanced_clear_all_remark)
+ .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ ActivityManager am = (ActivityManager) getContext().getSystemService(Context.ACTIVITY_SERVICE);
+ am.clearApplicationUserData();
+ }
+ })
+ .setNegativeButton(android.R.string.cancel, null)
+ .show();
+ }
+ });
+
// Initialize
FragmentDialogTheme.setBackground(getContext(), view, false);
diff --git a/app/src/main/res/drawable/twotone_dangerous_24.xml b/app/src/main/res/drawable/twotone_dangerous_24.xml
new file mode 100644
index 0000000000..dadef38b3c
--- /dev/null
+++ b/app/src/main/res/drawable/twotone_dangerous_24.xml
@@ -0,0 +1,15 @@
+
+
+
+
diff --git a/app/src/main/res/layout/fragment_options_privacy.xml b/app/src/main/res/layout/fragment_options_privacy.xml
index e04cf3f132..c06a9040a0 100644
--- a/app/src/main/res/layout/fragment_options_privacy.xml
+++ b/app/src/main/res/layout/fragment_options_privacy.xml
@@ -634,6 +634,18 @@
app:layout_constraintTop_toBottomOf="@+id/swDisconnectLinks"
app:switchPadding="12dp" />
+
+
Automatically update lists weekly
Use lists to warn about tracking links
Use lists to recognize tracking images
+ Delete all data
+ All app data will be irreversibly deleted!
Sign by default
Encrypt by default