Fix NPEs when using the APIs a little oddly.

This should help developers use some of the features of
Style via subclassing rather than duplicating functionality.

Bug: 6716608
Change-Id: I048e8221c8046e9779e08e6e262ac3fb37b01cb3
This commit is contained in:
Daniel Sandler
2012-06-28 08:35:24 -07:00
parent 4708d8f54b
commit c08dea2aa4

View File

@@ -1367,7 +1367,9 @@ public class Notification implements Parcelable
public Builder setStyle(Style style) {
if (mStyle != style) {
mStyle = style;
mStyle.setBuilder(this);
if (mStyle != null) {
mStyle.setBuilder(this);
}
}
return this;
}
@@ -1637,7 +1639,9 @@ public class Notification implements Parcelable
public void setBuilder(Builder builder) {
if (mBuilder != builder) {
mBuilder = builder;
mBuilder.setStyle(this);
if (mBuilder != null) {
mBuilder.setStyle(this);
}
}
}