OSDN Git Service

Ignore touches before notification is populated
authorTony Wickham <twickham@google.com>
Thu, 16 Feb 2017 00:03:27 +0000 (16:03 -0800)
committerTony Wickham <twickham@google.com>
Thu, 16 Feb 2017 00:05:40 +0000 (16:05 -0800)
Bug: 35398757
Change-Id: I24f1b66787af7c7caeb325e9a1f3e6ef86e62b81

src/com/android/launcher3/notification/NotificationItemView.java

index 639447d..c9b3940 100644 (file)
@@ -83,12 +83,20 @@ public class NotificationItemView extends PopupItemView implements LogContainerP
 
     @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);
     }