Add device specific keypress vibration duration database
Bug: 8556975 Change-Id: I11260a64dc13c102bac7a9742dc66f2b05fd32demain
parent
0efd8d1b69
commit
b5f67e7faf
|
@ -21,13 +21,32 @@
|
||||||
<!-- Build condition,duration_in_milliseconds -->
|
<!-- Build condition,duration_in_milliseconds -->
|
||||||
<string-array name="keypress_vibration_durations" translatable="false">
|
<string-array name="keypress_vibration_durations" translatable="false">
|
||||||
<!-- Nexus S -->
|
<!-- Nexus S -->
|
||||||
<item>HARDWARE=herring,5</item>
|
<item>MODEL=Nexus S:BRAND=google,5</item>
|
||||||
<!-- Galaxy Nexus -->
|
<!-- Galaxy Nexus -->
|
||||||
<item>HARDWARE=tuna,5</item>
|
<item>MODEL=Galaxy Nexus:BRAND=google,5</item>
|
||||||
<!-- Nexus 4 -->
|
<!-- Nexus 4 -->
|
||||||
<item>HARDWARE=mako,5</item>
|
<item>MODEL=Nexus 4:BRAND=google,8</item>
|
||||||
<!-- Nexus 10 -->
|
<!-- Nexus 10 -->
|
||||||
<item>HARDWARE=manta,16</item>
|
<item>MODEL=Nexus 10:BRAND=google,16</item>
|
||||||
|
<!-- Samsung Galaxy SII -->
|
||||||
|
<item>MODEL=GT-I(9100[GMPT]?|9108|9210T?):MANUFACTURER=samsung,8</item>
|
||||||
|
<item>MODEL=SGH-(I9[27]7R?|I927|T989D?):MANUFACTURER=samsung,8</item>
|
||||||
|
<item>MODEL=SHW-M250[KLS]?|SPH-D710|SCH-R760:MANUFACTURER=samsung,8</item>
|
||||||
|
<item>MODEL=ISW11SC|SC-02C:MANUFACTURER=samsung,8</item>
|
||||||
|
<!-- Samsung Galaxy SIII -->
|
||||||
|
<item>MODEL=(SAMSUNG-)?GT-I(930[05][NT]?|9308):MANUFACTURER=samsung,8</item>
|
||||||
|
<item>MODEL=(SAMSUNG-)?SGH-(T999[V]?|I747[M]?|N064|N035):MANUFACTURER=samsung,8</item>
|
||||||
|
<item>MODEL=(SAMSUNG-)?SCH-(J021|R530|I535|I939):MANUFACTURER=samsung,8</item>
|
||||||
|
<item>MODEL=(SAMSUNG-)?(SCL21|SC-06D|SC-03E]):MANUFACTURER=samsung,8</item>
|
||||||
|
<item>MODEL=(SAMSUNG-)?(SHV-210[KLS]?|SPH-L710):MANUFACTURER=samsung,8</item>
|
||||||
|
<!-- LG Optimus G -->
|
||||||
|
<item>MODEL=LG-E97[013]|LS970|L-01E:MANUFACTURER=LGE,15</item>
|
||||||
|
<!-- HTC One X -->
|
||||||
|
<item>MODEL=HTC One X:MANUFACTURER=HTC,15</item>
|
||||||
|
<!-- Motorola Razor M -->
|
||||||
|
<item>MODEL=XT907:MANUFACTURER=motorola,30</item>
|
||||||
|
<!-- Sony Xperia Z -->
|
||||||
|
<item>MODEL=C6603:MANUFACTURER=Sony,35</item>
|
||||||
<!-- Default value for unknown device -->
|
<!-- Default value for unknown device -->
|
||||||
<item>,20</item>
|
<item>,20</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
|
|
|
@ -30,7 +30,6 @@ import java.util.HashMap;
|
||||||
|
|
||||||
public final class ResourceUtils {
|
public final class ResourceUtils {
|
||||||
private static final String TAG = ResourceUtils.class.getSimpleName();
|
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 float UNDEFINED_RATIO = -1.0f;
|
||||||
public static final int UNDEFINED_DIMENSION = -1;
|
public static final int UNDEFINED_DIMENSION = -1;
|
||||||
|
@ -45,6 +44,7 @@ public final class ResourceUtils {
|
||||||
private static final String[] BUILD_KEYS_AND_VALUES = {
|
private static final String[] BUILD_KEYS_AND_VALUES = {
|
||||||
"HARDWARE", Build.HARDWARE,
|
"HARDWARE", Build.HARDWARE,
|
||||||
"MODEL", Build.MODEL,
|
"MODEL", Build.MODEL,
|
||||||
|
"BRAND", Build.BRAND,
|
||||||
"MANUFACTURER", Build.MANUFACTURER
|
"MANUFACTURER", Build.MANUFACTURER
|
||||||
};
|
};
|
||||||
private static final HashMap<String, String> sBuildKeyValues;
|
private static final HashMap<String, String> sBuildKeyValues;
|
||||||
|
@ -75,12 +75,10 @@ public final class ResourceUtils {
|
||||||
final String overrideValue = findConstantForKeyValuePairs(sBuildKeyValues, overrideArray);
|
final String overrideValue = findConstantForKeyValuePairs(sBuildKeyValues, overrideArray);
|
||||||
// The overrideValue might be an empty string.
|
// The overrideValue might be an empty string.
|
||||||
if (overrideValue != null) {
|
if (overrideValue != null) {
|
||||||
if (DEBUG) {
|
Log.i(TAG, "Find override value:"
|
||||||
Log.d(TAG, "Find override value:"
|
+ " resource="+ res.getResourceEntryName(overrideResId)
|
||||||
+ " resource="+ res.getResourceEntryName(overrideResId)
|
+ " build=" + sBuildKeyValuesDebugString
|
||||||
+ " build=" + sBuildKeyValuesDebugString
|
+ " override=" + overrideValue);
|
||||||
+ " override=" + overrideValue);
|
|
||||||
}
|
|
||||||
sDeviceOverrideValueMap.put(key, overrideValue);
|
sDeviceOverrideValueMap.put(key, overrideValue);
|
||||||
return overrideValue;
|
return overrideValue;
|
||||||
}
|
}
|
||||||
|
@ -91,10 +89,11 @@ public final class ResourceUtils {
|
||||||
Log.w(TAG, "Couldn't find override value nor default value:"
|
Log.w(TAG, "Couldn't find override value nor default value:"
|
||||||
+ " resource="+ res.getResourceEntryName(overrideResId)
|
+ " resource="+ res.getResourceEntryName(overrideResId)
|
||||||
+ " build=" + sBuildKeyValuesDebugString);
|
+ " build=" + sBuildKeyValuesDebugString);
|
||||||
} else if (DEBUG) {
|
} else {
|
||||||
Log.d(TAG, "Found default value:"
|
Log.i(TAG, "Found default value:"
|
||||||
+ " resource="+ res.getResourceEntryName(overrideResId)
|
+ " resource="+ res.getResourceEntryName(overrideResId)
|
||||||
+ " build=" + sBuildKeyValuesDebugString + " default=" + defaultValue);
|
+ " build=" + sBuildKeyValuesDebugString
|
||||||
|
+ " default=" + defaultValue);
|
||||||
}
|
}
|
||||||
sDeviceOverrideValueMap.put(key, defaultValue);
|
sDeviceOverrideValueMap.put(key, defaultValue);
|
||||||
return defaultValue;
|
return defaultValue;
|
||||||
|
|
Loading…
Reference in New Issue