mirror of https://github.com/M66B/FairEmail.git
Was ignoring battery optimizations
This commit is contained in:
parent
15709d128f
commit
3b07e34c22
|
@ -5301,10 +5301,10 @@ public class FragmentMessages extends FragmentBase
|
|||
//boolean canSchedule = AlarmManagerCompatEx.canScheduleExactAlarms(context);
|
||||
boolean enabled = prefs.getBoolean("enabled", true);
|
||||
boolean reminder = prefs.getBoolean("setup_reminder", true);
|
||||
boolean targeting =
|
||||
(Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU);
|
||||
boolean was_ignoring = prefs.getBoolean("was_ignoring", false);
|
||||
boolean targeting = (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU);
|
||||
grpBatteryOptimizations.setVisibility(
|
||||
!isIgnoring && enabled && reminder && targeting ? View.VISIBLE : View.GONE);
|
||||
!isIgnoring && enabled && reminder && !was_ignoring && targeting ? View.VISIBLE : View.GONE);
|
||||
|
||||
boolean compact = prefs.getBoolean("compact", false);
|
||||
int zoom = prefs.getInt("view_zoom", compact ? 0 : 1);
|
||||
|
|
|
@ -304,7 +304,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
|||
"identities_asked", "identities_primary_hint",
|
||||
"raw_asked", "all_read_asked", "delete_asked",
|
||||
"cc_bcc", "inline_image_hint", "compose_reference", "send_dialog",
|
||||
"setup_reminder", "setup_advanced",
|
||||
"setup_reminder", "was_ignoring", "setup_advanced",
|
||||
"signature_images_hint",
|
||||
"gmail_checked",
|
||||
"eml_auto_confirm",
|
||||
|
|
|
@ -1017,6 +1017,11 @@ public class FragmentSetup extends FragmentBase implements SharedPreferences.OnS
|
|||
boolean isIgnoring = !Boolean.FALSE.equals(Helper.isIgnoringOptimizations(getContext()));
|
||||
boolean canScheduleExact = AlarmManagerCompatEx.canScheduleExactAlarms(getContext());
|
||||
|
||||
if (isIgnoring && !BuildConfig.DEBUG) {
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||
prefs.edit().putBoolean("was_ignoring", true).apply();
|
||||
}
|
||||
|
||||
tvDozeDone.setText(isIgnoring ? R.string.title_setup_done : R.string.title_setup_to_do);
|
||||
tvDozeDone.setTextColor(isIgnoring ? textColorPrimary : colorWarning);
|
||||
tvDozeDone.setCompoundDrawablesWithIntrinsicBounds(
|
||||
|
|
|
@ -1534,6 +1534,10 @@ public class Helper {
|
|||
return "Xiaomi".equalsIgnoreCase(Build.MANUFACTURER);
|
||||
}
|
||||
|
||||
static boolean isZte() {
|
||||
return "ZTE".equalsIgnoreCase(Build.MANUFACTURER);
|
||||
}
|
||||
|
||||
static boolean isRedmiNote() {
|
||||
// Manufacturer: Xiaomi
|
||||
// Model: Redmi Note 8 Pro
|
||||
|
|
Loading…
Reference in New Issue