summaryrefslogtreecommitdiff
path: root/core/java/android/widget/TextView.java
diff options
context:
space:
mode:
authorAlan Viverette <alanv@google.com>2014-09-16 15:41:27 -0700
committerAlan Viverette <alanv@google.com>2014-09-16 15:41:27 -0700
commitfe16787bd4887627937480bb1ead8e4e93110160 (patch)
tree466510dd7b926561da2a050781cdfa3f57606d7a /core/java/android/widget/TextView.java
parent47e3124da0ba09d8b5ea2c6273010cb2312897bd (diff)
Preserve NPE behavior of removed TextView.getTextColors() API
BUG: 17511449 Change-Id: Iea7e9aed69c21b230e3c474d4c1378a8663cfcb1
Diffstat (limited to 'core/java/android/widget/TextView.java')
-rw-r--r--core/java/android/widget/TextView.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index 1509e80e3dd7..a80d70af5251 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -8182,6 +8182,11 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
* @removed
*/
public static ColorStateList getTextColors(Context context, TypedArray attrs) {
+ if (attrs == null) {
+ // Preserve behavior prior to removal of this API.
+ throw new NullPointerException();
+ }
+
// It's not safe to use this method from apps. The parameter 'attrs'
// must have been obtained using the TextView filter array which is not
// available to the SDK. As such, we grab a default TypedArray with the