Send drawFinish callback even if did not draw

There are cases where ViewRootImpl requests to draw, but there was
nothing new to draw. In that case, the callback will never be invoked
and ViewRootImpl will wait forever.

This change will invoke the callback even if there is nothing to draw.
It will use the last frameNumber since nothing new has drawn

Test: Request draw with nothing new. Callback is invoked
Fixes: 155429223
Change-Id: I7c9ed7fd63a451b17133a11ffbcf8fb64be558e5
diff --git a/libs/hwui/renderthread/CanvasContext.cpp b/libs/hwui/renderthread/CanvasContext.cpp
index c19b187..335bcdc 100644
--- a/libs/hwui/renderthread/CanvasContext.cpp
+++ b/libs/hwui/renderthread/CanvasContext.cpp
@@ -440,6 +440,12 @@
 
     if (dirty.isEmpty() && Properties::skipEmptyFrames && !surfaceRequiresRedraw()) {
         mCurrentFrameInfo->addFlag(FrameInfoFlags::SkippedFrame);
+        // Notify the callbacks, even if there's nothing to draw so they aren't waiting
+        // indefinitely
+        for (auto& func : mFrameCompleteCallbacks) {
+            std::invoke(func, mFrameNumber);
+        }
+        mFrameCompleteCallbacks.clear();
         return;
     }