Small improvement

This commit is contained in:
M66B
2020-03-26 08:40:26 +01:00
parent b0f52e8b47
commit da1f1d0648
3 changed files with 15 additions and 11 deletions

View File

@@ -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) {