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

Commit 62833329 authored by kaiyiz's avatar kaiyiz Committed by Gerrit - the friendly Code Review server
Browse files

SystemUI: Make rotation lock toggle always visible

By original design, if "AUTO ROTATE" is disabled in Settings/Display or
Settings/Accessibility, HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY will
be set to 1, then "AUTO ROTATE" will be hidden in quick settings.

Make sure rotation lock toggle is always visible when the configuration
of config_forceSupportRotationLockToggle is true.

CRs-Fixed: 722206

Change-Id: Iee10dac5c9dd1c2446258b04c8f2821267a02cbc
parent b561fb18
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -90,10 +90,12 @@ public final class RotationPolicy {
     * Returns true if the rotation-lock toggle should be shown in system UI.
     */
    public static boolean isRotationLockToggleVisible(Context context) {
        return isRotationSupported(context) &&
        boolean forceSupportRotationLock = context.getResources().getBoolean(
                com.android.internal.R.bool.config_forceSupportRotationLockToggle);
        return isRotationSupported(context) && (forceSupportRotationLock ||
                Settings.System.getIntForUser(context.getContentResolver(),
                        Settings.System.HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY, 0,
                        UserHandle.USER_CURRENT) == 0;
                        UserHandle.USER_CURRENT) == 0);
    }

    /**
+3 −0
Original line number Diff line number Diff line
@@ -471,6 +471,9 @@
         docked if the dock is configured to enable the accelerometer. -->
    <bool name="config_supportAutoRotation">true</bool>

    <!-- Configuration to support rotation lock toggle -->
    <bool name="config_forceSupportRotationLockToggle">false</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
@@ -1466,6 +1466,7 @@
  <java-symbol type="bool" name="config_reverseDefaultRotation" />
  <java-symbol type="bool" name="config_showNavigationBar" />
  <java-symbol type="bool" name="config_supportAutoRotation" />
  <java-symbol type="bool" name="config_forceSupportRotationLockToggle" />
  <java-symbol type="bool" name="target_honeycomb_needs_options_menu" />
  <java-symbol type="dimen" name="navigation_bar_height" />
  <java-symbol type="dimen" name="navigation_bar_height_landscape" />