[SF] Use HWC api getPhysicalDisplayOrientation
With HWC3.0 we have the getPhysicalDisplayOrientation
api that can replace the sysprop ro.surface_flinger.primary_display_orientation
BUG: 184085132
Test: atest libsurfaceflinger_unittest
Change-Id: Ie2b0f8e1a81219dc8231a56b9e6174d549a4cbd1
diff --git a/services/surfaceflinger/DisplayHardware/HWC2.h b/services/surfaceflinger/DisplayHardware/HWC2.h
index c03cede..d78562d 100644
--- a/services/surfaceflinger/DisplayHardware/HWC2.h
+++ b/services/surfaceflinger/DisplayHardware/HWC2.h
@@ -169,6 +169,8 @@
support) = 0;
[[clang::warn_unused_result]] virtual hal::Error setIdleTimerEnabled(
std::chrono::milliseconds timeout) = 0;
+ [[clang::warn_unused_result]] virtual hal::Error getPhysicalDisplayOrientation(
+ Hwc2::AidlTransform* outTransform) const = 0;
};
namespace impl {
@@ -256,6 +258,7 @@
bool isVsyncPeriodSwitchSupported() const override;
bool hasDisplayIdleTimerCapability() const override;
void onLayerDestroyed(hal::HWLayerId layerId) override;
+ hal::Error getPhysicalDisplayOrientation(Hwc2::AidlTransform* outTransform) const override;
private: