Revert "Revert "Revert "Revert "cache shourtcut image""""

This reverts commit 52908c9adc.

Reason for revert: roll-forward and fixes the crash due to access icon cache on main thread

Bug: 141568904
Change-Id: I1274db349c4f508d9cf59735b5f15180bb0ec033
This commit is contained in:
Pinyao Ting
2019-10-01 18:12:20 +00:00
parent 208f2018fb
commit 28dc8de660
6 changed files with 118 additions and 12 deletions
@@ -171,7 +171,8 @@ public class IconCacheUpdateHandler {
long updateTime = c.getLong(indexLastUpdate);
int version = c.getInt(indexVersion);
T app = componentMap.remove(component);
if (version == info.versionCode && updateTime == info.lastUpdateTime
if (version == info.versionCode
&& updateTime == cachingLogic.getLastUpdatedTime(app, info)
&& TextUtils.equals(c.getString(systemStateIndex),
mIconCache.getIconSystemState(info.packageName))) {
@@ -231,7 +232,6 @@ public class IconCacheUpdateHandler {
}
}
/**
* A runnable that updates invalid icons and adds missing icons in the DB for the provided
* LauncherActivityInfo list. Items are updated/added one at a time, so that the