summaryrefslogtreecommitdiffstats
path: root/iconloaderlib
diff options
context:
space:
mode:
authorPinyao Ting <pinyaoting@google.com>2019-10-01 16:35:17 +0000
committerPinyao Ting <pinyaoting@google.com>2019-10-01 09:44:11 -0700
commit52908c9adc3a27ffb90b398fa4bc97d71e9af184 (patch)
treeec9177e727de6bc6b506e2fb5eefbf18a28aa573 /iconloaderlib
parent4c420047cf268f20daf245be53f16f54b518f246 (diff)
downloadandroid_packages_apps_Trebuchet-52908c9adc3a27ffb90b398fa4bc97d71e9af184.tar.gz
android_packages_apps_Trebuchet-52908c9adc3a27ffb90b398fa4bc97d71e9af184.tar.bz2
android_packages_apps_Trebuchet-52908c9adc3a27ffb90b398fa4bc97d71e9af184.zip
Revert "Revert "Revert "cache shourtcut image"""
This reverts commit d13f0c5c45550bffc335f47f1a0c545df68c0584. Reason for revert: app crashes when adding widgets automatically b/141568904 Change-Id: I5b97f440716c93b1bd93c899e3e1d40e8bbd2885
Diffstat (limited to 'iconloaderlib')
-rw-r--r--iconloaderlib/src/com/android/launcher3/icons/cache/CachingLogic.java8
-rw-r--r--iconloaderlib/src/com/android/launcher3/icons/cache/IconCacheUpdateHandler.java4
2 files changed, 2 insertions, 10 deletions
diff --git a/iconloaderlib/src/com/android/launcher3/icons/cache/CachingLogic.java b/iconloaderlib/src/com/android/launcher3/icons/cache/CachingLogic.java
index 3aa783a14..e40a9c2c9 100644
--- a/iconloaderlib/src/com/android/launcher3/icons/cache/CachingLogic.java
+++ b/iconloaderlib/src/com/android/launcher3/icons/cache/CachingLogic.java
@@ -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;
@@ -44,13 +43,6 @@ public interface CachingLogic<T> {
}
/**
- * 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.
*/
default boolean addToMemCache() {
diff --git a/iconloaderlib/src/com/android/launcher3/icons/cache/IconCacheUpdateHandler.java b/iconloaderlib/src/com/android/launcher3/icons/cache/IconCacheUpdateHandler.java
index bcdbce5e2..8224966d8 100644
--- a/iconloaderlib/src/com/android/launcher3/icons/cache/IconCacheUpdateHandler.java
+++ b/iconloaderlib/src/com/android/launcher3/icons/cache/IconCacheUpdateHandler.java
@@ -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