QS: Reset user activity timeout on the lockscreen.

If the quick settings panel changes, call userActivity to
delay the screen timeout.

Bug:15166195
Change-Id: Ie32fb39c5a975d9cf0d80d7fdf711177028a6b5c
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 142241c..0a44904 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
@@ -478,6 +478,7 @@
         mHeader.setExpansion(height);
         setQsTranslation(height);
         setQsStackScrollerPadding(height);
+        mStatusBar.userActivity();
     }
 
     private void setQsTranslation(float height) {
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 772681e..152ca3f 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -2779,9 +2779,8 @@
     }
 
     public void userActivity() {
-        if (mState == StatusBarState.KEYGUARD) {
-            mKeyguardViewMediatorCallback.userActivity();
-        }
+        mHandler.removeCallbacks(mUserActivity);
+        mHandler.post(mUserActivity);
     }
 
     public boolean interceptMediaKey(KeyEvent event) {
@@ -2939,4 +2938,13 @@
     public void onScreenTurnedOn() {
         mStackScroller.setAnimationsEnabled(true);
     }
+
+    private final Runnable mUserActivity = new Runnable() {
+        @Override
+        public void run() {
+            if (mState == StatusBarState.KEYGUARD) {
+                mKeyguardViewMediatorCallback.userActivity();
+            }
+        }
+    };
 }