diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2018-09-24 10:51:52 -0700 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2018-09-25 16:36:06 -0700 |
commit | 0b3053c9fcd93680efb05b51726b145d2609c0b3 (patch) | |
tree | 96dc08b3a182d6f9a7688b7d4f669b02ee19c50b /tests/src | |
parent | d65f5f7f1a692b03bee09a15f4e0c865ed97fa61 (diff) | |
download | android_packages_apps_Trebuchet-0b3053c9fcd93680efb05b51726b145d2609c0b3.tar.gz android_packages_apps_Trebuchet-0b3053c9fcd93680efb05b51726b145d2609c0b3.tar.bz2 android_packages_apps_Trebuchet-0b3053c9fcd93680efb05b51726b145d2609c0b3.zip |
Extracting icon caching logic into a base class.
This will allow using the cache cache for other type of objects,
like shortcuts and widgets.
Change-Id: I38616d031cb051f93e724d9cc0e8fe9a822b9e3a
Diffstat (limited to 'tests/src')
-rw-r--r-- | tests/src/com/android/launcher3/model/BaseModelUpdateTaskTestCase.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/src/com/android/launcher3/model/BaseModelUpdateTaskTestCase.java b/tests/src/com/android/launcher3/model/BaseModelUpdateTaskTestCase.java index 59b2da036..f4aa15a72 100644 --- a/tests/src/com/android/launcher3/model/BaseModelUpdateTaskTestCase.java +++ b/tests/src/com/android/launcher3/model/BaseModelUpdateTaskTestCase.java @@ -11,7 +11,6 @@ import android.content.ContentResolver; import android.content.Context; import android.content.ContextWrapper; import android.content.Intent; -import android.content.pm.LauncherActivityInfo; import android.content.res.Resources; import android.graphics.Bitmap; import android.graphics.Bitmap.Config; @@ -24,6 +23,7 @@ import androidx.test.rule.provider.ProviderTestRule; import com.android.launcher3.AllAppsList; import com.android.launcher3.AppFilter; import com.android.launcher3.AppInfo; +import com.android.launcher3.icons.CachingLogic; import com.android.launcher3.icons.IconCache; import com.android.launcher3.InvariantDeviceProfile; import com.android.launcher3.ItemInfo; @@ -203,9 +203,10 @@ public class BaseModelUpdateTaskTestCase { } @Override - protected CacheEntry cacheLocked( + protected <T> CacheEntry cacheLocked( @NonNull ComponentName componentName, - @NonNull Provider<LauncherActivityInfo> infoProvider, + @NonNull Provider<T> infoProvider, + @NonNull CachingLogic<T> cachingLogic, UserHandle user, boolean usePackageIcon, boolean useLowResIcon) { CacheEntry entry = mCache.get(new ComponentKey(componentName, user)); if (entry == null) { |