Pierre-Hugues Husson | 5d5d68a | 2018-10-02 16:41:21 +0200 | [diff] [blame^] | 1 | From c1d5c4623ee96cc37299a7da3034b8e8a1e62e9d Mon Sep 17 00:00:00 2001 |
| 2 | From: phh <phh@phh.me> |
| 3 | Date: Wed, 22 Aug 2018 08:57:52 +0000 |
| 4 | Subject: [PATCH 4/4] Enable fallback to old ro.sf.hwrotation property |
| 5 | |
| 6 | --- |
| 7 | services/surfaceflinger/SurfaceFlinger.cpp | 18 ++++++++++++++++++ |
| 8 | 1 file changed, 18 insertions(+) |
| 9 | |
| 10 | diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp |
| 11 | index 729671d..f5bbae7 100644 |
| 12 | --- a/services/surfaceflinger/SurfaceFlinger.cpp |
| 13 | +++ b/services/surfaceflinger/SurfaceFlinger.cpp |
| 14 | @@ -291,6 +291,24 @@ SurfaceFlinger::SurfaceFlinger() : SurfaceFlinger(SkipInitialization) { |
| 15 | mPrimaryDisplayOrientation = DisplayState::eOrientationDefault; |
| 16 | break; |
| 17 | } |
| 18 | + |
| 19 | + if(primaryDisplayOrientation == V1_1::DisplayOrientation::ORIENTATION_0) { |
| 20 | + int sfRotation = property_get_int32("ro.sf.hwrotation", -1); |
| 21 | + switch(sfRotation) { |
| 22 | + case 0: |
| 23 | + mPrimaryDisplayOrientation = DisplayState::eOrientationDefault; |
| 24 | + break; |
| 25 | + case 90: |
| 26 | + mPrimaryDisplayOrientation = DisplayState::eOrientation90; |
| 27 | + break; |
| 28 | + case 180: |
| 29 | + mPrimaryDisplayOrientation = DisplayState::eOrientation180; |
| 30 | + break; |
| 31 | + case 270: |
| 32 | + mPrimaryDisplayOrientation = DisplayState::eOrientation270; |
| 33 | + break; |
| 34 | + } |
| 35 | + } |
| 36 | ALOGV("Primary Display Orientation is set to %2d.", mPrimaryDisplayOrientation); |
| 37 | |
| 38 | mPrimaryDispSync.init(SurfaceFlinger::hasSyncFramework, SurfaceFlinger::dispSyncPresentTimeOffset); |
| 39 | -- |
| 40 | 2.7.4 |
| 41 | |