diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index e90161bb90..8a57190987 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -399,6 +399,7 @@ diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java b/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java index 1c2fabdb30..39a06b3ca2 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java @@ -82,6 +82,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc private boolean resumed = false; private List> languages = new ArrayList<>(); + private SwitchCompat swPowerMenu; private SwitchCompat swExternalSearch; private SwitchCompat swShortcuts; private SwitchCompat swFts; @@ -188,6 +189,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc // Get controls + swPowerMenu = view.findViewById(R.id.swPowerMenu); swExternalSearch = view.findViewById(R.id.swExternalSearch); swShortcuts = view.findViewById(R.id.swShortcuts); swFts = view.findViewById(R.id.swFts); @@ -246,6 +248,13 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext()); + swPowerMenu.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { + Helper.enableComponent(getContext(), ServicePowerControl.class, checked); + } + }); + swExternalSearch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { @@ -787,6 +796,10 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc : R.color.lightColorBackground_cards)); } + swPowerMenu.setVisibility(!BuildConfig.PLAY_STORE_RELEASE && + Build.VERSION.SDK_INT >= Build.VERSION_CODES.R + ? View.VISIBLE : View.GONE); + tvFtsIndexed.setText(null); DB db = DB.getInstance(getContext()); @@ -920,6 +933,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc private void setOptions() { SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext()); + swPowerMenu.setChecked(Helper.isComponentEnabled(getContext(), ServicePowerControl.class)); swExternalSearch.setChecked(Helper.isComponentEnabled(getContext(), ActivitySearch.class)); swShortcuts.setChecked(prefs.getBoolean("shortcuts", true)); swFts.setChecked(prefs.getBoolean("fts", false)); diff --git a/app/src/main/res/layout/fragment_options_misc.xml b/app/src/main/res/layout/fragment_options_misc.xml index 844cca8015..0084ffb50b 100644 --- a/app/src/main/res/layout/fragment_options_misc.xml +++ b/app/src/main/res/layout/fragment_options_misc.xml @@ -62,16 +62,26 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> + + Max AES key size: %1$d + Add actions to the power menu Allow other apps to search in messages Show frequently used contacts in Android share menu Build search index