mirror of https://github.com/M66B/FairEmail.git
Android 12: remind doze mode
This commit is contained in:
parent
6ba43cd0bb
commit
afa83fb6b4
|
@ -4026,10 +4026,6 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
||||||
grpOutbox.setVisibility(count == 0 ? View.GONE : View.VISIBLE);
|
grpOutbox.setVisibility(count == 0 ? View.GONE : View.VISIBLE);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!checkReporting())
|
|
||||||
if (!checkReview())
|
|
||||||
checkFingerprint();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -4060,6 +4056,11 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
||||||
// Restart spinner
|
// Restart spinner
|
||||||
swipeRefresh.resetRefreshing();
|
swipeRefresh.resetRefreshing();
|
||||||
|
|
||||||
|
if (!checkDoze())
|
||||||
|
if (!checkReporting())
|
||||||
|
if (!checkReview())
|
||||||
|
checkFingerprint();
|
||||||
|
|
||||||
prefs.registerOnSharedPreferenceChangeListener(this);
|
prefs.registerOnSharedPreferenceChangeListener(this);
|
||||||
onSharedPreferenceChanged(prefs, "pro");
|
onSharedPreferenceChanged(prefs, "pro");
|
||||||
|
|
||||||
|
@ -4143,6 +4144,31 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
private boolean checkDoze() {
|
||||||
|
if (viewType != AdapterMessage.ViewType.UNIFIED)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!Helper.isDozeRequired())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
final Context context = getContext();
|
||||||
|
Boolean isIgnoring = Helper.isIgnoringOptimizations(context);
|
||||||
|
if (isIgnoring == null || isIgnoring)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
final Snackbar snackbar = Snackbar.make(view, R.string.title_setup_doze, Snackbar.LENGTH_INDEFINITE)
|
||||||
|
.setGestureInsetBottomIgnored(true);
|
||||||
|
snackbar.setAction(R.string.title_fix, new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
startActivity(new Intent(context, ActivitySetup.class));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
snackbar.show();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
private boolean checkReporting() {
|
private boolean checkReporting() {
|
||||||
if (viewType != AdapterMessage.ViewType.UNIFIED)
|
if (viewType != AdapterMessage.ViewType.UNIFIED)
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue