Revert "Revert "Revert "Revert "Revert "cache shourtcut image"""""
This reverts commit 28dc8de660.
Reason for revert: the code change introduces significant delay when saving deep shortcut icons in cache.
Change-Id: I5d67ac0c4c867a40e882b7a46be446f8f7f63ac7
This commit is contained in:
@@ -17,7 +17,6 @@ package com.android.launcher3.icons.cache;
|
||||
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.os.LocaleList;
|
||||
import android.os.UserHandle;
|
||||
|
||||
@@ -43,13 +42,6 @@ public interface CachingLogic<T> {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the timestamp the entry was last updated in cache.
|
||||
*/
|
||||
default long getLastUpdatedTime(T object, PackageInfo info) {
|
||||
return info.lastUpdateTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true the object should be added to mem cache; otherwise returns false.
|
||||
*/
|
||||
|
||||
+2
-2
@@ -171,8 +171,7 @@ public class IconCacheUpdateHandler {
|
||||
long updateTime = c.getLong(indexLastUpdate);
|
||||
int version = c.getInt(indexVersion);
|
||||
T app = componentMap.remove(component);
|
||||
if (version == info.versionCode
|
||||
&& updateTime == cachingLogic.getLastUpdatedTime(app, info)
|
||||
if (version == info.versionCode && updateTime == info.lastUpdateTime
|
||||
&& TextUtils.equals(c.getString(systemStateIndex),
|
||||
mIconCache.getIconSystemState(info.packageName))) {
|
||||
|
||||
@@ -232,6 +231,7 @@ 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
|
||||
|
||||
Reference in New Issue
Block a user