Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2326d769 authored by Sushil Chauhan's avatar Sushil Chauhan Committed by Steve Kondik
Browse files

Init display orientation according to panel orientation

   - Initialize the display default orientation to panel orientation.
   - honor the panel orientation only after the end of boot animation
     or the new orientation is as same as panel orientation.

Change-Id: Ieece097ff7c3710e379f47028900aed59a96c8d5
parent 934d46aa
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -129,9 +129,14 @@ DisplayDevice::DisplayDevice(
            mDisplayName = "Virtual Screen";    // e.g. Overlay #n
            break;
    }
    char property[PROPERTY_VALUE_MAX];
    int panelOrientation = DisplayState::eOrientationDefault;
    // Set the panel orientation from the property.
    property_get("persist.panel.orientation", property, "0");
    panelOrientation = atoi(property) / 90;

    // initialize the display orientation transform.
    setProjection(DisplayState::eOrientationDefault, mViewport, mFrame);
    setProjection(panelOrientation, mViewport, mFrame);
}

DisplayDevice::~DisplayDevice() {
+9 −2
Original line number Diff line number Diff line
@@ -668,6 +668,7 @@ int32_t SurfaceFlinger::allocateHwcDisplayId(DisplayDevice::DisplayType type) {

void SurfaceFlinger::startBootAnim() {
    // start boot animation
    mBootFinished = false;
    property_set("service.bootanim.exit", "0");
    property_set("ctl.start", "bootanim");
}
@@ -1502,12 +1503,18 @@ void SurfaceFlinger::handleTransactionLocked(uint32_t transactionFlags)
                                || (state.viewport != draw[i].viewport)
                                || (state.frame != draw[i].frame))
                        {
                            // Honor the orientation change after boot
                            // animation completes or the new orientation is
                            // same as panel orientation..
                            if(mBootFinished ||
                               state.orientation == disp->getOrientation()) {
                                disp->setProjection(state.orientation,
                                        state.viewport, state.frame);
                            }
                        }
                    }
                }
            }

            // find displays that were added
            // (ie: in current state but not in drawing state)