mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-31 06:08:31 +02:00
Android 12 foreground restrictions
This commit is contained in:
@@ -93,6 +93,7 @@ public class FragmentSetup extends FragmentBase {
|
||||
|
||||
private TextView tvDozeDone;
|
||||
private Button btnDoze;
|
||||
private TextView tvDoze12;
|
||||
|
||||
private Button btnInexactAlarms;
|
||||
private Button btnBackgroundRestricted;
|
||||
@@ -158,6 +159,7 @@ public class FragmentSetup extends FragmentBase {
|
||||
|
||||
tvDozeDone = view.findViewById(R.id.tvDozeDone);
|
||||
btnDoze = view.findViewById(R.id.btnDoze);
|
||||
tvDoze12 = view.findViewById(R.id.tvDoze12);
|
||||
|
||||
btnInexactAlarms = view.findViewById(R.id.btnInexactAlarms);
|
||||
btnBackgroundRestricted = view.findViewById(R.id.btnBackgroundRestricted);
|
||||
@@ -534,6 +536,7 @@ public class FragmentSetup extends FragmentBase {
|
||||
tvDozeDone.setText(null);
|
||||
tvDozeDone.setCompoundDrawables(null, null, null, null);
|
||||
btnDoze.setEnabled(false);
|
||||
tvDoze12.setVisibility(View.GONE);
|
||||
|
||||
btnInbox.setEnabled(false);
|
||||
|
||||
@@ -660,9 +663,10 @@ public class FragmentSetup extends FragmentBase {
|
||||
tvDozeDone.setTextColor(ignoring == null || ignoring ? textColorPrimary : colorWarning);
|
||||
tvDozeDone.setTypeface(null, ignoring == null || ignoring ? Typeface.NORMAL : Typeface.BOLD);
|
||||
tvDozeDone.setCompoundDrawablesWithIntrinsicBounds(ignoring == null || ignoring ? check : null, null, null, null);
|
||||
tvDoze12.setVisibility(Helper.isOptimizing12(getContext()) ? View.VISIBLE : View.GONE);
|
||||
|
||||
grpInexactAlarms.setVisibility(
|
||||
!AlarmManagerCompatEx.canScheduleExactAlarms(getContext())
|
||||
!AlarmManagerCompatEx.canScheduleExactAlarms(getContext()) || BuildConfig.DEBUG
|
||||
? View.VISIBLE : View.GONE);
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
||||
|
||||
Reference in New Issue
Block a user