From 6cf14a02bf9e499a8e6fd7e1cf79b2e9d16e9811 Mon Sep 17 00:00:00 2001 From: Daniel Sandler Date: Thu, 29 Mar 2012 11:50:51 -0400 Subject: [PATCH] Fix NPE on tablets. Change-Id: I2128daac06988e4bae25ec48a874901ba731ebf9 --- .../statusbar/tablet/TabletStatusBar.java | 23 +------------------ 1 file changed, 1 insertion(+), 22 deletions(-) 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 87eb9ccfe8de7..9d5faa4ed0146 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java @@ -936,10 +936,8 @@ public class TabletStatusBar extends BaseStatusBar implements if (contentIntent != null) { final View.OnClickListener listener = new NotificationClicker(contentIntent, notification.pkg, notification.tag, notification.id); - oldEntry.largeIcon.setOnClickListener(listener); oldEntry.content.setOnClickListener(listener); } else { - oldEntry.largeIcon.setOnClickListener(null); oldEntry.content.setOnClickListener(null); } // Update the icon. @@ -951,13 +949,6 @@ public class TabletStatusBar extends BaseStatusBar 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 (NOTIFICATION_PEEK_ENABLED && key == mNotificationPeekKey) { // must update the peek window @@ -1860,16 +1851,7 @@ public class TabletStatusBar extends BaseStatusBar implements vetoButton.setContentDescription(mContext.getString( R.string.accessibility_remove_notification)); - // the large icon - ImageView largeIcon = (ImageView)row.findViewById(R.id.large_icon); - if (sbn.notification.largeIcon != null) { - largeIcon.setImageBitmap(sbn.notification.largeIcon); - largeIcon.setContentDescription(sbn.notification.tickerText); - } else { - largeIcon.getLayoutParams().width = 0; - largeIcon.setVisibility(View.INVISIBLE); - } - largeIcon.setContentDescription(sbn.notification.tickerText); + // NB: the large icon is now handled entirely by the template // bind the click event to the content area ViewGroup content = (ViewGroup)row.findViewById(R.id.content); @@ -1880,10 +1862,8 @@ public class TabletStatusBar extends BaseStatusBar implements if (contentIntent != null) { final View.OnClickListener listener = new NotificationClicker( contentIntent, sbn.pkg, sbn.tag, sbn.id); - largeIcon.setOnClickListener(listener); content.setOnClickListener(listener); } else { - largeIcon.setOnClickListener(null); content.setOnClickListener(null); } @@ -1909,7 +1889,6 @@ public class TabletStatusBar extends BaseStatusBar implements entry.row = row; entry.content = content; entry.expanded = expanded; - entry.largeIcon = largeIcon; return true; }