diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java
index 7e8a5c19cf579..004174ee611ad 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java
@@ -19,6 +19,7 @@ package com.android.systemui.statusbar;
import android.app.Notification;
import android.os.IBinder;
import android.view.View;
+import android.widget.ImageView;
import com.android.internal.statusbar.StatusBarNotification;
@@ -36,6 +37,7 @@ public class NotificationData {
public View row; // the outer expanded view
public View content; // takes the click events and sends the PendingIntent
public View expanded; // the inflated RemoteViews
+ public ImageView largeIcon;
public Entry() {}
public Entry(IBinder key, StatusBarNotification n, StatusBarIconView ic) {
this.key = key;
@@ -88,6 +90,7 @@ public class NotificationData {
entry.content = content;
entry.expanded = expanded;
entry.icon = icon;
+ entry.largeIcon = null; // TODO add support for large icons
return add(entry);
}
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 af730fef300f1..d8e3053ff68fb 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
@@ -635,16 +635,15 @@ 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 contentsUnchanged = notification.isOngoing() == oldNotification.isOngoing()
- && oldEntry.expanded != null
- && contentView != null
- && oldContentView != null
+ boolean contentsUnchanged = oldEntry.expanded != null
+ && contentView != null && oldContentView != null
&& contentView.getPackage() != null
&& oldContentView.getPackage() != null
&& oldContentView.getPackage().equals(contentView.getPackage())
&& oldContentView.getLayoutId() == contentView.getLayoutId();
ViewGroup rowParent = (ViewGroup) oldEntry.row.getParent();
- boolean orderUnchanged = notification.notification.when==oldNotification.notification.when;
+ boolean orderUnchanged = notification.notification.when==oldNotification.notification.when
+ && notification.isOngoing() == oldNotification.isOngoing();
boolean isLastAnyway = rowParent.indexOfChild(oldEntry.row) == rowParent.getChildCount()-1;
if (contentsUnchanged && (orderUnchanged || isLastAnyway)) {
if (DEBUG) Slog.d(TAG, "reusing notification for key: " + key);
@@ -668,6 +667,13 @@ public class TabletStatusBar extends StatusBar implements
handleNotificationError(key, notification, "Couldn't update icon: " + ic);
return;
}
+ // Update the large icon
+ if (notification.notification.largeIcon != null) {
+ oldEntry.largeIcon.setImageBitmap(notification.notification.largeIcon);
+ } else {
+ oldEntry.largeIcon.getLayoutParams().width = 0;
+ oldEntry.largeIcon.setVisibility(View.INVISIBLE);
+ }
if (key == mNotificationPeekKey) {
// must update the peek window
@@ -1286,6 +1292,7 @@ public class TabletStatusBar extends StatusBar implements
entry.row = row;
entry.content = content;
entry.expanded = expanded;
+ entry.largeIcon = largeIcon;
return true;
}
diff --git a/tests/StatusBar/res/drawable-mdpi/pineapple2.png b/tests/StatusBar/res/drawable-mdpi/pineapple2.png
new file mode 100644
index 0000000000000..ddc103803b6d8
Binary files /dev/null and b/tests/StatusBar/res/drawable-mdpi/pineapple2.png differ
diff --git a/tests/StatusBar/res/layout/notification_builder_test.xml b/tests/StatusBar/res/layout/notification_builder_test.xml
index 1b27e97880ce7..3c37a733c400e 100644
--- a/tests/StatusBar/res/layout/notification_builder_test.xml
+++ b/tests/StatusBar/res/layout/notification_builder_test.xml
@@ -238,7 +238,7 @@
/>
+
diff --git a/tests/StatusBar/src/com/android/statusbartest/NotificationBuilderTest.java b/tests/StatusBar/src/com/android/statusbartest/NotificationBuilderTest.java
index e9a3513caf069..5a2ebacefa44b 100644
--- a/tests/StatusBar/src/com/android/statusbartest/NotificationBuilderTest.java
+++ b/tests/StatusBar/src/com/android/statusbartest/NotificationBuilderTest.java
@@ -16,6 +16,8 @@
package com.android.statusbartest;
+import java.util.GregorianCalendar;
+
import android.app.Activity;
import android.app.Notification;
import android.app.NotificationManager;
@@ -190,8 +192,14 @@ public class NotificationBuilderTest extends Activity
// when
switch (getRadioChecked(R.id.group_when)) {
- case R.id.when_midnight:
+ case R.id.when_midnight: {
+ GregorianCalendar c = new GregorianCalendar();
+ c.set(GregorianCalendar.HOUR_OF_DAY, 0);
+ c.set(GregorianCalendar.MINUTE, 0);
+ c.set(GregorianCalendar.SECOND, 0);
+ b.setWhen(c.getTimeInMillis());
break;
+ }
case R.id.when_now:
b.setWhen(System.currentTimeMillis());
break;
@@ -276,6 +284,9 @@ public class NotificationBuilderTest extends Activity
case R.id.large_icon_pineapple:
b.setLargeIcon(loadBitmap(R.drawable.pineapple));
break;
+ case R.id.large_icon_pineapple2:
+ b.setLargeIcon(loadBitmap(R.drawable.pineapple2));
+ break;
}
// sound TODO