Ensure display metrics on display service creation
This fixes a potential race condition where a VR app could request the
display metrics from the VR display service before it actually queries
them from the HWC.
Bug: None
Test: Compiled and ran Vr app.
Change-Id: Ie95b7f5a8ef2e286c7b2994ca94fd87214567e24
diff --git a/libs/vr/libvrflinger/hardware_composer.h b/libs/vr/libvrflinger/hardware_composer.h
index b6aa807..e2a8b90 100644
--- a/libs/vr/libvrflinger/hardware_composer.h
+++ b/libs/vr/libvrflinger/hardware_composer.h
@@ -189,6 +189,10 @@
HardwareComposer(Hwc2::Composer* hidl);
~HardwareComposer();
+ bool Initialize();
+
+ bool IsInitialized() const { return initialized_; }
+
bool Suspend();
bool Resume();
@@ -303,6 +307,8 @@
void HandlePendingScreenshots();
+ bool initialized_;
+
// Hardware composer HAL device.
std::unique_ptr<Hwc2::Composer> hwc2_hidl_;
sp<ComposerCallback> callbacks_;