summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/com/android/launcher3/IconCache.java7
-rw-r--r--src/com/android/launcher3/icons/CustomIconsProvider.java5
2 files changed, 9 insertions, 3 deletions
diff --git a/src/com/android/launcher3/IconCache.java b/src/com/android/launcher3/IconCache.java
index cb58766bf..137265262 100644
--- a/src/com/android/launcher3/IconCache.java
+++ b/src/com/android/launcher3/IconCache.java
@@ -370,7 +370,7 @@ public class IconCache {
if (entry == null) {
entry = new CacheEntry();
entry.icon = LauncherIcons.createBadgedIconBitmap(getFullResIcon(app), app.getUser(),
- mContext, app.getApplicationInfo().targetSdkVersion);
+ mContext, Build.VERSION_CODES.O);
}
entry.title = app.getLabel();
entry.contentDescription = mUserManager.getBadgedLabelForUser(entry.title, app.getUser());
@@ -571,7 +571,7 @@ public class IconCache {
if (info != null) {
entry.icon = LauncherIcons.createBadgedIconBitmap(
getFullResIcon(info), info.getUser(), mContext,
- infoProvider.get().getApplicationInfo().targetSdkVersion);
+ Build.VERSION_CODES.O);
} else {
if (usePackageIcon) {
CacheEntry packageEntry = getEntryForPackageLocked(
@@ -677,7 +677,8 @@ public class IconCache {
// Load the full res icon for the application, but if useLowResIcon is set, then
// only keep the low resolution icon instead of the larger full-sized icon
Bitmap icon = LauncherIcons.createBadgedIconBitmap(
- appInfo.loadIcon(mPackageManager), user, mContext, appInfo.targetSdkVersion);
+ appInfo.loadIcon(mPackageManager), user, mContext,
+ Build.VERSION_CODES.O);
if (mInstantAppResolver.isInstantApp(appInfo)) {
icon = LauncherIcons.badgeWithDrawable(icon,
mContext.getDrawable(R.drawable.ic_instant_app_badge), mContext);
diff --git a/src/com/android/launcher3/icons/CustomIconsProvider.java b/src/com/android/launcher3/icons/CustomIconsProvider.java
index 1490fd9d7..98259b83d 100644
--- a/src/com/android/launcher3/icons/CustomIconsProvider.java
+++ b/src/com/android/launcher3/icons/CustomIconsProvider.java
@@ -38,6 +38,11 @@ public class CustomIconsProvider extends IconProvider {
@Override
public Drawable getIcon(LauncherActivityInfo info, int iconDpi, boolean flattenDrawable) {
+ // if we are not using any icon pack, load application icon directly
+ if (Utilities.ATLEAST_OREO && !Utilities.isUsingIconPack(mContext)) {
+ return mContext.getPackageManager().getApplicationIcon(info.getApplicationInfo());
+ }
+
final Bitmap bm = mHandler.getDrawableIconForPackage(info.getComponentName());
if (bm == null) {
return info.getIcon(iconDpi);