Fixed a bug where the clearable flag was set inconsistently

This could lead to undismissable notifications.

Bug: 17758698
Change-Id: I60ccbe24686c5b8bc46bfb52e590cef71ed7a190
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
index 725a1a8..5613a6e 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
@@ -1486,8 +1486,6 @@
             entry.autoRedacted = true;
         }
 
-        row.setClearable(sbn.isClearable());
-
         if (MULTIUSER_DEBUG) {
             TextView debug = (TextView) row.findViewById(R.id.debug_info);
             if (debug != null) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java b/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java
index f8332ea..7345440 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java
@@ -118,6 +118,7 @@
 
     public void setStatusBarNotification(StatusBarNotification statusBarNotification) {
         mStatusBarNotification = statusBarNotification;
+        updateVetoButton();
     }
 
     public StatusBarNotification getStatusBarNotification() {
@@ -303,17 +304,7 @@
      * @return Can the underlying notification be cleared?
      */
     public boolean isClearable() {
-        return mClearable;
-    }
-
-    /**
-     * Set whether the notification can be cleared.
-     *
-     * @param clearable
-     */
-    public void setClearable(boolean clearable) {
-        mClearable = clearable;
-        updateVetoButton();
+        return mStatusBarNotification != null && mStatusBarNotification.isClearable();
     }
 
     /**