aboutsummaryrefslogtreecommitdiff
path: root/common/src/com/android/tv/common/TvContentRatingCache.java
diff options
context:
space:
mode:
authorNick Chalko <nchalko@google.com>2017-05-09 14:07:44 -0700
committerNick Chalko <nchalko@google.com>2017-05-10 09:49:18 -0700
commit0550a7221be0581b0bd421a9d70400ff8699a6e7 (patch)
tree14d9836ff9283690321c166560ee3450792236ad /common/src/com/android/tv/common/TvContentRatingCache.java
parent430c2be3b91676005fdd243553e38acff8dfc3de (diff)
downloadTV-0550a7221be0581b0bd421a9d70400ff8699a6e7.tar.gz
hash 550cbec17259717c5453f6be1eb05736ba10ef1d Bug: 37849928 Test: tested on vendor branch Change-Id: I82190481d2bcef2b89e78414b6b92ed97720749d Merged-In: I4199ec04cacb4a78be58b85302a39d917658dc28
Diffstat (limited to 'common/src/com/android/tv/common/TvContentRatingCache.java')
-rw-r--r--common/src/com/android/tv/common/TvContentRatingCache.java5
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();
}