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
diff --git a/core/java/com/android/internal/view/RotationPolicy.java b/core/java/com/android/internal/view/RotationPolicy.java
index ebbb92e..1b9e2a9 100644
--- a/core/java/com/android/internal/view/RotationPolicy.java
+++ b/core/java/com/android/internal/view/RotationPolicy.java
@@ -89,10 +89,12 @@
      * 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);
     }
 
     /**
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index 051ed66..2931724 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -580,6 +580,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>
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index 83ebfd1..27edfa0 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -1479,6 +1479,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" />