Merge "Fix DecoratedCustomViewStyle with 1-2 actions" into oc-support-26.0-dev
diff --git a/v7/appcompat/src/android/support/v7/app/NotificationCompat.java b/v7/appcompat/src/android/support/v7/app/NotificationCompat.java
index 0ec4c77..95b5edd 100644
--- a/v7/appcompat/src/android/support/v7/app/NotificationCompat.java
+++ b/v7/appcompat/src/android/support/v7/app/NotificationCompat.java
@@ -451,7 +451,7 @@
             remoteViews.removeAllViews(R.id.actions);
             boolean actionsVisible = false;
             if (showActions && mBuilder.mActions != null) {
-                int numActions = Math.max(mBuilder.mActions.size(), MAX_ACTION_BUTTONS);
+                int numActions = Math.min(mBuilder.mActions.size(), MAX_ACTION_BUTTONS);
                 if (numActions > 0) {
                     actionsVisible = true;
                     for (int i = 0; i < numActions; i++) {