summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/java/android/app/Notification.java8
1 files changed, 3 insertions, 5 deletions
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java
index 4e140a8d3f45..d64e1f98517e 100644
--- a/core/java/android/app/Notification.java
+++ b/core/java/android/app/Notification.java
@@ -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));