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

Commit 17146f83 authored by Yi Jiang's avatar Yi Jiang Committed by Presubmit Automerger Backend
Browse files

[automerge] Gates RotationResolverService with a config flag 2p: 8dd4fb80

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/22791220

Bug: 266824653
Change-Id: I34581bbf43ab4649d152f8f8eaab8883ec95884f
parents 094a8d34 8dd4fb80
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -556,6 +556,9 @@
         docked if the dock is configured to enable the accelerometer. -->
    <bool name="config_supportAutoRotation">true</bool>

    <!-- If true, allows rotation resolver service to help resolve screen rotation. -->
    <bool name="config_allowRotationResolver">true</bool>

    <!-- If true, the screen can be rotated via the accelerometer in all 4
         rotations as the default behavior. -->
    <bool name="config_allowAllRotations">false</bool>
+1 −0
Original line number Diff line number Diff line
@@ -1747,6 +1747,7 @@
  <java-symbol type="bool" name="config_perDisplayFocusEnabled" />
  <java-symbol type="bool" name="config_showNavigationBar" />
  <java-symbol type="bool" name="config_supportAutoRotation" />
  <java-symbol type="bool" name="config_allowRotationResolver" />
  <java-symbol type="bool" name="config_dockedStackDividerFreeSnapMode" />
  <java-symbol type="dimen" name="docked_stack_divider_thickness" />
  <java-symbol type="dimen" name="docked_stack_divider_insets" />
+5 −1
Original line number Diff line number Diff line
@@ -123,6 +123,7 @@ public class DisplayRotation {

    public final boolean isDefaultDisplay;
    private final boolean mSupportAutoRotation;
    private final boolean mAllowRotationResolver;
    private final int mLidOpenRotation;
    private final int mCarDockRotation;
    private final int mDeskDockRotation;
@@ -265,6 +266,8 @@ public class DisplayRotation {

        mSupportAutoRotation =
                mContext.getResources().getBoolean(R.bool.config_supportAutoRotation);
        mAllowRotationResolver =
                mContext.getResources().getBoolean(R.bool.config_allowRotationResolver);
        mLidOpenRotation = readRotation(R.integer.config_lidOpenRotation);
        mCarDockRotation = readRotation(R.integer.config_carDockRotation);
        mDeskDockRotation = readRotation(R.integer.config_deskDockRotation);
@@ -1992,7 +1995,8 @@ public class DisplayRotation {

        @Override
        public boolean isRotationResolverEnabled() {
            return mUserRotationMode == WindowManagerPolicy.USER_ROTATION_FREE
            return mAllowRotationResolver
                    && mUserRotationMode == WindowManagerPolicy.USER_ROTATION_FREE
                    && mCameraRotationMode == CAMERA_ROTATION_ENABLED
                    && !mService.mPowerManager.isPowerSaveMode();
        }