Doze: Ensure a doze reset happens after leaving keyguard.

Bug:17536133
Change-Id: Ibc88a7f2c1a51656676fe62d4de8ab3ec4dd4081
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
index c04ca83..80e9663 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
@@ -1738,6 +1738,10 @@
         updateKeyguardStatusBarVisibility();
     }
 
+    public boolean isDozing() {
+        return mDozing;
+    }
+
     private static void setBackgroundColorAlpha(final View target, int rgb, int targetAlpha,
             boolean animate) {
         int currentAlpha = getBackgroundAlpha(target);
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 9d77331..90f9cdd 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -3641,7 +3641,7 @@
     }
 
     private void updateDozingState() {
-        if (mState != StatusBarState.KEYGUARD) {
+        if (mState != StatusBarState.KEYGUARD && !mNotificationPanel.isDozing()) {
             return;
         }
         mNotificationPanel.setDozing(mDozing);