mirror of https://github.com/M66B/FairEmail.git
Small improvement
This commit is contained in:
parent
b0f52e8b47
commit
da1f1d0648
|
@ -31,7 +31,6 @@ import android.content.Intent;
|
|||
import android.content.IntentFilter;
|
||||
import android.content.IntentSender;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Color;
|
||||
|
@ -3243,15 +3242,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|||
long now = new Date().getTime();
|
||||
long later = prefs.getLong("review_later", -1);
|
||||
if (later < 0) {
|
||||
long installed = 0;
|
||||
try {
|
||||
PackageInfo pi = pm.getPackageInfo(BuildConfig.APPLICATION_ID, 0);
|
||||
if (pi != null)
|
||||
installed = pi.firstInstallTime;
|
||||
} catch (Throwable ex) {
|
||||
Log.e(ex);
|
||||
}
|
||||
|
||||
long installed = Helper.getInstallTime(getContext());
|
||||
Log.i("Review installed=" + new Date(installed));
|
||||
|
||||
if (installed + REVIEW_ASK_DELAY > now)
|
||||
|
|
|
@ -546,6 +546,18 @@ public class Helper {
|
|||
return intent;
|
||||
}
|
||||
|
||||
static long getInstallTime(Context context) {
|
||||
try {
|
||||
PackageManager pm = context.getPackageManager();
|
||||
PackageInfo pi = pm.getPackageInfo(BuildConfig.APPLICATION_ID, 0);
|
||||
if (pi != null)
|
||||
return pi.firstInstallTime;
|
||||
} catch (Throwable ex) {
|
||||
Log.e(ex);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Graphics
|
||||
|
||||
static int dp2pixels(Context context, int dp) {
|
||||
|
|
|
@ -988,7 +988,8 @@ public class Log {
|
|||
|
||||
sb.append("\r\n");
|
||||
|
||||
sb.append(new Date().toString()).append("\r\n");
|
||||
sb.append(new Date(Helper.getInstallTime(context))).append("\r\n");
|
||||
sb.append(new Date()).append("\r\n");
|
||||
|
||||
sb.append("\r\n");
|
||||
|
||||
|
|
Loading…
Reference in New Issue