SurfaceFlinger: clear LayerHistory on touch

Clear LayerHistory and mark all layers as inactive when getting
a touch event to prevent a quick refresh rate bounce as LayerHistory
picks up with the FPS.

Fixes: 134663749
Test: live wallpaper + Open notification shade + wait for 60Hz + Click on "USB debugging connected"
Change-Id: Ifa095fbcdb95ffe413cc77c5e062f1174815158b
(cherry picked from commit a9bf4cadf763fe8337c231c44e7d39827c98a0b8)
Merged-In: Ifa095fbcdb95ffe413cc77c5e062f1174815158b
diff --git a/services/surfaceflinger/Scheduler/Scheduler.cpp b/services/surfaceflinger/Scheduler/Scheduler.cpp
index afcf3d4..86b2920 100644
--- a/services/surfaceflinger/Scheduler/Scheduler.cpp
+++ b/services/surfaceflinger/Scheduler/Scheduler.cpp
@@ -407,6 +407,10 @@
     if (mSupportKernelTimer) {
         resetIdleTimer();
     }
+
+    // Touch event will boost the refresh rate to performance.
+    // Clear Layer History to get fresh FPS detection
+    mLayerHistory.clearHistory();
 }
 
 void Scheduler::resetTimerCallback() {