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

Commit 6ec69186 authored by Jeff DeCew's avatar Jeff DeCew
Browse files

Fix NPE in obtainThemeColor due to use of Mocks

Fixes: 184358158
Test: atest DisconnectedCallNotifierTest
Change-Id: Ia561e262e288d71b93cc18e842eefcba054a32d8
parent dde686f7
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));