Log app context

This commit is contained in:
M66B 2022-05-24 09:43:35 +02:00
parent 2aa6c3d906
commit a2c088cded
1 changed files with 4 additions and 2 deletions

View File

@ -129,6 +129,7 @@ public class EntityLog {
entry.data = data;
final DB db = DB.getInstance(context);
final Context acontext = context.getApplicationContext();
executor.submit(new Runnable() {
@Override
@ -164,17 +165,18 @@ public class EntityLog {
long now = new Date().getTime();
if (last_cleanup == null || last_cleanup + LOG_CLEANUP_INTERVAL < now) {
last_cleanup = now;
cleanup(context, now - LOG_KEEP_DURATION);
cleanup(acontext, now - LOG_KEEP_DURATION);
}
}
});
}
static void clear(final Context context) {
final Context acontext = context.getApplicationContext();
executor.submit(new Runnable() {
@Override
public void run() {
cleanup(context, new Date().getTime());
cleanup(acontext, new Date().getTime());
}
});
}