From 2f91e94b720d579f8ca12d4f3193cfa7a999f99f Mon Sep 17 00:00:00 2001 From: wangqi Date: Thu, 14 Dec 2017 11:16:32 -0800 Subject: Recycle TypedArray for AutoResizeTextView. Bug: 70625240 Test: none PiperOrigin-RevId: 179069025 Change-Id: Iaabbe55fdbedd8ae901c6b9cf0c67be1adb31eb4 --- java/com/android/incallui/autoresizetext/AutoResizeTextView.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/java/com/android/incallui/autoresizetext/AutoResizeTextView.java b/java/com/android/incallui/autoresizetext/AutoResizeTextView.java index 2789ceac2..487283a6b 100644 --- a/java/com/android/incallui/autoresizetext/AutoResizeTextView.java +++ b/java/com/android/incallui/autoresizetext/AutoResizeTextView.java @@ -21,6 +21,7 @@ import android.content.res.TypedArray; import android.graphics.RectF; import android.os.Build.VERSION; import android.os.Build.VERSION_CODES; +import android.support.annotation.Nullable; import android.text.Layout.Alignment; import android.text.StaticLayout; import android.text.TextPaint; @@ -29,7 +30,6 @@ import android.util.DisplayMetrics; import android.util.SparseIntArray; import android.util.TypedValue; import android.widget.TextView; -import javax.annotation.Nullable; /** * A TextView that automatically scales its text to completely fill its allotted width. @@ -82,6 +82,7 @@ public class AutoResizeTextView extends TextView { TypedArray typedArray = context.getTheme().obtainStyledAttributes( attrs, R.styleable.AutoResizeTextView, defStyleAttr, defStyleRes); readAttrs(typedArray); + typedArray.recycle(); textPaint.set(getPaint()); } -- cgit v1.2.3