summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoe Onorato <joeo@google.com>2011-01-12 17:07:11 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-01-12 17:07:11 -0800
commitf4699efb635dc7695e346343e9b9024ed225a612 (patch)
tree99f0ad7d0d7ad9e9699bdf3483dd4e5e8cf40844
parent0123afbb228c2849f481b5219ce82c070562b04a (diff)
parentc9596d6d8e9154b5f87c8e887bfabf7546b68af5 (diff)
downloadframeworks_base-f4699efb635dc7695e346343e9b9024ed225a612.zip
frameworks_base-f4699efb635dc7695e346343e9b9024ed225a612.tar.gz
frameworks_base-f4699efb635dc7695e346343e9b9024ed225a612.tar.bz2
Merge "Possibly fix bad notification updates." into honeycomb
-rw-r--r--core/java/android/app/Notification.java10
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java10
-rw-r--r--tests/StatusBar/res/layout/notification_builder_test.xml2
3 files changed, 15 insertions, 7 deletions
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java
index 7b7cb37..0243b02 100644
--- a/core/java/android/app/Notification.java
+++ b/core/java/android/app/Notification.java
@@ -574,7 +574,15 @@ public class Notification implements Parcelable
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
- sb.append("Notification(vibrate=");
+ sb.append("Notification(contentView=");
+ if (contentView != null) {
+ sb.append(contentView.getPackage());
+ sb.append("/0x");
+ sb.append(Integer.toHexString(contentView.getLayoutId()));
+ } else {
+ sb.append("null");
+ }
+ sb.append(" vibrate=");
if (this.vibrate != null) {
int N = this.vibrate.length-1;
sb.append("[");
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
index f858f61..dc1dbe2 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
@@ -598,18 +598,18 @@ public class TabletStatusBar extends StatusBar implements
// Can we just reapply the RemoteViews in place? If when didn't change, the order
// didn't change.
- boolean orderUnchanged = (notification.notification.when == oldNotification.notification.when
- && notification.isOngoing() == oldNotification.isOngoing()
+ boolean contentsUnchanged = notification.isOngoing() == oldNotification.isOngoing()
&& oldEntry.expanded != null
&& contentView != null
&& oldContentView != null
&& contentView.getPackage() != null
&& oldContentView.getPackage() != null
&& oldContentView.getPackage().equals(contentView.getPackage())
- && oldContentView.getLayoutId() == contentView.getLayoutId());
+ && oldContentView.getLayoutId() == contentView.getLayoutId();
ViewGroup rowParent = (ViewGroup) oldEntry.row.getParent();
- boolean isLastAnyway = rowParent.indexOfChild(oldEntry.row) == rowParent.getChildCount() - 1;
- if (orderUnchanged || isLastAnyway) {
+ boolean orderUnchanged = notification.notification.when==oldNotification.notification.when;
+ boolean isLastAnyway = rowParent.indexOfChild(oldEntry.row) == rowParent.getChildCount()-1;
+ if (contentsUnchanged && (orderUnchanged || isLastAnyway)) {
if (DEBUG) Slog.d(TAG, "reusing notification for key: " + key);
oldEntry.notification = notification;
try {
diff --git a/tests/StatusBar/res/layout/notification_builder_test.xml b/tests/StatusBar/res/layout/notification_builder_test.xml
index 58c4fbb..1b27e97 100644
--- a/tests/StatusBar/res/layout/notification_builder_test.xml
+++ b/tests/StatusBar/res/layout/notification_builder_test.xml
@@ -322,7 +322,7 @@
<RadioButton
android:id="@+id/title_short"
style="@style/FieldContents"
- android:text="cwshort"
+ android:text="short"
android:tag="Title"
/>
<RadioButton