Merge "[BUG] fix NullPointerException in Notification.java" am: c14d5db093

am: 79e9f380e2

Change-Id: Ic9356edc395f68c5dda5a19a2efca31b5f16a068
This commit is contained in:
liangweikang
2017-03-17 14:57:55 +00:00
committed by android-build-merger

View File

@@ -1761,9 +1761,11 @@ public class Notification implements Parcelable
if (this.actions != null) { if (this.actions != null) {
that.actions = new Action[this.actions.length]; that.actions = new Action[this.actions.length];
for(int i=0; i<this.actions.length; i++) { for(int i=0; i<this.actions.length; i++) {
if ( this.actions[i] != null) {
that.actions[i] = this.actions[i].clone(); that.actions[i] = this.actions[i].clone();
} }
} }
}
if (heavy && this.bigContentView != null) { if (heavy && this.bigContentView != null) {
that.bigContentView = this.bigContentView.clone(); that.bigContentView = this.bigContentView.clone();
@@ -3108,7 +3110,9 @@ public class Notification implements Parcelable
* @param action The action to add. * @param action The action to add.
*/ */
public Builder addAction(Action action) { public Builder addAction(Action action) {
if (action != null) {
mActions.add(action); mActions.add(action);
}
return this; return this;
} }
@@ -3122,8 +3126,10 @@ public class Notification implements Parcelable
public Builder setActions(Action... actions) { public Builder setActions(Action... actions) {
mActions.clear(); mActions.clear();
for (int i = 0; i < actions.length; i++) { for (int i = 0; i < actions.length; i++) {
if (actions[i] != null) {
mActions.add(actions[i]); mActions.add(actions[i]);
} }
}
return this; return this;
} }