Recycle obtained TypedArrays

Bug: 218835043
Test: make
Change-Id: I34f53b8767b34b77a8a8246e9d3863854477feb6
This commit is contained in:
Nikolas Havrikov
2022-02-10 14:52:37 +01:00
parent b0385bd966
commit 0a19db4500
2 changed files with 2 additions and 0 deletions

View File

@@ -209,6 +209,7 @@ class DatePickerCalendarDelegate extends DatePicker.AbstractDatePickerDelegate {
// Generate a non-activated color using the disabled alpha.
final TypedArray ta = mContext.obtainStyledAttributes(ATTRS_DISABLED_ALPHA);
final float disabledAlpha = ta.getFloat(0, 0.30f);
ta.recycle();
defaultColor = multiplyAlphaComponent(activatedColor, disabledAlpha);
}

View File

@@ -373,6 +373,7 @@ class TimePickerClockDelegate extends TimePicker.AbstractTimePickerDelegate {
// Generate a non-activated color using the disabled alpha.
final TypedArray ta = mContext.obtainStyledAttributes(ATTRS_DISABLED_ALPHA);
final float disabledAlpha = ta.getFloat(0, 0.30f);
ta.recycle();
defaultColor = multiplyAlphaComponent(activatedColor, disabledAlpha);
}