Outlook warning one month in advance

pull/208/head
M66B 3 years ago
parent 7216e1cd57
commit d13f8f3e02

@ -4796,6 +4796,10 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
cal.set(Calendar.MONTH, Calendar.MAY); cal.set(Calendar.MONTH, Calendar.MAY);
cal.set(Calendar.YEAR, 2022); cal.set(Calendar.YEAR, 2022);
long now = new Date().getTime();
if (now < cal.getTimeInMillis() - 30 * 24 * 3600 * 1000L)
return false; // Not yet
if (Helper.getInstallTime(context) > cal.getTimeInMillis()) { if (Helper.getInstallTime(context) > cal.getTimeInMillis()) {
prefs.edit().putBoolean("gmail_checked", true).apply(); prefs.edit().putBoolean("gmail_checked", true).apply();
return false; return false;
@ -4803,7 +4807,6 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
cal.add(Calendar.MONTH, 2); cal.add(Calendar.MONTH, 2);
long now = new Date().getTime();
if (now > cal.getTimeInMillis()) { if (now > cal.getTimeInMillis()) {
prefs.edit().putBoolean("gmail_checked", true).apply(); prefs.edit().putBoolean("gmail_checked", true).apply();
return false; return false;
@ -4865,13 +4868,10 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
} }
private boolean checkOutlook() { private boolean checkOutlook() {
if (!BuildConfig.DEBUG)
return false;
final Context context = getContext(); final Context context = getContext();
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
if (prefs.getBoolean("outlook_checked", false)) //if (prefs.getBoolean("outlook_checked", false))
return false; // return false;
Calendar cal = Calendar.getInstance(); Calendar cal = Calendar.getInstance();
cal.set(Calendar.MILLISECOND, 0); cal.set(Calendar.MILLISECOND, 0);
@ -4882,6 +4882,10 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
cal.set(Calendar.MONTH, Calendar.OCTOBER); cal.set(Calendar.MONTH, Calendar.OCTOBER);
cal.set(Calendar.YEAR, 2022); cal.set(Calendar.YEAR, 2022);
long now = new Date().getTime();
if (now < cal.getTimeInMillis() - 30 * 24 * 3600 * 1000L)
return false; // Not yet
if (Helper.getInstallTime(context) > cal.getTimeInMillis()) { if (Helper.getInstallTime(context) > cal.getTimeInMillis()) {
prefs.edit().putBoolean("outlook_checked", true).apply(); prefs.edit().putBoolean("outlook_checked", true).apply();
return false; return false;
@ -4889,7 +4893,6 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
cal.add(Calendar.MONTH, 2); cal.add(Calendar.MONTH, 2);
long now = new Date().getTime();
if (now > cal.getTimeInMillis()) { if (now > cal.getTimeInMillis()) {
prefs.edit().putBoolean("outlook_checked", true).apply(); prefs.edit().putBoolean("outlook_checked", true).apply();
return false; return false;

@ -241,7 +241,8 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
"signature_images_hint", "signature_images_hint",
"gmail_checked", "gmail_checked",
"eml_auto_confirm", "eml_auto_confirm",
"open_with_pkg", "open_with_tabs" "open_with_pkg", "open_with_tabs",
"gmail_checked", "outlook_checked"
}; };
@Override @Override
@ -1621,11 +1622,6 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
editor.remove(key); editor.remove(key);
} }
if (BuildConfig.DEBUG) {
editor.remove("gmail_checked");
editor.remove("outlook_checked");
}
editor.apply(); editor.apply();
ToastEx.makeText(context, R.string.title_setup_done, Toast.LENGTH_LONG).show(); ToastEx.makeText(context, R.string.title_setup_done, Toast.LENGTH_LONG).show();

Loading…
Cancel
Save