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

Commit 5eded94e authored by Steve Kondik's avatar Steve Kondik Committed by Gerrit Code Review
Browse files

Merge "In jellybean the initial patch for "abnormal hardware orientation" does...

Merge "In jellybean the initial patch for "abnormal hardware orientation" does not work anymore as it is not used in setRotation." into jellybean
parents ee7d82a2 4fe8deac
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -47,6 +47,7 @@ class ScreenRotationAnimation {
    BlackFrame mEnteringBlackFrame;
    BlackFrame mEnteringBlackFrame;
    int mWidth, mHeight;
    int mWidth, mHeight;


    int mSnapshotRotation;
    int mOriginalRotation;
    int mOriginalRotation;
    int mOriginalWidth, mOriginalHeight;
    int mOriginalWidth, mOriginalHeight;
    int mCurRotation;
    int mCurRotation;
@@ -188,7 +189,6 @@ class ScreenRotationAnimation {
    public ScreenRotationAnimation(Context context, SurfaceSession session,
    public ScreenRotationAnimation(Context context, SurfaceSession session,
            boolean inTransaction, int originalWidth, int originalHeight, int originalRotation) {
            boolean inTransaction, int originalWidth, int originalHeight, int originalRotation) {
        mContext = context;
        mContext = context;
        int mSnapshotRotation;
        // Allow for abnormal hardware orientation
        // Allow for abnormal hardware orientation
        mSnapshotRotation = (4 - android.os.SystemProperties.getInt("ro.sf.hwrotation",0) / 90) % 4;
        mSnapshotRotation = (4 - android.os.SystemProperties.getInt("ro.sf.hwrotation",0) / 90) % 4;
        if (mSnapshotRotation == Surface.ROTATION_0 || mSnapshotRotation == Surface.ROTATION_180) {
        if (mSnapshotRotation == Surface.ROTATION_0 || mSnapshotRotation == Surface.ROTATION_180) {
@@ -314,7 +314,7 @@ class ScreenRotationAnimation {
        // Compute the transformation matrix that must be applied
        // Compute the transformation matrix that must be applied
        // to the snapshot to make it stay in the same original position
        // to the snapshot to make it stay in the same original position
        // with the current screen rotation.
        // with the current screen rotation.
        int delta = deltaRotation(rotation, Surface.ROTATION_0);
        int delta = deltaRotation(rotation, mSnapshotRotation);
        createRotationMatrix(delta, mWidth, mHeight, mSnapshotInitialMatrix);
        createRotationMatrix(delta, mWidth, mHeight, mSnapshotInitialMatrix);


        if (DEBUG_STATE) Slog.v(TAG, "**** ROTATION: " + delta);
        if (DEBUG_STATE) Slog.v(TAG, "**** ROTATION: " + delta);