Implement getDisplayInfo()
This change implements getDisplayInfo() method that returns the main
display information from SurfaceComposerClient.
Bug: 141886260
Test: VtsHalEvsV1_1TargetTest
Change-Id: I6fe05aef9868c202e8b0a4664783122180235fe0
Signed-off-by: Changyeon Jo <changyeon@google.com>
diff --git a/services/automotive/display/include/CarWindowService.h b/services/automotive/display/include/CarWindowService.h
index 3290cc7..d635f5a 100644
--- a/services/automotive/display/include/CarWindowService.h
+++ b/services/automotive/display/include/CarWindowService.h
@@ -20,6 +20,8 @@
#include <gui/IGraphicBufferProducer.h>
#include <gui/Surface.h>
#include <gui/SurfaceComposerClient.h>
+#include <ui/DisplayConfig.h>
+#include <ui/DisplayState.h>
namespace android {
namespace frameworks {
@@ -37,11 +39,23 @@
Return<sp<IGraphicBufferProducer>> getIGraphicBufferProducer() override;
Return<bool> showWindow() override;
Return<bool> hideWindow() override;
+ Return<void> getDisplayInfo(getDisplayInfo_cb _info_cb) override {
+ HwDisplayConfig cfg;
+ cfg.setToExternal((uint8_t*)&mDpyConfig, sizeof(DisplayConfig));
+
+ HwDisplayState state;
+ state.setToExternal((uint8_t*)&mDpyState, sizeof(DisplayState));
+
+ _info_cb(cfg, state);
+ return hardware::Void();
+ }
private:
sp<android::Surface> mSurface;
sp<android::SurfaceComposerClient> mSurfaceComposerClient;
sp<android::SurfaceControl> mSurfaceControl;
+ DisplayConfig mDpyConfig;
+ DisplayState mDpyState;
};
} // namespace implementation
} // namespace V1_0