VR: Fail presentation without layers
Without any layers or a valid client target there is nothing to present.
Bug: None
Test: Compiled
Change-Id: Ib8b4b7ced628a38c69be726bf1c04dde2882c614
(cherry picked from commit 12da96889be17f1964681210d0f780fd70fefc33)
diff --git a/services/vr/vr_window_manager/composer/impl/vr_hwc.cpp b/services/vr/vr_window_manager/composer/impl/vr_hwc.cpp
index f83fa86..7e406a5 100644
--- a/services/vr/vr_window_manager/composer/impl/vr_hwc.cpp
+++ b/services/vr/vr_window_manager/composer/impl/vr_hwc.cpp
@@ -178,6 +178,11 @@
}
}
+ if (frame.empty()) {
+ ALOGE("Requested frame with no layers");
+ return Error::BAD_LAYER;
+ }
+
// Increment the time the fence is signalled every time we get the
// presentation frame. This ensures that calling ReleaseFrame() only affects
// the current frame.