summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Viverette <alanv@google.com>2015-01-05 21:39:12 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-01-05 21:39:13 +0000
commit748902420d26b2868296303be7df89d0c25b7f2b (patch)
tree4008171c5a66098c26dec9f91fd19e91a3fd80b9
parentee2e13e75356fbef806dfb69ccf995d7f616f027 (diff)
parent5c2d8f7d51d5a944459ddc61034854c6cef7a639 (diff)
downloadframeworks_base-748902420d26b2868296303be7df89d0c25b7f2b.zip
frameworks_base-748902420d26b2868296303be7df89d0c25b7f2b.tar.gz
frameworks_base-748902420d26b2868296303be7df89d0c25b7f2b.tar.bz2
Merge "Don't override dialog icon drawable unless valid resource ID was set" into lmp-mr1-dev
-rw-r--r--core/java/android/app/AlertDialog.java8
-rw-r--r--core/java/com/android/internal/app/AlertController.java4
2 files changed, 9 insertions, 3 deletions
diff --git a/core/java/android/app/AlertDialog.java b/core/java/android/app/AlertDialog.java
index 4ce7835..3c6458f 100644
--- a/core/java/android/app/AlertDialog.java
+++ b/core/java/android/app/AlertDialog.java
@@ -466,6 +466,8 @@ public class AlertDialog extends Dialog implements DialogInterface {
/**
* Set the resource id of the {@link Drawable} to be used in the title.
+ * <p>
+ * Takes precedence over values set using {@link #setIcon(Drawable)}.
*
* @return This Builder object to allow for chaining of calls to set methods
*/
@@ -485,7 +487,11 @@ public class AlertDialog extends Dialog implements DialogInterface {
}
/**
- * Set an icon as supplied by a theme attribute. e.g. android.R.attr.alertDialogIcon
+ * Set an icon as supplied by a theme attribute. e.g.
+ * {@link android.R.attr#alertDialogIcon}.
+ * <p>
+ * Takes precedence over values set using {@link #setIcon(int)} or
+ * {@link #setIcon(Drawable)}.
*
* @param attrId ID of a theme attribute that points to a drawable resource.
*/
diff --git a/core/java/com/android/internal/app/AlertController.java b/core/java/com/android/internal/app/AlertController.java
index 35e03c3..20d209f 100644
--- a/core/java/com/android/internal/app/AlertController.java
+++ b/core/java/com/android/internal/app/AlertController.java
@@ -955,10 +955,10 @@ public class AlertController {
if (mIcon != null) {
dialog.setIcon(mIcon);
}
- if (mIconId >= 0) {
+ if (mIconId != 0) {
dialog.setIcon(mIconId);
}
- if (mIconAttrId > 0) {
+ if (mIconAttrId != 0) {
dialog.setIcon(dialog.getIconAttributeResId(mIconAttrId));
}
}