composer: Add async wait for commit during TUITransitionEnd

Change-Id: I13c459864bbb15ba2a3b70604d02116d8257862c
CRs-Fixed: 3358014
diff --git a/composer/hwc_session.cpp b/composer/hwc_session.cpp
index 4d3908e..0edb1d6 100644
--- a/composer/hwc_session.cpp
+++ b/composer/hwc_session.cpp
@@ -4253,7 +4253,7 @@
 }
 
 int HWCSession::WaitForCommitDoneAsync(hwc2_display_t display, int client_id) {
-  std::chrono::milliseconds span(5000);
+  std::chrono::milliseconds span(2000);
   if (commit_done_future_.valid()) {
     std::future_status status = commit_done_future_.wait_for(std::chrono::milliseconds(0));
     if (status != std::future_status::ready) {
@@ -4491,7 +4491,7 @@
 
   if (needs_refresh) {
     DLOGI("Waiting for device unassign");
-    int ret = WaitForCommitDone(target_display, kClientTrustedUI);
+    int ret = WaitForCommitDoneAsync(target_display, kClientTrustedUI);
     if (ret != 0) {
       DLOGE("Device unassign failed with error %d", ret);
       return -EINVAL;