众乐乐:
frameworks/base/core/java/android/app/Notification.java
private void processSmallIconColor(Icon smallIcon, RemoteViews contentView, StandardTemplateParams p) { boolean colorable = !isLegacy() || getColorUtil().isGrayscaleIcon(mContext, smallIcon); try { //Log.d("dbg@noti", "app info2: " + mContext.getPackageName().toString()); if (mContext != null && mContext.getPackageName() != null && "android".equals(mContext.getPackageName())) { //... } else { colorable = false; } } catch (Exception e) { //... } int color = getSmallIconColor(p); contentView.setInt(R.id.icon, "setBackgroundColor", getBackgroundColor(p));
frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconAreaController.java
boolean isPreL = Boolean.TRUE.equals(v.getTag(R.id.icon_is_pre_L)); int color = StatusBarIconView.NO_COLOR; boolean colorize = !isPreL || NotificationUtils.isGrayscale(v, mContrastColorUtil); try { String str = v.toString(); //android.util.Log.d("dbg@noti", "str = " + str); if (str != null && str.contains("pkg=android")) { } else { colorize = false; } } catch (Exception e) { //... } if (colorize) { color = DarkIconDispatcher.getTint(mTintArea, v, tint); }