mirror of
https://github.com/kalarina-bit/Sparkledns.git
synced 2026-11-22 07:36:09 +00:00
Free decoded app icons once the UI is hidden
The VPN service keeps the process alive in the background, and with it up to 256 icon bitmaps from the Apps tab.
This commit is contained in:
@@ -24,6 +24,13 @@ class SparkleApp : Application() {
|
||||
}, "startup-load").start()
|
||||
}
|
||||
|
||||
// The VPN keeps the process running long after the screens are gone; decoded app icons
|
||||
// (up to about 9 MB) can be rendered again the next time the Apps tab opens
|
||||
override fun onTrimMemory(level: Int) {
|
||||
super.onTrimMemory(level)
|
||||
if (level >= TRIM_MEMORY_UI_HIDDEN) clearAppIconCache()
|
||||
}
|
||||
|
||||
// Debug builds only: logs disk and network access on the main thread, leaked closeables and the like
|
||||
private fun enableStrictMode() {
|
||||
StrictMode.setThreadPolicy(StrictMode.ThreadPolicy.Builder().detectAll().penaltyLog().build())
|
||||
|
||||
Reference in New Issue
Block a user