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

Commit 77132a8b authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "display : Align all rotation values according to panel orientation"

parents 8802329d cd905364
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -238,6 +238,16 @@ status_t BootAnimation::readyToRun() {
    if (status)
        return -1;

    char value[PROPERTY_VALUE_MAX];
    property_get("persist.panel.orientation", value, "0");
    int orient = atoi(value)/90;
    if (orient == eOrientation90 || orient == eOrientation270) {
        int temp = dinfo.h;
        dinfo.h = dinfo.w;
        dinfo.w = temp;
    }
    Rect destRect(dinfo.w, dinfo.h);
    mSession->setDisplayProjection(dtoken, orient, destRect, destRect);
    // create the native surface
    sp<SurfaceControl> control = session()->createSurface(String8("BootAnimation"),
            dinfo.w, dinfo.h, PIXEL_FORMAT_RGB_565);
+6 −0
Original line number Diff line number Diff line
@@ -51,6 +51,12 @@ private:
    virtual void        onFirstRef();
    virtual void        binderDied(const wp<IBinder>& who);

    enum {
        eOrientationDefault     = 0,
        eOrientation90          = 1,
        eOrientation180         = 2,
        eOrientation270         = 3,
    };
    struct Texture {
        GLint   w;
        GLint   h;
+10 −4
Original line number Diff line number Diff line
@@ -32,9 +32,8 @@ import android.view.Display;
import android.view.IWindowManager;
import android.view.Surface;
import android.view.WindowManagerGlobal;

import com.android.internal.R;

import android.os.SystemProperties;
/**
 * Provides helper functions for configuring the display rotation policy.
 */
@@ -140,7 +139,14 @@ public final class RotationPolicy {
                try {
                    IWindowManager wm = WindowManagerGlobal.getWindowManagerService();
                    if (enabled) {
                        //Consider input rotation parameter even if display panel is mounted
                        //with 90 or 180 or 270 degrees rotated.
                        if (rotation < 0) {
                           wm.freezeRotation(rotation);
                        } else {
                           wm.freezeRotation(SystemProperties.getInt(
                                "persist.panel.orientation", 0)/90);
                        }
                    } else {
                        wm.thawRotation();
                    }
+7 −3
Original line number Diff line number Diff line
@@ -579,6 +579,9 @@ public class PhoneWindowManager implements WindowManagerPolicy {
    int mOverscanRight = 0;
    int mOverscanBottom = 0;

    // Panel Orientation default portrait
    private int mPanelOrientation = Surface.ROTATION_0;

    // What we do when the user long presses on home
    private int mLongPressOnHomeBehavior;

@@ -1592,7 +1595,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
            return;
        }
        mDisplay = display;

        mPanelOrientation =
            SystemProperties.getInt("persist.panel.orientation", 0) / 90;
        final Resources res = mContext.getResources();
        int shortSize, longSize;
        if (width > height) {
@@ -5905,7 +5909,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                    mAllowAllRotations = mContext.getResources().getBoolean(
                            com.android.internal.R.bool.config_allowAllRotations) ? 1 : 0;
                }
                if (sensorRotation != Surface.ROTATION_180
                if (sensorRotation != mUpsideDownRotation
                        || mAllowAllRotations == 1
                        || orientation == ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR
                        || orientation == ActivityInfo.SCREEN_ORIENTATION_FULL_USER) {
@@ -5983,7 +5987,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                    if (preferredRotation >= 0) {
                        return preferredRotation;
                    }
                    return Surface.ROTATION_0;
                    return mPanelOrientation;
            }
        }
    }
+1 −1
Original line number Diff line number Diff line
@@ -467,7 +467,7 @@ public class WindowManagerService extends IWindowManager.Stub
    /** All DisplayContents in the world, kept here */
    SparseArray<DisplayContent> mDisplayContents = new SparseArray<>(2);

    int mRotation = 0;
    int mRotation = SystemProperties.getInt("persist.panel.orientation", 0) / 90;
    int mForcedAppOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
    boolean mAltOrientation = false;