Jackeagle | a3ae16b | 2018-12-04 11:30:49 -0500 | [diff] [blame^] | 1 | From ab72887deb1b7b297efc3bb26a62e23069a42081 Mon Sep 17 00:00:00 2001 |
Pierre-Hugues Husson | 5d5d68a | 2018-10-02 16:41:21 +0200 | [diff] [blame] | 2 | From: phh <phh@phh.me> |
| 3 | Date: Wed, 22 Aug 2018 08:57:52 +0000 |
Jackeagle | a3ae16b | 2018-12-04 11:30:49 -0500 | [diff] [blame^] | 4 | Subject: [PATCH] Enable fallback to old ro.sf.hwrotation property |
Pierre-Hugues Husson | 5d5d68a | 2018-10-02 16:41:21 +0200 | [diff] [blame] | 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 |
Jackeagle | a3ae16b | 2018-12-04 11:30:49 -0500 | [diff] [blame^] | 11 | index b2d4637f1..22b13a578 100644 |
Pierre-Hugues Husson | 5d5d68a | 2018-10-02 16:41:21 +0200 | [diff] [blame] | 12 | --- a/services/surfaceflinger/SurfaceFlinger.cpp |
| 13 | +++ b/services/surfaceflinger/SurfaceFlinger.cpp |
Jackeagle | a3ae16b | 2018-12-04 11:30:49 -0500 | [diff] [blame^] | 14 | @@ -292,6 +292,24 @@ SurfaceFlinger::SurfaceFlinger() : SurfaceFlinger(SkipInitialization) { |
Pierre-Hugues Husson | 5d5d68a | 2018-10-02 16:41:21 +0200 | [diff] [blame] | 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 | -- |
Jackeagle | a3ae16b | 2018-12-04 11:30:49 -0500 | [diff] [blame^] | 40 | 2.17.1 |
Pierre-Hugues Husson | 5d5d68a | 2018-10-02 16:41:21 +0200 | [diff] [blame] | 41 | |