DisplayEventDispatcher: optimize binder calls

Use DisplayEventReciever::setVsyncRate instead of
DisplayEventReciever::requestNextVsync to accommodate a one-time
registration to vsync events when the app registers back to back
callbacks. With this approach we can save all the binder calls during
a running animation.

Test: run TouchLatency test app and observe systrace
Bug: 162096692
Change-Id: Ib415f2aade40a3d23a2b4c77e5746e5e13666d23
diff --git a/services/surfaceflinger/Scheduler/EventThread.cpp b/services/surfaceflinger/Scheduler/EventThread.cpp
index c12a7b1..f90c130 100644
--- a/services/surfaceflinger/Scheduler/EventThread.cpp
+++ b/services/surfaceflinger/Scheduler/EventThread.cpp
@@ -303,6 +303,10 @@
     std::lock_guard<std::mutex> lock(mMutex);
 
     const auto request = rate == 0 ? VSyncRequest::None : static_cast<VSyncRequest>(rate);
+    if (request != VSyncRequest::None && connection->resyncCallback) {
+        connection->resyncCallback();
+    }
+
     if (connection->vsyncRequest != request) {
         connection->vsyncRequest = request;
         mCondition.notify_all();