LatinIME: Add setting for theme to follow system setting

* Add a setting to follow the system design (light/dark)
* Make it default for >= Q
* Rework the handling to differentiate between selected theme
  (by id) and actual theme we use

Change-Id: I380e3540b2437102685aa632c5b0a2f2dff11e1b
diff --git a/java/res/values/custom_strings.xml b/java/res/values/custom_strings.xml
new file mode 100644
index 0000000..70445ec
--- /dev/null
+++ b/java/res/values/custom_strings.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2015 The CyanogenMod 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.
+ -->
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <string name="keyboard_theme_follow_system">Follow system settings</string>
+</resources>
diff --git a/java/res/values/keyboard-themes.xml b/java/res/values/keyboard-themes.xml
index 26b2582..2826f5f 100644
--- a/java/res/values/keyboard-themes.xml
+++ b/java/res/values/keyboard-themes.xml
@@ -22,6 +22,7 @@
     <string-array name="keyboard_theme_names" translatable="false">
         <item>@string/keyboard_theme_material_light</item>
         <item>@string/keyboard_theme_material_dark</item>
+        <item>@string/keyboard_theme_follow_system</item>
         <item>@string/keyboard_theme_holo_white</item>
         <item>@string/keyboard_theme_holo_blue</item>
     </string-array>
@@ -30,6 +31,7 @@
     <integer-array name="keyboard_theme_ids" translatable="false">
         <item>3</item>
         <item>4</item>
+        <item>5</item>
         <item>2</item>
         <item>0</item>
     </integer-array>