Fixed a bug where notifications could stay expanded

When expanding and locking the screen, the notification
could be stuck in a userlocked state and therefore look
expanded even on the lock screen.
Another case where this could happen was when there was
a race between locking the screen and collapsing a group.

On master the same can even happen with the drag-down helper
since we're blocking the touches of it on the always on
screen.

Change-Id: I4f359d727013ee8c9e4174d2855896ba8d3d1a0b
Test: have group on locked shade, expand, click on middle space during expansion
Bug: 33614507
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java
index 487f0e7..1b73a3f 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java
@@ -285,13 +285,10 @@
 
     @Override
     public boolean onTouchEvent(MotionEvent ev) {
-        if (mService.isDozing() && !mService.isPulsing()) {
-            // Discard all touch events in always-on.
-            return true;
-        }
-
-        boolean handled = false;
-        if (mService.getBarState() == StatusBarState.KEYGUARD) {
+        boolean handled = mService.isDozing() && !mService.isPulsing();
+        if (mService.getBarState() == StatusBarState.KEYGUARD
+                && (!handled || mDragDownHelper.isDraggingDown())) {
+            // we still want to finish our drag down gesture when locking the screen
             handled = mDragDownHelper.onTouchEvent(ev);
         }
         if (!handled) {