Merge "Animate notification background color directly" into ub-launcher3-master
diff --git a/src/com/android/launcher3/dynamicui/ColorExtractionService.java b/src/com/android/launcher3/dynamicui/ColorExtractionService.java
index 1a127dc..f94d442 100644
--- a/src/com/android/launcher3/dynamicui/ColorExtractionService.java
+++ b/src/com/android/launcher3/dynamicui/ColorExtractionService.java
@@ -98,7 +98,7 @@
                 if (bitmap != null) {
                     return Palette.from(bitmap).clearFilters().generate();
                 }
-            } catch (IOException e) {
+            } catch (IOException | NullPointerException e) {
                 Log.e(TAG, "Fetching partial bitmap failed, trying old method", e);
             }
         }
@@ -129,7 +129,7 @@
                 if (bitmap != null) {
                     return Palette.from(bitmap).clearFilters().generate();
                 }
-            } catch (IOException e) {
+            } catch (IOException | NullPointerException e) {
                 Log.e(TAG, "Fetching partial bitmap failed, trying old method", e);
             }
         }
diff --git a/src/com/android/launcher3/notification/NotificationItemView.java b/src/com/android/launcher3/notification/NotificationItemView.java
index 639447d..c9b3940 100644
--- a/src/com/android/launcher3/notification/NotificationItemView.java
+++ b/src/com/android/launcher3/notification/NotificationItemView.java
@@ -83,12 +83,20 @@
 
     @Override
     public boolean onInterceptTouchEvent(MotionEvent ev) {
+        if (mMainView.getNotificationInfo() == null) {
+            // The notification hasn't been populated yet.
+            return false;
+        }
         getParent().requestDisallowInterceptTouchEvent(true);
         return mSwipeHelper.onInterceptTouchEvent(ev);
     }
 
     @Override
     public boolean onTouchEvent(MotionEvent ev) {
+        if (mMainView.getNotificationInfo() == null) {
+            // The notification hasn't been populated yet.
+            return false;
+        }
         return mSwipeHelper.onTouchEvent(ev) || super.onTouchEvent(ev);
     }