Gitsaibot / AF-Weather-Widget

Graph weather widget for Android
53 stars 13 forks source link

Temporary PNG files not deleted #9

Closed tw-hx closed 3 years ago

tw-hx commented 3 years ago

Hi, great widget. FYI, in /data/data/net.gitsaibot.af/files/ there's a large number of temporary files, two new PNG files generated every hour or two, which are never deleted. I've been running it a bit over a month and it's taking up 123mb.

The cause appears to be in app/src/main/java/net/gitsaibot/af/AixUtils.java: String fileName = context.getString(R.string.bufferImageFileName, appWidgetId, time, orientation); which generates a temporary filename beginning with "af".

However in app/src/main/java/net/gitsaibot/af/AixUtils.java: deleteCacheFiles and deleteTemporaryFiles both check for: if (fileName.startsWith("aix"))

Thanks if you can line these up so that the same prefix is used! Or not even written to disk, maybe?

Gitsaibot commented 3 years ago

Good catch and detailed bug report. Thanks!

Or not even written to disk, maybe?

Not sure if this is easily possible. Also, the question is whether indirect or direct loading into the remote view is better ?