Refresh tablet notification drawer.

  * New "X" button appears in the system bar, allowing the
    user to clear all notifications. Only appears when the
    notifications list is showing and there are clearable
    items. (Note: the textual button on phones has also been
    replaced with an X.)

  * Updated panel background artwork and positioning.

  * Removed a bunch of old art.

Bug: 4970588
Bug: 4974043
Bug: 3509407 (regression)

Change-Id: Ibadb638cd18c4faa751cd1f311d73ceda65cb3ca
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 c6e546e..dc7e3137 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
@@ -122,6 +122,7 @@
     View mNotificationTrigger;
     NotificationIconArea mNotificationIconArea;
     ViewGroup mNavigationArea;
+    View mClearButton;
 
     boolean mNotificationDNDMode;
     NotificationData.Entry mNotificationDNDDummyEntry;
@@ -187,6 +188,7 @@
         // Notification Panel
         mNotificationPanel = (NotificationPanel)View.inflate(context,
                 R.layout.status_bar_notification_panel, null);
+        mNotificationPanel.setBar(this);
         mNotificationPanel.show(false, false);
         mNotificationPanel.setOnTouchListener(
                 new TouchOutsideListener(MSG_CLOSE_NOTIFICATION_PANEL, mNotificationPanel));
@@ -451,6 +453,10 @@
         // the more notifications icon
         mNotificationIconArea = (NotificationIconArea)sb.findViewById(R.id.notificationIcons);
 
+        // the "X" that appears in place of the clock when the panel is showing notifications
+        mClearButton = sb.findViewById(R.id.clear_all_button);
+        mClearButton.setOnClickListener(mClearButtonListener);
+
         // where the icons go
         mIconLayout = (NotificationIconArea.IconLayout) sb.findViewById(R.id.icons);
         mIconLayout.setOnTouchListener(new NotificationIconTouchListener());
@@ -581,6 +587,21 @@
         return sb;
     }
 
+    private View.OnClickListener mClearButtonListener = new View.OnClickListener() {
+        public void onClick(View v) {
+            try {
+                mBarService.onClearAllNotifications();
+            } catch (RemoteException ex) {
+                // system process is dead if we're here.
+            }
+            animateCollapse();
+        }
+    };
+
+    public View getClearButton() {
+        return mClearButton;
+    }
+
     public int getStatusBarHeight() {
         return mHeightReceiver.getHeight();
     }
@@ -1183,7 +1204,6 @@
     }
 
     private void setAreThereNotifications() {
-        final boolean hasClearable = mNotificationData.hasClearableItems();
     }
 
     /**