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

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

Merge "frameworks/base:Align all rotation values according to panel orientation"

parents 3ce952aa 7c111371
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.internal.view;

import android.os.SystemProperties;
import android.content.Context;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
@@ -142,7 +143,8 @@ public final class RotationPolicy {
                try {
                    IWindowManager wm = WindowManagerGlobal.getWindowManagerService();
                    if (enabled) {
                        wm.freezeRotation(rotation);
                        wm.freezeRotation(SystemProperties.getInt(
                                "persist.panel.orientation", 0)/90);
                    } else {
                        wm.thawRotation();
                    }
+7 −2
Original line number Diff line number Diff line
@@ -584,6 +584,9 @@ public class PhoneWindowManager implements WindowManagerPolicy {
    int mOverscanRight = 0;
    int mOverscanBottom = 0;

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

    // What we do when the user double-taps on home
    private int mDoubleTapOnHomeBehavior;

@@ -1659,6 +1662,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;
@@ -5944,7 +5949,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) {
@@ -6022,7 +6027,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
@@ -486,7 +486,7 @@ public class WindowManagerService extends IWindowManager.Stub
    /** All DisplayContents in the world, kept here */
    SparseArray<DisplayContent> mDisplayContents = new SparseArray<DisplayContent>(2);

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