diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java index 0c470692bf6f4..6d3aa981b5d3a 100644 --- a/core/java/android/app/Notification.java +++ b/core/java/android/app/Notification.java @@ -907,6 +907,8 @@ public class Notification implements Parcelable * */ public static class Builder { + private static final int MAX_ACTION_BUTTONS = 2; + private Context mContext; private long mWhen; @@ -938,7 +940,7 @@ public class Notification implements Parcelable private ArrayList mKindList = new ArrayList(1); private Bundle mExtras; private int mPriority; - private ArrayList mActions = new ArrayList(3); + private ArrayList mActions = new ArrayList(MAX_ACTION_BUTTONS); private boolean mUseChronometer; private Style mStyle; @@ -1460,7 +1462,7 @@ public class Notification implements Parcelable if (N > 0) { // Log.d("Notification", "has actions: " + mContentText); big.setViewVisibility(R.id.actions, View.VISIBLE); - if (N>3) N=3; + if (N>MAX_ACTION_BUTTONS) N=MAX_ACTION_BUTTONS; big.removeAllViews(R.id.actions); for (int i=0; i + + + + + diff --git a/core/res/res/layout/notification_action_tombstone.xml b/core/res/res/layout/notification_action_tombstone.xml index e61e15f142828..6c59ded86d52f 100644 --- a/core/res/res/layout/notification_action_tombstone.xml +++ b/core/res/res/layout/notification_action_tombstone.xml @@ -15,12 +15,16 @@ -->