Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LatinIME
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
keyboard
LatinIME
Commits
f6b5484d
Commit
f6b5484d
authored
11 years ago
by
Tadashi G. Takaoka
Committed by
Android Git Automerger
11 years ago
Browse files
Options
Downloads
Plain Diff
am
b5f67e7f
: Add device specific keypress vibration duration database
* commit '
b5f67e7f
': Add device specific keypress vibration duration database
parents
f1708394
b5f67e7f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
java/res/values/keypress-vibration-durations.xml
+23
-4
23 additions, 4 deletions
java/res/values/keypress-vibration-durations.xml
java/src/com/android/inputmethod/latin/ResourceUtils.java
+10
-11
10 additions, 11 deletions
java/src/com/android/inputmethod/latin/ResourceUtils.java
with
33 additions
and
15 deletions
java/res/values/keypress-vibration-durations.xml
+
23
−
4
View file @
f6b5484d
...
...
@@ -21,13 +21,32 @@
<!-- Build condition,duration_in_milliseconds -->
<string-array
name=
"keypress_vibration_durations"
translatable=
"false"
>
<!-- Nexus S -->
<item>
HARDWARE=herring
,5
</item>
<item>
MODEL=Nexus S:BRAND=google
,5
</item>
<!-- Galaxy Nexus -->
<item>
HARDWARE=tuna
,5
</item>
<item>
MODEL=Galaxy Nexus:BRAND=google
,5
</item>
<!-- Nexus 4 -->
<item>
HARDWARE=mako,5
</item>
<item>
MODEL=Nexus 4:BRAND=google,8
</item>
<!-- 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 -->
<item>
,20
</item>
</string-array>
...
...
This diff is collapsed.
Click to expand it.
java/src/com/android/inputmethod/latin/ResourceUtils.java
+
10
−
11
View file @
f6b5484d
...
...
@@ -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
<
String
,
String
>
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
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment