Merge "Retain expanded state across more than one violent update." into jb-dev
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
index 4f485a2..ec99513 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
@@ -913,6 +913,7 @@
             if (wasExpanded) {
                 final NotificationData.Entry newEntry = mNotificationData.findByKey(key);
                 expandView(newEntry, true);
+                newEntry.setUserExpanded(true);
             }
         }
 
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java
index 1a07ed3..dfd8cf8 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java
@@ -65,6 +65,12 @@
         public boolean userExpanded() {
             return NotificationData.getUserExpanded(row);
         }
+        /**
+         * Set the flag indicating that this was manually expanded by the user.
+         */
+        public boolean setUserExpanded(boolean userExpanded) {
+            return NotificationData.setUserExpanded(row, userExpanded);
+        }
     }
     private final ArrayList<Entry> mEntries = new ArrayList<Entry>();
     private final Comparator<Entry> mEntryCmp = new Comparator<Entry>() {