Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions core/res/res/values/cr_config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,17 @@

<!-- Whether to cancel fingerprint operation if not idle -->
<bool name="config_fpCancelIfNotIdle">false</bool>

<!-- Vibrator pattern for feedback meant to replicate soft ticks (feels like texture underneath
the user's fingers), in gestures called repeatedly (such as dragging a slider thumb).

This is supposed to be used as a fallback pattern when hardware-specific implementation of
the effect does not exist, but it will still take over if the timings array is not empty.
-->
<integer-array name="config_textureTickVibePattern">
<!--
<item>0</item>
<item>10</item>
-->
</integer-array>
</resources>
3 changes: 3 additions & 0 deletions core/res/res/values/cr_symbols.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,7 @@

<!-- GameSpace -->
<java-symbol type="string" name="gamespace_new_game_added" />

<!-- Vibrator service -->
<java-symbol type="array" name="config_textureTickVibePattern" />
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -791,14 +791,16 @@ private static SparseArray<VibrationEffect> createEffectsFromResource(Resources
com.android.internal.R.array.config_longPressVibePattern);
VibrationEffect tickEffect = createEffectFromResource(resources,
com.android.internal.R.array.config_clockTickVibePattern);
VibrationEffect textureTickEffect = createEffectFromResource(resources,
com.android.internal.R.array.config_textureTickVibePattern);

SparseArray<VibrationEffect> effects = new SparseArray<>();
effects.put(VibrationEffect.EFFECT_CLICK, clickEffect);
effects.put(VibrationEffect.EFFECT_DOUBLE_CLICK, doubleClickEffect);
effects.put(VibrationEffect.EFFECT_TICK, tickEffect);
effects.put(VibrationEffect.EFFECT_HEAVY_CLICK, heavyClickEffect);
effects.put(VibrationEffect.EFFECT_TEXTURE_TICK,
VibrationEffect.get(VibrationEffect.EFFECT_TICK, false));
effects.put(VibrationEffect.EFFECT_TEXTURE_TICK, textureTickEffect != null
? textureTickEffect : VibrationEffect.get(VibrationEffect.EFFECT_TICK, false));

return effects;
}
Expand Down