diff options
author | Joe Onorato <joeo@google.com> | 2011-01-15 16:22:24 -0800 |
---|---|---|
committer | Joe Onorato <joeo@google.com> | 2011-01-15 16:22:24 -0800 |
commit | 80a44401a22344f7eabce6976372ab144ef22893 (patch) | |
tree | b13a229ef7c79e0d98feeb337359f1d060ad0e79 /packages/SystemUI/src/com/android/systemui/statusbar | |
parent | a47aa87a19c733e28d9d2db1c4eb7f29d668db7b (diff) | |
download | frameworks_base-80a44401a22344f7eabce6976372ab144ef22893.zip frameworks_base-80a44401a22344f7eabce6976372ab144ef22893.tar.gz frameworks_base-80a44401a22344f7eabce6976372ab144ef22893.tar.bz2 |
Need to update the largeIcon for notifications when we're reapplying the views.
Bug: 3298062
Change-Id: I6bb72c0b93e00a9de8cc2633ac07add0a572a20f
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/statusbar')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java | 3 | ||||
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java | 17 |
2 files changed, 15 insertions, 5 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java index 7e8a5c1..004174e 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 af730fe..d8e3053 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; } |