Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
firefox-android
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
The Tor Project
Applications
firefox-android
Commits
4d646df9
Verified
Commit
4d646df9
authored
Jan 10, 2024
by
ma1
Browse files
Options
Downloads
Patches
Plain Diff
Bug 42191: Temporary StrictMode relaxation to clear the thumbnail cache.
parent
f6a83e7b
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!56
Bug 42363: Backport tab thumbnails enhancements
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
android-components/components/browser/thumbnails/src/main/java/mozilla/components/browser/thumbnails/utils/ThumbnailDiskCache.kt
+8
-4
8 additions, 4 deletions
...components/browser/thumbnails/utils/ThumbnailDiskCache.kt
with
8 additions
and
4 deletions
android-components/components/browser/thumbnails/src/main/java/mozilla/components/browser/thumbnails/utils/ThumbnailDiskCache.kt
+
8
−
4
View file @
4d646df9
...
...
@@ -7,6 +7,7 @@ package mozilla.components.browser.thumbnails.utils
import
android.content.Context
import
android.graphics.Bitmap
import
android.os.Build
import
android.os.StrictMode
import
androidx.annotation.VisibleForTesting
import
com.jakewharton.disklrucache.DiskLruCache
import
mozilla.components.concept.base.images.ImageLoadRequest
...
...
@@ -14,6 +15,7 @@ import mozilla.components.concept.base.images.ImageSaveRequest
import
mozilla.components.support.base.log.logger.Logger
import
java.io.File
import
java.io.IOException
import
mozilla.components.support.ktx.android.os.resetAfter
private
const
val
MAXIMUM_CACHE_THUMBNAIL_DATA_BYTES
:
Long
=
1024L
*
1024L
*
100L
// 100 MB
private
const
val
THUMBNAIL_DISK_CACHE_VERSION
=
1
...
...
@@ -34,11 +36,13 @@ class ThumbnailDiskCache(private val isPrivate: Boolean = false) {
internal
fun
clear
(
context
:
Context
)
{
synchronized
(
thumbnailCacheWriteLock
)
{
StrictMode
.
allowThreadDiskWrites
().
resetAfter
{
try
{
getThumbnailCache
(
context
).
delete
()
}
catch
(
e
:
IOException
)
{
logger
.
warn
(
"Thumbnail cache could not be cleared. Perhaps there are none?"
)
}
}
thumbnailCache
=
null
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment