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/res/drawable-hdpi/ic_notify_clear_normal.png b/packages/SystemUI/res/drawable-hdpi/ic_notify_clear_normal.png
new file mode 100644
index 0000000..d17aae6
--- /dev/null
+++ b/packages/SystemUI/res/drawable-hdpi/ic_notify_clear_normal.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/ic_notify_clear_pressed.png b/packages/SystemUI/res/drawable-hdpi/ic_notify_clear_pressed.png
new file mode 100644
index 0000000..5a89d76
--- /dev/null
+++ b/packages/SystemUI/res/drawable-hdpi/ic_notify_clear_pressed.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/notify_panel_clock_bg_normal.9.png b/packages/SystemUI/res/drawable-hdpi/notify_panel_clock_bg_normal.9.png
deleted file mode 100644
index b7ad39c..0000000
--- a/packages/SystemUI/res/drawable-hdpi/notify_panel_clock_bg_normal.9.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/notify_panel_clock_bg_pressed.9.png b/packages/SystemUI/res/drawable-hdpi/notify_panel_clock_bg_pressed.9.png
deleted file mode 100644
index c93bd8c..0000000
--- a/packages/SystemUI/res/drawable-hdpi/notify_panel_clock_bg_pressed.9.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/notify_panel_notify_bg.9.png b/packages/SystemUI/res/drawable-hdpi/notify_panel_notify_bg.9.png
deleted file mode 100644
index 1680887..0000000
--- a/packages/SystemUI/res/drawable-hdpi/notify_panel_notify_bg.9.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/status_bar_ticker_tile.png b/packages/SystemUI/res/drawable-hdpi/status_bar_ticker_tile.png
index 772f77d..3b826a9 100644
--- a/packages/SystemUI/res/drawable-hdpi/status_bar_ticker_tile.png
+++ b/packages/SystemUI/res/drawable-hdpi/status_bar_ticker_tile.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/status_bar_veto_normal.png b/packages/SystemUI/res/drawable-hdpi/status_bar_veto_normal.png
deleted file mode 100644
index 90b4baf..0000000
--- a/packages/SystemUI/res/drawable-hdpi/status_bar_veto_normal.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/status_bar_veto_pressed.png b/packages/SystemUI/res/drawable-hdpi/status_bar_veto_pressed.png
deleted file mode 100644
index bc7034a..0000000
--- a/packages/SystemUI/res/drawable-hdpi/status_bar_veto_pressed.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-large-hdpi/notify_panel_clock_bg_normal.9.png b/packages/SystemUI/res/drawable-large-hdpi/notify_panel_clock_bg_normal.9.png
new file mode 100644
index 0000000..002a663
--- /dev/null
+++ b/packages/SystemUI/res/drawable-large-hdpi/notify_panel_clock_bg_normal.9.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-large-hdpi/notify_panel_clock_bg_pressed.9.png b/packages/SystemUI/res/drawable-large-hdpi/notify_panel_clock_bg_pressed.9.png
new file mode 100644
index 0000000..399d62e
--- /dev/null
+++ b/packages/SystemUI/res/drawable-large-hdpi/notify_panel_clock_bg_pressed.9.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-large-hdpi/notify_panel_notify_bg.9.png b/packages/SystemUI/res/drawable-large-hdpi/notify_panel_notify_bg.9.png
new file mode 100644
index 0000000..7385ecc
--- /dev/null
+++ b/packages/SystemUI/res/drawable-large-hdpi/notify_panel_notify_bg.9.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-large-mdpi/notify_panel_clock_bg_normal.9.png b/packages/SystemUI/res/drawable-large-mdpi/notify_panel_clock_bg_normal.9.png
new file mode 100644
index 0000000..5a880e75
--- /dev/null
+++ b/packages/SystemUI/res/drawable-large-mdpi/notify_panel_clock_bg_normal.9.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-large-mdpi/notify_panel_clock_bg_pressed.9.png b/packages/SystemUI/res/drawable-large-mdpi/notify_panel_clock_bg_pressed.9.png
new file mode 100644
index 0000000..489163d
--- /dev/null
+++ b/packages/SystemUI/res/drawable-large-mdpi/notify_panel_clock_bg_pressed.9.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-large-mdpi/notify_panel_notify_bg.9.png b/packages/SystemUI/res/drawable-large-mdpi/notify_panel_notify_bg.9.png
new file mode 100644
index 0000000..78900a1
--- /dev/null
+++ b/packages/SystemUI/res/drawable-large-mdpi/notify_panel_notify_bg.9.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-large-xhdpi/notify_panel_clock_bg_normal.9.png b/packages/SystemUI/res/drawable-large-xhdpi/notify_panel_clock_bg_normal.9.png
new file mode 100644
index 0000000..37e7791
--- /dev/null
+++ b/packages/SystemUI/res/drawable-large-xhdpi/notify_panel_clock_bg_normal.9.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-large-xhdpi/notify_panel_clock_bg_pressed.9.png b/packages/SystemUI/res/drawable-large-xhdpi/notify_panel_clock_bg_pressed.9.png
new file mode 100644
index 0000000..66fa4a8
--- /dev/null
+++ b/packages/SystemUI/res/drawable-large-xhdpi/notify_panel_clock_bg_pressed.9.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-large-xhdpi/notify_panel_notify_bg.9.png b/packages/SystemUI/res/drawable-large-xhdpi/notify_panel_notify_bg.9.png
new file mode 100644
index 0000000..11e36ab
--- /dev/null
+++ b/packages/SystemUI/res/drawable-large-xhdpi/notify_panel_notify_bg.9.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/ic_notify_clear_normal.png b/packages/SystemUI/res/drawable-mdpi/ic_notify_clear_normal.png
new file mode 100644
index 0000000..9490833
--- /dev/null
+++ b/packages/SystemUI/res/drawable-mdpi/ic_notify_clear_normal.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/ic_notify_clear_pressed.png b/packages/SystemUI/res/drawable-mdpi/ic_notify_clear_pressed.png
new file mode 100644
index 0000000..0ff3efd
--- /dev/null
+++ b/packages/SystemUI/res/drawable-mdpi/ic_notify_clear_pressed.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/notify_panel_clock_bg_normal.9.png b/packages/SystemUI/res/drawable-mdpi/notify_panel_clock_bg_normal.9.png
deleted file mode 100644
index 2dcb659..0000000
--- a/packages/SystemUI/res/drawable-mdpi/notify_panel_clock_bg_normal.9.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/notify_panel_clock_bg_pressed.9.png b/packages/SystemUI/res/drawable-mdpi/notify_panel_clock_bg_pressed.9.png
deleted file mode 100644
index e7ed68b..0000000
--- a/packages/SystemUI/res/drawable-mdpi/notify_panel_clock_bg_pressed.9.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/notify_panel_notify_bg.9.png b/packages/SystemUI/res/drawable-mdpi/notify_panel_notify_bg.9.png
deleted file mode 100644
index e346167..0000000
--- a/packages/SystemUI/res/drawable-mdpi/notify_panel_notify_bg.9.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/status_bar_ticker_tile.png b/packages/SystemUI/res/drawable-mdpi/status_bar_ticker_tile.png
index 0eb71d0..9999598 100644
--- a/packages/SystemUI/res/drawable-mdpi/status_bar_ticker_tile.png
+++ b/packages/SystemUI/res/drawable-mdpi/status_bar_ticker_tile.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/status_bar_veto_normal.png b/packages/SystemUI/res/drawable-mdpi/status_bar_veto_normal.png
deleted file mode 100644
index 90b4baf..0000000
--- a/packages/SystemUI/res/drawable-mdpi/status_bar_veto_normal.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/status_bar_veto_pressed.png b/packages/SystemUI/res/drawable-mdpi/status_bar_veto_pressed.png
deleted file mode 100644
index bc7034a..0000000
--- a/packages/SystemUI/res/drawable-mdpi/status_bar_veto_pressed.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/ic_notify_clear_normal.png b/packages/SystemUI/res/drawable-xhdpi/ic_notify_clear_normal.png
new file mode 100644
index 0000000..6455423
--- /dev/null
+++ b/packages/SystemUI/res/drawable-xhdpi/ic_notify_clear_normal.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/ic_notify_clear_pressed.png b/packages/SystemUI/res/drawable-xhdpi/ic_notify_clear_pressed.png
new file mode 100644
index 0000000..bfa8bb4
--- /dev/null
+++ b/packages/SystemUI/res/drawable-xhdpi/ic_notify_clear_pressed.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/status_bar_ticker_tile.png b/packages/SystemUI/res/drawable-xhdpi/status_bar_ticker_tile.png
new file mode 100644
index 0000000..6585ad6
--- /dev/null
+++ b/packages/SystemUI/res/drawable-xhdpi/status_bar_ticker_tile.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable/status_bar_veto.xml b/packages/SystemUI/res/drawable/ic_notify_clear.xml
similarity index 75%
rename from packages/SystemUI/res/drawable/status_bar_veto.xml
rename to packages/SystemUI/res/drawable/ic_notify_clear.xml
index 6e1b681..9c432b2 100644
--- a/packages/SystemUI/res/drawable/status_bar_veto.xml
+++ b/packages/SystemUI/res/drawable/ic_notify_clear.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2010 The Android Open Source Project
+<!-- Copyright (C) 2011 The Android Open Source Project
 
      Licensed under the Apache License, Version 2.0 (the "License");
      you may not use this file except in compliance with the License.
@@ -15,7 +15,7 @@
 -->
 
 <selector xmlns:android="http://schemas.android.com/apk/res/android">
-    <item android:state_pressed="true" android:drawable="@drawable/status_bar_veto_pressed" />
-    <item android:drawable="@drawable/status_bar_veto_normal" />
+    <item android:state_pressed="true"
+        android:drawable="@drawable/ic_notify_clear_pressed" />
+    <item android:drawable="@drawable/ic_notify_clear_normal" />
 </selector>
-
diff --git a/packages/SystemUI/res/layout-sw600dp/status_bar.xml b/packages/SystemUI/res/layout-sw600dp/status_bar.xml
index a204f17..55e57ab 100644
--- a/packages/SystemUI/res/layout-sw600dp/status_bar.xml
+++ b/packages/SystemUI/res/layout-sw600dp/status_bar.xml
@@ -35,6 +35,18 @@
             android:clipChildren="false"
             >
 
+            <ImageView android:id="@+id/clear_all_button"
+                android:layout_width="wrap_content"
+                android:layout_height="match_parent"
+                android:layout_alignParentRight="true"
+                android:layout_marginTop="1dp"
+                android:layout_marginRight="20dp"
+                android:paddingLeft="15dp"
+                android:paddingRight="15dp"
+                android:src="@drawable/ic_notify_clear"
+                android:visibility="invisible"
+                />
+
             <!-- notification icons & panel access -->
             <include layout="@layout/status_bar_notification_area" 
                 android:layout_width="wrap_content"
diff --git a/packages/SystemUI/res/layout-sw600dp/status_bar_notification_panel.xml b/packages/SystemUI/res/layout-sw600dp/status_bar_notification_panel.xml
index 72519fb..9f11e08 100644
--- a/packages/SystemUI/res/layout-sw600dp/status_bar_notification_panel.xml
+++ b/packages/SystemUI/res/layout-sw600dp/status_bar_notification_panel.xml
@@ -22,7 +22,6 @@
     android:layout_height="match_parent"
     android:layout_width="match_parent"
     android:gravity="right"
-    android:background="@drawable/notify_panel_bg_protect_tiled"
     >
 
     <RelativeLayout
@@ -31,12 +30,12 @@
         android:layout_width="match_parent"
         android:layout_alignParentBottom="true"
         android:layout_alignParentRight="true"
-        android:layout_marginBottom="-27dip"
+        android:layout_marginBottom="8dp"
         >
 
         <include layout="@layout/status_bar_notification_panel_title"
-            android:layout_width="471dp"
-            android:layout_height="465dp"
+            android:layout_width="478dp"
+            android:layout_height="224dp"
             android:layout_alignParentTop="true"
             android:layout_alignParentRight="true"
             />
@@ -45,11 +44,11 @@
             android:id="@+id/content_frame"
             android:background="@drawable/notify_panel_notify_bg"
             android:layout_height="wrap_content"
-            android:layout_width="447dp"
+            android:layout_width="478dp"
             android:orientation="vertical"
             android:layout_alignParentRight="true"
             android:layout_alignParentTop="true"
-            android:layout_marginTop="352dp"
+            android:layout_marginTop="178dp"
             >
             <ScrollView
                 android:id="@+id/notification_scroller"
diff --git a/packages/SystemUI/res/layout/status_bar_expanded.xml b/packages/SystemUI/res/layout/status_bar_expanded.xml
index 2625112..0cfcae1 100644
--- a/packages/SystemUI/res/layout/status_bar_expanded.xml
+++ b/packages/SystemUI/res/layout/status_bar_expanded.xml
@@ -47,19 +47,13 @@
             android:textAppearance="?android:attr/textAppearanceLarge"
             android:textColor="?android:attr/textColorSecondary"
             />
-        <TextView android:id="@+id/clear_all_button"
+        <ImageView android:id="@+id/clear_all_button"
             android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
+            android:layout_height="match_parent"
             android:layout_gravity="center_vertical"
-            android:layout_marginTop="4dp"
-            android:layout_marginBottom="1dp"
-            android:textSize="14sp"
-            android:textColor="#ff000000"
-            android:text="@string/status_bar_clear_all_button"
-            style="?android:attr/buttonStyle"
             android:paddingLeft="15dp"
             android:paddingRight="15dp"
-            android:background="@drawable/btn_default_small"
+            android:src="@drawable/ic_notify_clear"
             />
     </LinearLayout>
 
diff --git a/packages/SystemUI/res/layout/status_bar_notification_row.xml b/packages/SystemUI/res/layout/status_bar_notification_row.xml
index aff6a6e..ca584ab 100644
--- a/packages/SystemUI/res/layout/status_bar_notification_row.xml
+++ b/packages/SystemUI/res/layout/status_bar_notification_row.xml
@@ -3,15 +3,13 @@
     android:layout_height="@dimen/notification_height"
     >
 
-    <ImageButton
+    <Button
         android:id="@+id/veto"
         android:layout_width="48dp"
         android:layout_height="match_parent"
         android:layout_centerVertical="true"
         android:layout_alignParentRight="true"
         android:layout_marginRight="-80dp"
-        android:src="@drawable/status_bar_veto"
-        android:scaleType="center"
         android:background="@null"
         android:paddingRight="8dp"
         android:paddingLeft="8dp"
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
index 4239d24..18026f1 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -141,7 +141,7 @@
     View mExpandedContents;
     // top bar
     TextView mNoNotificationsTitle;
-    TextView mClearButton;
+    View mClearButton;
     // drag bar
     CloseDragHandle mCloseView;
     
@@ -301,7 +301,7 @@
         mExpandedContents = expanded.findViewById(R.id.notificationLinearLayout);
         mPile = (ViewGroup)expanded.findViewById(R.id.latestItems);
         mNoNotificationsTitle = (TextView)expanded.findViewById(R.id.noNotificationsTitle);
-        mClearButton = (TextView)expanded.findViewById(R.id.clear_all_button);
+        mClearButton = expanded.findViewById(R.id.clear_all_button);
         mClearButton.setOnClickListener(mClearButtonListener);
         mScrollView = (ScrollView)expanded.findViewById(R.id.scroll);
         mNotificationLinearLayout = expanded.findViewById(R.id.notificationLinearLayout);
@@ -1984,7 +1984,9 @@
         final Context context = mContext;
         final Resources res = context.getResources();
 
-        mClearButton.setText(context.getText(R.string.status_bar_clear_all_button));
+        if (mClearButton instanceof TextView) {
+            ((TextView)mClearButton).setText(context.getText(R.string.status_bar_clear_all_button));
+        }
         mNoNotificationsTitle.setText(context.getText(R.string.status_bar_no_notifications_title));
 
         loadDimens();
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java
index a316e4b..74dbfef 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java
@@ -49,6 +49,7 @@
     Rect mContentArea = new Rect();
     View mSettingsView;
     ViewGroup mContentParent;
+    TabletStatusBar mBar;
 
     // amount to slide mContentParent down by when mContentFrame is missing
     float mContentFrameMissingTranslation;
@@ -63,6 +64,10 @@
         super(context, attrs, defStyle);
     }
 
+    public void setBar(TabletStatusBar b) {
+        mBar = b;
+    }
+
     @Override
     public void onFinishInflate() {
         super.onFinishInflate();
@@ -202,15 +207,16 @@
               ;
 
         set.setDuration(200);
-        if (!showing) {
-            set.addListener(new AnimatorListenerAdapter() {
-                @Override
-                public void onAnimationEnd(Animator _a) {
+        set.addListener(new AnimatorListenerAdapter() {
+            @Override
+            public void onAnimationEnd(Animator _a) {
+                if (!showing) {
                     mContentFrame.setVisibility(View.GONE);
                     mContentFrame.setAlpha(1f);
                 }
-            });
-        }
+                updateClearButton();
+            }
+        });
         set.start();
     }
 
@@ -247,12 +253,23 @@
                         removeSettingsView();
                     }
                 }
+                updateClearButton();
                 updatePanelModeButtons();
             }
         });
         a.start();
     }
  
+    public void updateClearButton() {
+        if (mBar != null) {
+            final boolean showX 
+                = (isShowing()
+                        && mNotificationScroller.getVisibility() == View.VISIBLE 
+                        && mNotificationCount > 0);
+            mBar.getClearButton().setVisibility(showX ? View.VISIBLE : View.INVISIBLE);
+        }
+    }
+
     public void updatePanelModeButtons() {
         final boolean settingsVisible = (mSettingsView != null);
         mSettingsButton.setVisibility(!settingsVisible ? View.VISIBLE : View.INVISIBLE);
@@ -294,11 +311,11 @@
         AnimatorSet mContentAnim;
 
         // should group this into a multi-property animation
-        final static int OPEN_DURATION = 136;
-        final static int CLOSE_DURATION = 250;
+        final static int OPEN_DURATION = 300;
+        final static int CLOSE_DURATION = 300;
 
         // the panel will start to appear this many px from the end
-        final int HYPERSPACE_OFFRAMP = 100;
+        final int HYPERSPACE_OFFRAMP = 200;
 
         Choreographer() {
         }
@@ -306,10 +323,6 @@
         void createAnimation(boolean appearing) {
             // mVisible: previous state; appearing: new state
             
-            View root = findViewById(R.id.panel_root);
-            Animator bgAnim = ObjectAnimator.ofInt(root.getBackground(), "alpha",
-                    mVisible ? 255 : 0, appearing ? 255 : 0);
-
             float start, end;
 
             // 0: on-screen
@@ -347,7 +360,6 @@
             mContentAnim = new AnimatorSet();
             mContentAnim
                 .play(fadeAnim)
-                .with(bgAnim)
                 .with(posAnim)
                 ;
             mContentAnim.setDuration((DEBUG?10:1)*(appearing ? OPEN_DURATION : CLOSE_DURATION));
@@ -363,6 +375,9 @@
             mContentAnim.start();
 
             mVisible = appearing;
+
+            // we want to start disappearing promptly
+            if (!mVisible) updateClearButton();
         }
 
         public void onAnimationCancel(Animator animation) {
@@ -376,6 +391,9 @@
             }
             mContentParent.setLayerType(View.LAYER_TYPE_NONE, null);
             mContentAnim = null;
+
+            // we want to show the X lazily
+            if (mVisible) updateClearButton();
         }
 
         public void onAnimationRepeat(Animator animation) {
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();
     }
 
     /**