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代码分析,及Terminal使用
- Android应用程序绑定服务(bindService)的过程源代码分析(2)
- [导入]Android代码优化
- android APP隐私政策弹框的实现代码实例
- android手机打电话代码分析
- 如何编写高效的android代码(1)
- Android 上层界面到内核代码的完整的流程分析,以alarm为例子
- Flex与Android共享Amfphp SERVICES下自己的代码