Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7116f049 authored by Jeff DeCew's avatar Jeff DeCew Committed by Android (Google) Code Review
Browse files

Merge "Fix NPE in obtainThemeColor due to use of Mocks" into sc-dev

parents 24acd372 6ec69186
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -6562,7 +6562,7 @@ public class Notification implements Parcelable
            theme = new ContextThemeWrapper(mContext, R.style.Theme_DeviceDefault_DayNight)
                    .getTheme();
            try (TypedArray ta = theme.obtainStyledAttributes(new int[]{attrRes})) {
                return ta.getColor(0, defaultColor);
                return ta == null ? defaultColor : ta.getColor(0, defaultColor);
            }
        }

@@ -9060,10 +9060,8 @@ public class Notification implements Parcelable
            container.setDrawableTint(buttonId, false, tintColor,
                    PorterDuff.Mode.SRC_ATOP);

            final TypedArray typedArray = mBuilder.mContext.obtainStyledAttributes(
                    new int[]{ android.R.attr.colorControlHighlight });
            int rippleAlpha = Color.alpha(typedArray.getColor(0, 0));
            typedArray.recycle();
            int rippleAlpha = Color.alpha(mBuilder.obtainThemeColor(
                    android.R.attr.colorControlHighlight, COLOR_DEFAULT));
            int rippleColor = Color.argb(rippleAlpha, Color.red(tintColor), Color.green(tintColor),
                    Color.blue(tintColor));
            container.setRippleDrawableColor(buttonId, ColorStateList.valueOf(rippleColor));