From b5f67e7faf498eac634be0cfd2b8d4ac7e9a3b76 Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Mon, 13 May 2013 16:49:44 +0900 Subject: [PATCH] Add device specific keypress vibration duration database Bug: 8556975 Change-Id: I11260a64dc13c102bac7a9742dc66f2b05fd32de --- .../values/keypress-vibration-durations.xml | 27 ++++++++++++++++--- .../inputmethod/latin/ResourceUtils.java | 21 +++++++-------- 2 files changed, 33 insertions(+), 15 deletions(-) diff --git a/java/res/values/keypress-vibration-durations.xml b/java/res/values/keypress-vibration-durations.xml index 53aad72b7..ac502f5b0 100644 --- a/java/res/values/keypress-vibration-durations.xml +++ b/java/res/values/keypress-vibration-durations.xml @@ -21,13 +21,32 @@ - HARDWARE=herring,5 + MODEL=Nexus S:BRAND=google,5 - HARDWARE=tuna,5 + MODEL=Galaxy Nexus:BRAND=google,5 - HARDWARE=mako,5 + MODEL=Nexus 4:BRAND=google,8 - HARDWARE=manta,16 + MODEL=Nexus 10:BRAND=google,16 + + MODEL=GT-I(9100[GMPT]?|9108|9210T?):MANUFACTURER=samsung,8 + MODEL=SGH-(I9[27]7R?|I927|T989D?):MANUFACTURER=samsung,8 + MODEL=SHW-M250[KLS]?|SPH-D710|SCH-R760:MANUFACTURER=samsung,8 + MODEL=ISW11SC|SC-02C:MANUFACTURER=samsung,8 + + MODEL=(SAMSUNG-)?GT-I(930[05][NT]?|9308):MANUFACTURER=samsung,8 + MODEL=(SAMSUNG-)?SGH-(T999[V]?|I747[M]?|N064|N035):MANUFACTURER=samsung,8 + MODEL=(SAMSUNG-)?SCH-(J021|R530|I535|I939):MANUFACTURER=samsung,8 + MODEL=(SAMSUNG-)?(SCL21|SC-06D|SC-03E]):MANUFACTURER=samsung,8 + MODEL=(SAMSUNG-)?(SHV-210[KLS]?|SPH-L710):MANUFACTURER=samsung,8 + + MODEL=LG-E97[013]|LS970|L-01E:MANUFACTURER=LGE,15 + + MODEL=HTC One X:MANUFACTURER=HTC,15 + + MODEL=XT907:MANUFACTURER=motorola,30 + + MODEL=C6603:MANUFACTURER=Sony,35 ,20 diff --git a/java/src/com/android/inputmethod/latin/ResourceUtils.java b/java/src/com/android/inputmethod/latin/ResourceUtils.java index 03b7efba9..a9fba5348 100644 --- a/java/src/com/android/inputmethod/latin/ResourceUtils.java +++ b/java/src/com/android/inputmethod/latin/ResourceUtils.java @@ -30,7 +30,6 @@ import java.util.HashMap; public final class ResourceUtils { private static final String TAG = ResourceUtils.class.getSimpleName(); - private static final boolean DEBUG = false; public static final float UNDEFINED_RATIO = -1.0f; public static final int UNDEFINED_DIMENSION = -1; @@ -45,6 +44,7 @@ public final class ResourceUtils { private static final String[] BUILD_KEYS_AND_VALUES = { "HARDWARE", Build.HARDWARE, "MODEL", Build.MODEL, + "BRAND", Build.BRAND, "MANUFACTURER", Build.MANUFACTURER }; private static final HashMap sBuildKeyValues; @@ -75,12 +75,10 @@ public final class ResourceUtils { final String overrideValue = findConstantForKeyValuePairs(sBuildKeyValues, overrideArray); // The overrideValue might be an empty string. if (overrideValue != null) { - if (DEBUG) { - Log.d(TAG, "Find override value:" - + " resource="+ res.getResourceEntryName(overrideResId) - + " build=" + sBuildKeyValuesDebugString - + " override=" + overrideValue); - } + Log.i(TAG, "Find override value:" + + " resource="+ res.getResourceEntryName(overrideResId) + + " build=" + sBuildKeyValuesDebugString + + " override=" + overrideValue); sDeviceOverrideValueMap.put(key, overrideValue); return overrideValue; } @@ -91,10 +89,11 @@ public final class ResourceUtils { Log.w(TAG, "Couldn't find override value nor default value:" + " resource="+ res.getResourceEntryName(overrideResId) + " build=" + sBuildKeyValuesDebugString); - } else if (DEBUG) { - Log.d(TAG, "Found default value:" - + " resource="+ res.getResourceEntryName(overrideResId) - + " build=" + sBuildKeyValuesDebugString + " default=" + defaultValue); + } else { + Log.i(TAG, "Found default value:" + + " resource="+ res.getResourceEntryName(overrideResId) + + " build=" + sBuildKeyValuesDebugString + + " default=" + defaultValue); } sDeviceOverrideValueMap.put(key, defaultValue); return defaultValue;