diff options
Diffstat (limited to 'common/src/com/android/tv/common/TvContentRatingCache.java')
-rw-r--r-- | common/src/com/android/tv/common/TvContentRatingCache.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/common/src/com/android/tv/common/TvContentRatingCache.java b/common/src/com/android/tv/common/TvContentRatingCache.java index 5694cda7..8b3c06f1 100644 --- a/common/src/com/android/tv/common/TvContentRatingCache.java +++ b/common/src/com/android/tv/common/TvContentRatingCache.java @@ -43,6 +43,7 @@ public final class TvContentRatingCache implements MemoryManageable { return INSTANCE; } + // @GuardedBy("TvContentRatingCache.this") private final Map<String, TvContentRating[]> mRatingsMultiMap = new ArrayMap<>(); /** @@ -51,7 +52,7 @@ public final class TvContentRatingCache implements MemoryManageable { * Returns {@code null} if the string is empty or contains no valid ratings. */ @Nullable - public TvContentRating[] getRatings(String commaSeparatedRatings) { + public synchronized TvContentRating[] getRatings(String commaSeparatedRatings) { if (TextUtils.isEmpty(commaSeparatedRatings)) { return null; } @@ -136,7 +137,7 @@ public final class TvContentRatingCache implements MemoryManageable { } @Override - public void performTrimMemory(int level) { + public synchronized void performTrimMemory(int level) { mRatingsMultiMap.clear(); } |