From b5c3108be8abdd64b23a43da7f595e76a5952311 Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 14 Aug 2023 11:12:13 +0200 Subject: [PATCH] Revert "Debug: skip action mode" This reverts commit 0d828ce2ab15af8972d9520b1598c3d4fc82a5e2. --- .../java/eu/faircode/email/FixedEditText.java | 20 ------------------- .../faircode/email/FragmentOptionsMisc.java | 13 +----------- .../main/res/layout/fragment_options_misc.xml | 13 +----------- app/src/main/res/values/strings.xml | 1 - 4 files changed, 2 insertions(+), 45 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FixedEditText.java b/app/src/main/java/eu/faircode/email/FixedEditText.java index 4fb7e20bd5..85d904058c 100644 --- a/app/src/main/java/eu/faircode/email/FixedEditText.java +++ b/app/src/main/java/eu/faircode/email/FixedEditText.java @@ -20,7 +20,6 @@ package eu.faircode.email; */ import android.content.Context; -import android.content.SharedPreferences; import android.graphics.Canvas; import android.os.Build; import android.util.AttributeSet; @@ -33,7 +32,6 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.annotation.RequiresApi; import androidx.appcompat.widget.AppCompatEditText; -import androidx.preference.PreferenceManager; public class FixedEditText extends AppCompatEditText { public FixedEditText(@NonNull Context context) { @@ -276,8 +274,6 @@ public class FixedEditText extends AppCompatEditText { @Override public ActionMode startActionMode(ActionMode.Callback callback) { try { - if (skipActionMode()) - return null; return super.startActionMode(callback); } catch (Throwable ex) { Log.e(ex); @@ -289,8 +285,6 @@ public class FixedEditText extends AppCompatEditText { public ActionMode startActionMode(ActionMode.Callback callback, int type) { try { // callback class: android.widget.Editor$TextActionModeCallback - if (skipActionMode()) - return null; return super.startActionMode(callback, type); } catch (Throwable ex) { Log.e(ex); @@ -298,20 +292,6 @@ public class FixedEditText extends AppCompatEditText { } } - private boolean skipActionMode() { - try { - SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext()); - if (!prefs.contains("skip_action_mode")) { - if ("fuxi_eea".equals(Build.PRODUCT) && Build.VERSION.SDK_INT == Build.VERSION_CODES.TIRAMISU) - return true; - } - return prefs.getBoolean("skip_action_mode", false); - } catch (Throwable ex) { - Log.e(ex); - return false; - } - } - @NonNull @Override @RequiresApi(api = Build.VERSION_CODES.O) diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java b/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java index 9d9952d4b7..25a90e84ac 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java @@ -240,7 +240,6 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc private SwitchCompat swDupMsgId; private SwitchCompat swThreadByRef; private SwitchCompat swMdn; - private SwitchCompat swSkipActionMode; private EditText etKeywords; private SwitchCompat swTestIab; private Button btnImportProviders; @@ -303,8 +302,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc "max_backoff_power", "logarithmic_backoff", "exact_alarms", "native_dkim", "native_arc", "native_arc_whitelist", - "infra", "tld_flags", "dup_msgids", "thread_byref", "mdn", "skip_action_mode", - "global_keywords", "test_iab" + "infra", "tld_flags", "dup_msgids", "thread_byref", "mdn", "global_keywords", "test_iab" }; private final static String[] RESET_QUESTIONS = new String[]{ @@ -493,7 +491,6 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc swDupMsgId = view.findViewById(R.id.swDupMsgId); swThreadByRef = view.findViewById(R.id.swThreadByRef); swMdn = view.findViewById(R.id.swMdn); - swSkipActionMode = view.findViewById(R.id.swSkipActionMode); etKeywords = view.findViewById(R.id.etKeywords); swTestIab = view.findViewById(R.id.swTestIab); btnImportProviders = view.findViewById(R.id.btnImportProviders); @@ -1860,13 +1857,6 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc } }); - swSkipActionMode.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { - @Override - public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { - prefs.edit().putBoolean("skip_action_mode", checked).apply(); - } - }); - etKeywords.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { @@ -2613,7 +2603,6 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc swDupMsgId.setChecked(prefs.getBoolean("dup_msgids", false)); swThreadByRef.setChecked(prefs.getBoolean("thread_byref", true)); swMdn.setChecked(prefs.getBoolean("mdn", swExperiments.isChecked())); - swSkipActionMode.setChecked(prefs.getBoolean("skip_action_mode", false)); etKeywords.setText(prefs.getString("global_keywords", null)); swTestIab.setChecked(prefs.getBoolean("test_iab", false)); diff --git a/app/src/main/res/layout/fragment_options_misc.xml b/app/src/main/res/layout/fragment_options_misc.xml index f8408095fe..8a4a4e446f 100644 --- a/app/src/main/res/layout/fragment_options_misc.xml +++ b/app/src/main/res/layout/fragment_options_misc.xml @@ -2283,17 +2283,6 @@ app:layout_constraintTop_toBottomOf="@id/swThreadByRef" app:switchPadding="12dp" /> - - + app:layout_constraintTop_toBottomOf="@id/swMdn" /> Duplicates by message ID Thread by common reference Process MDNs - Skip action mode Global keywords Test IAB Import providers