Fix NPE of ApplicationsState
Check userId before getting the entry from mEntriesMap to avoid NPE, since the caller from RecentAppStatsMixin may query the entry for uncached userId. Bug: 275123723 Test: manual Change-Id: I369081ebf179c267fb9ecd1a359ba1ed4e308540
This commit is contained in:
@@ -483,7 +483,10 @@ public class ApplicationsState {
|
||||
public AppEntry getEntry(String packageName, int userId) {
|
||||
if (DEBUG_LOCKING) Log.v(TAG, "getEntry about to acquire lock...");
|
||||
synchronized (mEntriesMap) {
|
||||
AppEntry entry = mEntriesMap.get(userId).get(packageName);
|
||||
AppEntry entry = null;
|
||||
if (mEntriesMap.contains(userId)) {
|
||||
entry = mEntriesMap.get(userId).get(packageName);
|
||||
}
|
||||
if (entry == null) {
|
||||
ApplicationInfo info = getAppInfoLocked(packageName, userId);
|
||||
if (info == null) {
|
||||
|
||||
Reference in New Issue
Block a user