MCPcopy Create free account
hub / github.com/M66B/FairEmail / cleanup

Method cleanup

app/src/main/java/eu/faircode/email/ContactInfo.java:178–192  ·  view source on GitHub ↗
(Context context)

Source from the content-addressed store, hash-verified

176 }
177
178 static void cleanup(Context context) {
179 long now = new Date().getTime();
180
181 // Favicons
182 Log.i("Cleanup avatars");
183 for (String type : new String[]{"notcontact", "favicons", "generated"}) {
184 File[] favicons = Helper.ensureExists(context, type).listFiles();
185 if (favicons != null)
186 for (File file : favicons)
187 if (file.lastModified() + CACHE_FAVICON_DURATION < now) {
188 Log.i("Deleting " + file);
189 Helper.secureDelete(file);
190 }
191 }
192 }
193
194 static void clearCache(Context context) {
195 clearCache(context, true);

Callers 1

cleanupMethod · 0.95

Calls 4

iMethod · 0.95
ensureExistsMethod · 0.95
secureDeleteMethod · 0.95
listFilesMethod · 0.80

Tested by

no test coverage detected