Refactor Key.isFunctional to more generic Key.keyType

Bug: 5232726
Change-Id: Idc861ca725f62eaf37795f57401573394a17d6d3
diff --git a/java/res/values/attrs.xml b/java/res/values/attrs.xml
index 9358c90..3275cd0 100644
--- a/java/res/values/attrs.xml
+++ b/java/res/values/attrs.xml
@@ -194,8 +194,11 @@
         <attr name="moreKeys" format="string" />
         <!-- Maximum column of more keys keyboard -->
         <attr name="maxMoreKeysColumn" format="integer" />
-        <!-- Whether this is a functional key which has different key top than normal key. -->
-        <attr name="isFunctional" format="boolean" />
+        <attr name="backgroundType" format="enum">
+            <!-- This should be aligned with Key.BACKGROUND_TYPE_* -->
+            <enum name="normal" value="0" />
+            <enum name="functional" value="1" />
+        </attr>
         <!-- Whether this is a toggle key. -->
         <attr name="isSticky" format="boolean" />
         <!-- Whether long-pressing on this key will make it repeat. -->
diff --git a/java/res/xml-sw600dp/kbd_key_styles.xml b/java/res/xml-sw600dp/kbd_key_styles.xml
index 2c31e27..dfc7409 100644
--- a/java/res/xml-sw600dp/kbd_key_styles.xml
+++ b/java/res/xml-sw600dp/kbd_key_styles.xml
@@ -24,7 +24,7 @@
     <!-- Base key style for the functional key -->
     <key-style
         latin:styleName="functionalKeyStyle"
-        latin:isFunctional="true" />
+        latin:backgroundType="functional" />
     <!-- Base key style for the key which may have settings key as popup key -->
     <switch>
         <case
diff --git a/java/res/xml-sw768dp/kbd_key_styles.xml b/java/res/xml-sw768dp/kbd_key_styles.xml
index 6570ebc..f7dcc20 100644
--- a/java/res/xml-sw768dp/kbd_key_styles.xml
+++ b/java/res/xml-sw768dp/kbd_key_styles.xml
@@ -24,7 +24,7 @@
     <!-- Functional key styles -->
     <key-style
         latin:styleName="functionalKeyStyle"
-        latin:isFunctional="true" />
+        latin:backgroundType="functional" />
     <key-style
         latin:styleName="shiftKeyStyle"
         latin:code="@integer/key_shift"
diff --git a/java/res/xml/kbd_key_styles.xml b/java/res/xml/kbd_key_styles.xml
index 84b1900..e1f68d4 100644
--- a/java/res/xml/kbd_key_styles.xml
+++ b/java/res/xml/kbd_key_styles.xml
@@ -24,7 +24,7 @@
     <!-- Base key style for the functional key -->
     <key-style
         latin:styleName="functionalKeyStyle"
-        latin:isFunctional="true" />
+        latin:backgroundType="functional" />
     <!-- Base key style for the key which may have settings or tab key as popup key. -->
     <switch>
         <case