blob: 8a00c8e21ace90f598452a430e0d0d00dfeaa724 [file] [log] [blame]
From ab72887deb1b7b297efc3bb26a62e23069a42081 Mon Sep 17 00:00:00 2001
From: phh <phh@phh.me>
Date: Wed, 22 Aug 2018 08:57:52 +0000
Subject: [PATCH] Enable fallback to old ro.sf.hwrotation property
---
services/surfaceflinger/SurfaceFlinger.cpp | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index b2d4637f1..22b13a578 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -292,6 +292,24 @@ SurfaceFlinger::SurfaceFlinger() : SurfaceFlinger(SkipInitialization) {
mPrimaryDisplayOrientation = DisplayState::eOrientationDefault;
break;
}
+
+ if(primaryDisplayOrientation == V1_1::DisplayOrientation::ORIENTATION_0) {
+ int sfRotation = property_get_int32("ro.sf.hwrotation", -1);
+ switch(sfRotation) {
+ case 0:
+ mPrimaryDisplayOrientation = DisplayState::eOrientationDefault;
+ break;
+ case 90:
+ mPrimaryDisplayOrientation = DisplayState::eOrientation90;
+ break;
+ case 180:
+ mPrimaryDisplayOrientation = DisplayState::eOrientation180;
+ break;
+ case 270:
+ mPrimaryDisplayOrientation = DisplayState::eOrientation270;
+ break;
+ }
+ }
ALOGV("Primary Display Orientation is set to %2d.", mPrimaryDisplayOrientation);
mPrimaryDispSync.init(SurfaceFlinger::hasSyncFramework, SurfaceFlinger::dispSyncPresentTimeOffset);
--
2.17.1