Files
frameworks_base/packages/Keyguard/src/com/android/keyguard/MultiUserAvatarCache.java
Jorim Jaggi 5cf17879a3 Reuse KeyguardViewMediator for new Keyguard implementation.
This change reuses KeyguardViewMediator for the new Keyguard
implementation in status bar. KeyguardViewManager is replaced by
StatusBarKeyguardManager which handles adding the view, setting the
state etc. StatusBarWindowManager is introduced to managed the window
of the status bar, which has the logic of both the old Keyguard window
and the old status bar window. In the current implementation, Keyguard
gets displayed like it would be in the bouncer state, but that's likely
to change in the future. Also, setHidden in IKeyguardService is also
renamed to setOccluded, as the word hidden interferes with the
terminology when dismissing the Keyguard.

Bug: 13635952
Change-Id: I1c5d5a49d810d8532089f464cb2efe35e577f517
2014-03-31 20:58:31 +02:00

52 lines
1.4 KiB
Java

/*
* Copyright (C) 2013 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.keyguard;
import android.graphics.drawable.Drawable;
import java.util.HashMap;
public class MultiUserAvatarCache {
private static MultiUserAvatarCache sInstance;
private final HashMap<Integer, Drawable> mCache;
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);
}
public Drawable get(int userId) {
return mCache.get(userId);
}
public void put(int userId, Drawable image) {
mCache.put(userId, image);
}
}