summaryrefslogtreecommitdiffstats
path: root/iconloaderlib
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2018-11-29 12:13:47 -0800
committerSunny Goyal <sunnygoyal@google.com>2018-11-30 01:41:56 -0800
commitb891eebbb54a7bc9ccd38c096b7cf249da519b60 (patch)
treeba09547cfbc53a02a40f813aa8876544d1ab39fb /iconloaderlib
parent6478d4f41bb5055116b97b55ba7ce08bd18fcd97 (diff)
downloadandroid_packages_apps_Trebuchet-b891eebbb54a7bc9ccd38c096b7cf249da519b60.tar.gz
android_packages_apps_Trebuchet-b891eebbb54a7bc9ccd38c096b7cf249da519b60.tar.bz2
android_packages_apps_Trebuchet-b891eebbb54a7bc9ccd38c096b7cf249da519b60.zip
Fixing shortcut icons are not getting correct color extraction.
> Avoiding color extraction for icons which have already be evaluated > Fixing color extraction from hardware bitmaps Bug: 111343544 Change-Id: I624866e892465684871fbc130003e32945d86460
Diffstat (limited to 'iconloaderlib')
-rw-r--r--iconloaderlib/src/com/android/launcher3/icons/BaseIconFactory.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/iconloaderlib/src/com/android/launcher3/icons/BaseIconFactory.java b/iconloaderlib/src/com/android/launcher3/icons/BaseIconFactory.java
index a3185741c..882af5911 100644
--- a/iconloaderlib/src/com/android/launcher3/icons/BaseIconFactory.java
+++ b/iconloaderlib/src/com/android/launcher3/icons/BaseIconFactory.java
@@ -101,11 +101,11 @@ public class BaseIconFactory implements AutoCloseable {
}
public BitmapInfo createIconBitmap(Bitmap icon) {
- if (mIconBitmapSize == icon.getWidth() && mIconBitmapSize == icon.getHeight()) {
- return BitmapInfo.fromBitmap(icon);
+ if (mIconBitmapSize != icon.getWidth() || mIconBitmapSize != icon.getHeight()) {
+ icon = createIconBitmap(new BitmapDrawable(mContext.getResources(), icon), 1f);
}
- return BitmapInfo.fromBitmap(
- createIconBitmap(new BitmapDrawable(mContext.getResources(), icon), 1f));
+
+ return BitmapInfo.fromBitmap(icon, mDisableColorExtractor ? null : mColorExtractor);
}
public BitmapInfo createBadgedIconBitmap(Drawable icon, UserHandle user,