v106
diff --git a/patches/platform_frameworks_native/0004-Enable-fallback-to-old-ro.sf.hwrotation-property.patch b/patches/platform_frameworks_native/0004-Enable-fallback-to-old-ro.sf.hwrotation-property.patch
new file mode 100644
index 0000000..658e08a
--- /dev/null
+++ b/patches/platform_frameworks_native/0004-Enable-fallback-to-old-ro.sf.hwrotation-property.patch
@@ -0,0 +1,41 @@
+From c1d5c4623ee96cc37299a7da3034b8e8a1e62e9d Mon Sep 17 00:00:00 2001
+From: phh <phh@phh.me>
+Date: Wed, 22 Aug 2018 08:57:52 +0000
+Subject: [PATCH 4/4] 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 729671d..f5bbae7 100644
+--- a/services/surfaceflinger/SurfaceFlinger.cpp
++++ b/services/surfaceflinger/SurfaceFlinger.cpp
+@@ -291,6 +291,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.7.4
+