From c90181d6aa42c4c0b56ccc21528dcef84d186c53 Mon Sep 17 00:00:00 2001
From: "Tadashi G. Takaoka" <takaoka@google.com>
Date: Tue, 18 Jun 2013 16:29:39 +0900
Subject: [PATCH] Use system default key press volume

Bug: 9475973
Change-Id: I6ae825b161dde69e19b52d73fb9aa782e2aa7423
---
 java/res/values/keypress-volumes.xml                         | 4 ++--
 java/src/com/android/inputmethod/latin/SettingsFragment.java | 3 +++
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/java/res/values/keypress-volumes.xml b/java/res/values/keypress-volumes.xml
index a096c341b9..d359055c29 100644
--- a/java/res/values/keypress-volumes.xml
+++ b/java/res/values/keypress-volumes.xml
@@ -26,7 +26,7 @@
         <item>HARDWARE=grouper,0.3f</item>
         <item>HARDWARE=mako,0.3f</item>
         <item>HARDWARE=manta,0.2f</item>
-        <!-- Default value for unknown device -->
-        <item>,0.2f</item>
+        <!-- Default value for unknown device. The negative value means system default. -->
+        <item>,-1.0f</item>
     </string-array>
 </resources>
diff --git a/java/src/com/android/inputmethod/latin/SettingsFragment.java b/java/src/com/android/inputmethod/latin/SettingsFragment.java
index 6587b40abc..8017ce1619 100644
--- a/java/src/com/android/inputmethod/latin/SettingsFragment.java
+++ b/java/src/com/android/inputmethod/latin/SettingsFragment.java
@@ -453,6 +453,9 @@ public final class SettingsFragment extends InputMethodSettingsFragment
 
             @Override
             public String getValueText(final int value) {
+                if (value < 0) {
+                    return res.getString(R.string.settings_system_default);
+                }
                 return Integer.toString(value);
             }
 
-- 
GitLab