diff options
| author | Daniel Colascione <dancol@google.com> | 2020-04-28 15:31:42 -0700 |
|---|---|---|
| committer | Collin Fijalkovich <cfijalkovich@google.com> | 2020-05-13 11:15:14 -0700 |
| commit | 8c239da8d54bc2ac93fe666a7ca7825f0e82b923 (patch) | |
| tree | 7d4a8b48b46177d41dd1705db9f96da9a5ab25eb /core/java/android/app/ActivityThread.java | |
| parent | 1daf6ea6a39c1bd56a5792ab6cd8469aba0a441b (diff) | |
Maintain global list of caches; purge on low memory
Bug: 140788621
Test: m
Merged-In: I3ba88e0a6f6c0f26465903988e7432156bd5be20
Change-Id: I3ba88e0a6f6c0f26465903988e7432156bd5be20
(cherry picked from commit 22c2ddb201e52e54d82d2a8dba77c19d74e654ba)
Diffstat (limited to 'core/java/android/app/ActivityThread.java')
| -rw-r--r-- | core/java/android/app/ActivityThread.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java index eea1d69b6326..c6e2d5290d2e 100644 --- a/core/java/android/app/ActivityThread.java +++ b/core/java/android/app/ActivityThread.java @@ -6202,6 +6202,12 @@ public final class ActivityThread extends ClientTransactionHandler { Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "trimMemory"); if (DEBUG_MEMORY_TRIM) Slog.v(TAG, "Trimming memory to level: " + level); + if (level >= ComponentCallbacks2.TRIM_MEMORY_COMPLETE) { + for (PropertyInvalidatedCache pic : PropertyInvalidatedCache.getActiveCaches()) { + pic.clear(); + } + } + ArrayList<ComponentCallbacks2> callbacks = collectComponentCallbacks(true, null); final int N = callbacks.size(); |
