summaryrefslogtreecommitdiffstats
path: root/packages/Keyguard/src/com/android/keyguard/MultiUserAvatarCache.java
diff options
context:
space:
mode:
Diffstat (limited to 'packages/Keyguard/src/com/android/keyguard/MultiUserAvatarCache.java')
-rw-r--r--packages/Keyguard/src/com/android/keyguard/MultiUserAvatarCache.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/packages/Keyguard/src/com/android/keyguard/MultiUserAvatarCache.java b/packages/Keyguard/src/com/android/keyguard/MultiUserAvatarCache.java
index 9930e72..7128211 100644
--- a/packages/Keyguard/src/com/android/keyguard/MultiUserAvatarCache.java
+++ b/packages/Keyguard/src/com/android/keyguard/MultiUserAvatarCache.java
@@ -22,12 +22,21 @@ import java.util.HashMap;
public class MultiUserAvatarCache {
+ private static MultiUserAvatarCache sInstance;
+
private final HashMap<Integer, Drawable> mCache;
- public MultiUserAvatarCache() {
+ private MultiUserAvatarCache() {
mCache = new HashMap<Integer, Drawable>();
}
+ public static MultiUserAvatarCache getInstance() {
+ if (sInstance == null) {
+ sInstance = new MultiUserAvatarCache();
+ }
+ return sInstance;
+ }
+
public void clear(int userId) {
mCache.remove(userId);
}