lineage_patches_unified/patches/platform_frameworks_native/0003-Enable-fallback-to-old-ro.sf.hwrotation-property.patch
2019-10-23 09:02:48 +00:00

44 lines
1.7 KiB
Diff

From 8db7e963f05ebc59298cf8e9b74f98d670ec5742 Mon Sep 17 00:00:00 2001
From: phh <phh@phh.me>
Date: Wed, 22 Aug 2018 08:57:52 +0000
Subject: [PATCH 3/5] Enable fallback to old ro.sf.hwrotation property
Change-Id: I46b75a15b85fc5bda31357a4beeb7dab77bd6fe1
---
services/surfaceflinger/SurfaceFlinger.cpp | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 6166789fc..14ca4729c 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -329,7 +329,25 @@ SurfaceFlinger::SurfaceFlinger(Factory& factory) : SurfaceFlinger(factory, SkipI
SurfaceFlinger::primaryDisplayOrientation = DisplayState::eOrientationDefault;
break;
}
+
ALOGV("Primary Display Orientation is set to %2d.", SurfaceFlinger::primaryDisplayOrientation);
+ if(tmpPrimaryDisplayOrientation == SurfaceFlingerProperties::primary_display_orientation_values::ORIENTATION_0) {
+ int sfRotation = property_get_int32("ro.sf.hwrotation", -1);
+ switch(sfRotation) {
+ case 0:
+ SurfaceFlinger::primaryDisplayOrientation = DisplayState::eOrientationDefault;
+ break;
+ case 90:
+ SurfaceFlinger::primaryDisplayOrientation = DisplayState::eOrientation90;
+ break;
+ case 180:
+ SurfaceFlinger::primaryDisplayOrientation = DisplayState::eOrientation180;
+ break;
+ case 270:
+ SurfaceFlinger::primaryDisplayOrientation = DisplayState::eOrientation270;
+ break;
+ }
+ }
mInternalDisplayPrimaries = sysprop::getDisplayNativePrimaries();
--
2.17.1