[2/2] OmniGears: readd custom rotation config support

Change-Id: Ia47aaccc066949bebfb6069e45b59b87fc5cbe11
diff --git a/res/values/custom_strings.xml b/res/values/custom_strings.xml
index d71941e..2891544 100644
--- a/res/values/custom_strings.xml
+++ b/res/values/custom_strings.xml
@@ -475,4 +475,16 @@
     <string name="system_category">System</string>
     <string name="custom_wall_browse_title">Omni wallpapers</string>
     <string name="custom_wall_browse_summary">Browse and set Omni branded wallpapers</string>
+
+    <!-- Display : Rotation -->
+    <string name="category_display">Display</string>
+    <string name="display_rotation_title">Rotation</string>
+    <string name="display_rotation_disabled">Disabled</string>
+    <string name="display_rotation_unit">degrees</string>
+    <string name="display_rotation_category_title">Rotation modes</string>
+    <string name="display_rotation_0_title">0 degrees</string>
+    <string name="display_rotation_90_title">90 degrees</string>
+    <string name="display_rotation_180_title">180 degrees</string>
+    <string name="display_rotation_270_title">270 degrees</string>
+    <string name="display_lockscreen_rotation_title">Lock screen</string>
 </resources>
diff --git a/res/xml/display_rotation.xml b/res/xml/display_rotation.xml
new file mode 100644
index 0000000..4fee35b
--- /dev/null
+++ b/res/xml/display_rotation.xml
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2010 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
+        android:title="@string/display_rotation_title"
+        xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
+
+    <SwitchPreference
+        android:key="accelerometer"
+        android:title="@string/accelerometer_title"
+        android:persistent="false" />
+
+    <CheckBoxPreference
+        android:key="lockscreen_rotation"
+        android:title="@string/display_lockscreen_rotation_title"
+        android:dependency="accelerometer"
+        android:persistent="false" />
+
+    <PreferenceCategory
+        android:key="display_rotation_category"
+        android:title="@string/display_rotation_category_title" />
+
+    <CheckBoxPreference
+        android:key="display_rotation_0"
+        android:title="@string/display_rotation_0_title"
+        android:layout="?android:attr/preferenceLayoutChild"
+        android:dependency="accelerometer"
+        android:persistent="false" />
+
+    <CheckBoxPreference
+        android:key="display_rotation_90"
+        android:title="@string/display_rotation_90_title"
+        android:layout="?android:attr/preferenceLayoutChild"
+        android:dependency="accelerometer"
+        android:persistent="false" />
+
+    <CheckBoxPreference
+        android:key="display_rotation_180"
+        android:title="@string/display_rotation_180_title"
+        android:layout="?android:attr/preferenceLayoutChild"
+        android:dependency="accelerometer"
+        android:persistent="false" />
+
+    <CheckBoxPreference
+        android:key="display_rotation_270"
+        android:title="@string/display_rotation_270_title"
+        android:layout="?android:attr/preferenceLayoutChild"
+        android:dependency="accelerometer"
+        android:persistent="false" />
+
+</PreferenceScreen>
diff --git a/res/xml/more_settings.xml b/res/xml/more_settings.xml
index bd28680..64fafea 100644
--- a/res/xml/more_settings.xml
+++ b/res/xml/more_settings.xml
@@ -43,6 +43,16 @@
         </PreferenceCategory>
 
         <PreferenceCategory
+            android:key="category_display"
+            android:title="@string/category_display">
+
+            <PreferenceScreen
+                android:key="display_rotation"
+                android:title="@string/display_rotation_title"
+                android:fragment="org.omnirom.omnigears.DisplayRotation" />
+        </PreferenceCategory>
+
+        <PreferenceCategory
             android:key="category_system"
             android:title="@string/system_category">