Android MTK Launcher3安装三方apk,应用图标自动添加白边

diff --git a/alps/packages/apps/Launcher3/src/com/android/launcher3/graphics/LauncherIcons.java b/alps/packages/apps/Launcher3/src/com/android/launcher3/graphics/LauncherIcons.java
--- a/alps/packages/apps/Launcher3/src/com/android/launcher3/graphics/LauncherIcons.java

+++ b/alps/packages/apps/Launcher3/src/com/android/launcher3/graphics/LauncherIcons.java

/**
     * Returns a bitmap suitable for the all apps view. The icon is badged for {@param user}.
     * The bitmap is also visually normalized with other icons.
     */
    public static Bitmap createBadgedIconBitmap(
            Drawable icon, UserHandle user, Context context, int iconAppTargetSdk) {

        IconNormalizer normalizer;
        float scale = 1f;
        if (!FeatureFlags.LAUNCHER3_DISABLE_ICON_NORMALIZATION) {
            normalizer = IconNormalizer.getInstance(context);
            /*if (Utilities.isAtLeastO() && iconAppTargetSdk >= Build.VERSION_CODES.O) {
                boolean[] outShape = new boolean[1];
                AdaptiveIconDrawable dr = (AdaptiveIconDrawable)
                        context.getDrawable(R.drawable.adaptive_icon_drawable_wrapper).mutate();
                dr.setBounds(0, 0, 1, 1);
                //scale = normalizer.getScale(icon, null, dr.getIconMask(), outShape); //chenyl del for ro.sf.lcd_density=224
                if (FeatureFlags.LEGACY_ICON_TREATMENT &&
                        !outShape[0]){
                    Drawable wrappedIcon = wrapToAdaptiveIconDrawable(context, icon, scale);
                    if (wrappedIcon != icon) {
                        icon = wrappedIcon;
                        //scale = normalizer.getScale(icon, null, null, null); //chenyl del for ro.sf.lcd_density=224
                    }
                }
            } else {
                //scale = normalizer.getScale(icon, null, null, null); //chenyl del for ro.sf.lcd_density=224
            }*/
        }
        Bitmap bitmap = createIconBitmap(icon, context, scale);
        if (FeatureFlags.ADAPTIVE_ICON_SHADOW && Utilities.isAtLeastO() &&
                icon instanceof AdaptiveIconDrawable) {
            bitmap = ShadowGenerator.getInstance(context).recreateIcon(bitmap);
        }
        return badgeIconForUser(bitmap, user, context);
    }

 

注释掉Utilities.isAtLeastO() && iconAppTargetSdk >= Build.VERSION_CODES.O 判断里的代码

你可能感兴趣的:(Android MTK Launcher3安装三方apk,应用图标自动添加白边)