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

Commit 2ae2eafb authored by Sushil Chauhan's avatar Sushil Chauhan Committed by Linux Build Service Account
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 15a1667d
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -128,9 +128,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
@@ -480,6 +480,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");
}
@@ -1318,9 +1319,15 @@ 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);
                            }
                        }
                        if (state.width != draw[i].width || state.height != draw[i].height) {
                            disp->setDisplaySize(state.width, state.height);
                        }